Michael Landis
Mar 23, 2021

Who is this “general consensus?”

Having your auxiliary functions first keeps you from understanding why they exist in the first place.

Having your main function at the top makes it clear what you’re trying to do in the file. Otherwise you have a lot of clutter to scroll through first.

If you need to stop and find the auxiliary functions to figure out what your main function is doing, you probably need better names for your auxiliary functions.

Michael Landis
Michael Landis

Written by Michael Landis

Front-end web developer, React enthusiast, vagabond.

No responses yet