David Heinemeier Hansson (DHH)
๐ค SpeakerAppearances Over Time
Podcast Appearances
It's a number.
Do you know what?
You can add your own methods to that.
I did, extensively.
In Rails, we have something called Active Support, which is essentially my dialect of Ruby for programming web applications.
And I'll give you one example.
I've added a method called days to the number.
So if you do five dot days, you get five days in seconds because seconds is the way we set cash expiration times and other things like that.
So you can say cash expires in five dot days.
Damn.
And you're going to get whatever five times 24 times 60 times 60 is or whatever the math is, right?
Very humanly readable.
In a normal programming language, you would type out the seconds and then you would have a little comment above it saying this represent five days.
Mm-hmm.
In Ruby, you get to write five days.
But even better than that, Matz didn't come up with it.
Matz didn't need the five days.
I needed that because I needed to expire caches.
I was allowed by Matz to extend his story with my own chapters.
on equal footing, such that a reader of Ruby could not tell the difference between the code Mats wrote and the code that I wrote.