Hacker News new | past | comments | ask | show | jobs | submit login

It's no effort, it's a simple automated refactoring, right click, extract method, choose name, done. I think your positions betrays your age and tells me you probably code in a text editor rather than a more powerful IDE. To fear extracting a method is just insane to me, a sign of past times.

Functions shouldn't have major steps, they should be one step each with a top level function calling the steps in sequence. A function should do one conceptual thing, or be a delegator to sequence other functions.

Mixing levels of abstraction where all the steps are inlined into the larger master function that also sequences them is IMHO a code smell that demands fixing. Kent Beck had quite a bit to say about this very thing in Smalltalk Best Practice Patterns.

Like I said, I bet you use the scroll bar a lot.




> Like I said, I bet you use the scroll bar a lot.

Says the fellow that hoists incredibly simple code out to independent functions.

On the subject of age, since you broached it -- Given your seriously arguing for not commenting, coupled with the naive hubris so often associated with youth, I can only assume that you're ether young, inexperienced, and/or do little work in maintaining production code across the years.


Wrong on all counts. I'm old, experienced, and maintain decades old systems.

And I'm not arguing for not commenting, I'm arguing for writing more expressive code so that function names are the comments and additional comments are not required. Nothing beats executable comments.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: