When do you create a function or method?
Sergiu Mureşan Sep 8
It comes naturally to create a function whenever needed, that should be true for all developers. But we all have different standards on when we create methods.
Are you creating a function/method when:
- the current one exceeds a certain number of lines, or a certain complexity?
- or do you just pile all the code in one giant function until you can't see the scrollbar?
- do you create them based on readability?
- what about re-usability?
Leave your answers below! It would be very interesting to see the differences we have on this subject.