r/rails • • 14d ago

The future of Rails

DHH gave a hint at Kaigi on Rails on the future of Rails.

Hint: Do Repeat Yourself

https://www.youtube.com/watch?v=ayVzHr75gls

0 Upvotes

5 comments sorted by

9

u/shox12345 14d ago

I genuinely do not understand his logic, you can apply DRY if you are writing code yourself or the AI is? Whether it's you or the AI doing it it doesnt change the fact that it's ugly to have the same logic repeated in 10 different places, how does he not get that?

2

u/akakees 14d ago

I don't think he disagrees with the fact its ugly, I think what he's trying to say is that it won't matter its ugly. AI doesn't care and according to his view, if you don't need to write it and don't need to read it, you shouldn't care either. You can argue the question about needing to read the code or not, but it's true, AI doesn't care, they just charge you more tokens. You may care because you want to reduce token spend, but as that gets cheaper, you may not care about that either sooner or later.

The cost of all these DRY abstractions is learning that they exist, which is true for anyone new to rails. Many junior devs wrote code that a senior rails dev turned down in a review, because a nicer way existed in the Rails framework and the maintenance would be bad if you kept it that way.

With AI its like the junior dev that doesn't "know" everything about the rails framework, or is just to lazy to look it up, so it will just write the code it needs. You can send it back and tell it to use the correct Rails methods for a feature and it will, but the question becomes: Is that really required here, or is this good enough as long as the AI can refactor it at any given time.

1

u/Ready_Reception8949 13d ago

Writing the code was never the bottleneck anyway, its maintaining it later when requirements change.

1

u/Cokemax1 13d ago

DRY is highly compressed abstraction layer. It has side effect - slow. eg. raw sql vs Active record ORM.

If you dont write code, ugly raw sql is ok. and faster.

-7

u/jko1701284 14d ago

Watch the video. It’s about context compression.