Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
📌📌📌 would surely like to know about this.
if i have to follow your naming convention , then i have similar rule for myself and it would be called
220 rule -
demiDev6626y@TitanLannister
220 is good but sometimes it's impossible.
550 is at most. 220; is best. -
50 lines for a single method is insane..
You should probably be able to split it out into smaller pieces for readability, and possible code reuse reasons. -
demiDev6626y@fattymiller I think you didn't get it.
550 is not a standard or average.
It's at most. Method shouldn't have more than 50 line. It's not meant, it is good to be 50. I think 220 is rule for good programming.
I mean:
1- class under 200 is good class and method under 20 is a good method.
2- class over 500 is bad class and method over 50 is bad method.
Then between these numbers is not good and not bad area. -
@demiDev no, I got it. I was just surprised that your upper bound is that high.
I was thinking 15 was already getting up there.. -
demiDev6626y@fattymiller
Rule is for everyone and have to be somehow any one be able to follow it. So let's spread this rule for everyone. -
I use the 10 10 10 rule.
Max 10 lines of code per function or method
Max 10 public functions in a module or 10 methods in an interface
Max 10 modules or classes in the same folder
Related Rants
I have a rule made by myself. I call it "550 line".
If a class have more than 500 or a method more than 50 line, something is wrong.
(Is there any better rule? Tell if there is some)
rant
oop
rule
programming