DEV Community

Discussion on: Do you (re)arrange your class methods? Why?

Collapse
 
prodigalknight profile image
RevanProdigalKnight • Edited

In some older languages (e.g. C), functions are (or at least were) required to be declared before they can be used, so that became an unofficial (compiler-enforced) convention for a lot of people.

It can also be useful because if you see a function call inside of another function, you know that the definition has to be above the function you saw it in (if there's no other discernable order to function declaration, e.g. alphabetization).