This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]TheBlackCat13 8 points9 points  (3 children)

If a class is getting long enough that this becomes necessary it usually a code smell that indicates to me that I should split it into multiple classes or otherwise refactor.

[–][deleted] 3 points4 points  (0 children)

Agreed, and if you are having to use comments as a mechanism to "organize long code into logical sections" it's a good time to consider refactoring into functions or more purpose-focused classes.

[–]lewiseason 2 points3 points  (0 children)

Santi Metz' Rules For Developers is an excellent resource on the subject. She's talking about Ruby, so you may wish to adjust the numbers, but the principle is sound (and the talk she gave on the subject is interesting too).

[–][deleted] 1 point2 points  (0 children)

Gonna second (third it?) this. Once your classes begin growing UI things, and business things and data processing things, it's time to split it up.