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

If the methods have a clear purpose with well-defined inputs and outputs and no side effects, then I think the trade-off is generally in favor of smaller methods. Once you introduce side effects, longer methods then have the advantage of showing you all the side effects in one place.


Great point. I've seen that developers that really understand OO tend towards smaller, more encapsulated classes/methods w/o side-effects whereas developers with a procedural background tend towards longer 'void' methods that lump side-effects into one place.




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

Search: