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

So that takes all of these elements we've just talked about and turned them up to 11.

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

I'll explain metaprogramming real simple.

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

Metaprogramming is essentially a version of the 5.days.

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

You get to add keywords to the language.

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

Active record is the part of Rails that communicates with the database.

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

This is a system where every table in the database is represented by a class.

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

So if we take the user example again, you do class user descends from active record base.

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

And then the first line you can write is this.

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

I want my users to have many posts or have many comments.

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

Let's do that.

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

We're making some system where users can make comments.

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

The very next line is has underscore many space

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

colon comments.

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

Now you've set up a dependency between users and comments that will give you a whole host of access and factory methods for users to be able to own comments, to create comments, to update comments.

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

In that line alone has many

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

looks like a keyword.

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

It looks like it's part of the Ruby language.

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

That's metaprogramming.

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

When Rails is able to add these elements to how you define a class, and then that runs code that adds a bunch of methods to the use of class, that's metaprogramming.

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

And when metaprogramming is used in this way, we call it domain-specific languages.