Menu
Sign In Search Podcasts Charts People & Topics Add Podcast API Blog Pricing

David Heinemeier Hansson (DHH)

๐Ÿ‘ค Speaker
4269 total appearances

Appearances Over Time

Podcast Appearances

Lex Fridman Podcast
#474 โ€“ DHH: Future of Programming, AI, Ruby on Rails, Productivity & Parenting

Why is this question mark in here?

Lex Fridman Podcast
#474 โ€“ DHH: Future of Programming, AI, Ruby on Rails, Productivity & Parenting

Because it just reads so nicely.

Lex Fridman Podcast
#474 โ€“ DHH: Future of Programming, AI, Ruby on Rails, Productivity & Parenting

If user admin question mark.

Lex Fridman Podcast
#474 โ€“ DHH: Future of Programming, AI, Ruby on Rails, Productivity & Parenting

That's a very human phrase, but it gets better.

Lex Fridman Podcast
#474 โ€“ DHH: Future of Programming, AI, Ruby on Rails, Productivity & Parenting

You can turn this around.

Lex Fridman Podcast
#474 โ€“ DHH: Future of Programming, AI, Ruby on Rails, Productivity & Parenting

You can have your statement you want to execute before the conditional.

Lex Fridman Podcast
#474 โ€“ DHH: Future of Programming, AI, Ruby on Rails, Productivity & Parenting

You can do user.upgrade.

Lex Fridman Podcast
#474 โ€“ DHH: Future of Programming, AI, Ruby on Rails, Productivity & Parenting

Let's say you're calling an upgrade method on a user.

Lex Fridman Podcast
#474 โ€“ DHH: Future of Programming, AI, Ruby on Rails, Productivity & Parenting

Space if, space user.admin question mark.

Lex Fridman Podcast
#474 โ€“ DHH: Future of Programming, AI, Ruby on Rails, Productivity & Parenting

We do the thing if the thing is true.

Lex Fridman Podcast
#474 โ€“ DHH: Future of Programming, AI, Ruby on Rails, Productivity & Parenting

Instead of saying if the thing is true, do the thing.

Lex Fridman Podcast
#474 โ€“ DHH: Future of Programming, AI, Ruby on Rails, Productivity & Parenting

But it gets even better.

Lex Fridman Podcast
#474 โ€“ DHH: Future of Programming, AI, Ruby on Rails, Productivity & Parenting

This is why I love this example with the conditional, because you can keep diving into it.

Lex Fridman Podcast
#474 โ€“ DHH: Future of Programming, AI, Ruby on Rails, Productivity & Parenting

So let's flip it around.

Lex Fridman Podcast
#474 โ€“ DHH: Future of Programming, AI, Ruby on Rails, Productivity & Parenting

User dot downgrade if exclamation point not user dot admin.

Lex Fridman Podcast
#474 โ€“ DHH: Future of Programming, AI, Ruby on Rails, Productivity & Parenting

Right.

Lex Fridman Podcast
#474 โ€“ DHH: Future of Programming, AI, Ruby on Rails, Productivity & Parenting

That'd be a typical way of writing it.

Lex Fridman Podcast
#474 โ€“ DHH: Future of Programming, AI, Ruby on Rails, Productivity & Parenting

Ruby goes, that exclamation point is light noise.

Lex Fridman Podcast
#474 โ€“ DHH: Future of Programming, AI, Ruby on Rails, Productivity & Parenting

Why do we have if and then an exclamation point?

Lex Fridman Podcast
#474 โ€“ DHH: Future of Programming, AI, Ruby on Rails, Productivity & Parenting

That's ugly.