3 ms·
To make an analogy, the first code snippet is like a book with a table of contents and then a bunch of chapters, and the second is like the same book with no ta
by alangpierce 8y ago
To make an analogy, the first code snippet is like a book with a table of contents and then a bunch of chapters, and the second is like the same book with no table of contents. Not a huge difference at least from that perspective, but the first one can be more clear at a glance, since it at least tries to describe the high-level steps without getting into the weeds. Your editor should allow you to easily jump in and out of each "chapter"/function to see its contents.
However, I prefer to put `doFirstBit` and `doSecondBit` below `big`, since that way the file is laid out in the order that the code is typically executed. That makes the two code snippets even more similar.