Hacker News new | past | comments | ask | show | jobs | submit login
The Reality of Code (jonkuperman.com)
3 points by kellly on Dec 17, 2013 | hide | past | favorite | 3 comments



I haven't seen much of the poor code as shown in the example (thought I may have seen worse), but what strikes me on the last two big projects I've been brought into is Class-itis.

What are others peoples thoughts on that? Have you been inundated by a huge number of classes, rather than methods within a class? Maybe I'm wrong and classes is the way to go.


That's interesting. I think classes are supposed to have a single responsibility according to S.O.L.I.D so it seems to make sense to have a lot of them.


Depends on how many. I would say that a module should contain at most about 35 classes. Of which, about 3 belong to the module interface. So you may have a layer of about ten modules (again this gives about 30 public classes), before you need to abstract away another level of module.

Unformtunately what we observe in the field is rather thousands of classes unstructured, and the least operation requiring using and combining ten if not more classes, with no abstraction.




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

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

Search: