Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Even if you don't reuse a function it still encapsulates certain things. By looking at the name you know what it does (self-documenting-code). The interface tells you what variables it depends on. And finally it logically segregates your code.

I think the real reason people don't like small function is simply code navigations - which honestly is a poor excuse. That's an editor/IDE problem



Yes, but encapsulation isn't always a good thing: it lessens your awareness of what's happening within the encapsulated environment. This can lead to bugs.




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

Search: