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

I sometimes find that code which doesn't involve lot of nesting is a lot easier to read and comprehend as one long method / function / subroutine than chopping it up into multiple small methods and having to jump around trying to work out what is happening. There is often nothing to be gained by splitting it up in my opinion.

Is that not why some languages are known as scripting languages, because you can read them like a script?



I see what you mean. I'd suggest that longer, more descriptive method names can help here, though. If I'm referring to a method body to understand what it does when reading another block of code, the method probably doesn't have a descriptive enough name.

https://signalvnoise.com/posts/3250-clarity-over-brevity-in-...




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

Search: