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

In my opinion there are two approaches to the idea of a function

Some use it as a method to separate code into independent, concise blocks that represent a singe step in a larger algorithm. Do one thing and do it well.

The other is code reuse, if a function is not reused in other places why create it at all? That's the reason for preferring comments rather than fragmenting code into add_vertical_scrollbar() functions. It's easier to read from top to bottom instead of jumping all over the place




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

Search: