Skip to content

Comment on Steve Klabnik's response to critiques of his Ruby OOP postparent

Comments

Why?

The sole purpose of a helper is to keep code out of templates and presentation out of controllers.

How could they do a better job of that than they do now?

Remember, the article you're agreeing with says that helpers are bad because they are "just functions". This is, in a word, crazy. It's one thing to design with objects; it's another thing to turn all your functions into classes so you can pretend you're OO.

So put the code in the model, where it belongs ... I rarely use helpers for anything but formatting-fu - everything else is in the model. I rarely use helpers, period.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.