There are three reasons why you should always split the code: first, this practice improves script readability. Remember that script readability is everything when you aren't working on your projects for a while. It's easier to see what this script is supposed to do:
connectToServer(); displaySplashScreen(); startTheMusic();
rather than this one:
// connecting to server ... ... // big set of instructions to connect to the server ... // display splash screen ... ... // big set of instructions to display the splash screen ... // starting the music ... ... // big set of instructions to start the music ...
With the first method, the one you'll be using from now on, you can easily see what the script does just looking at the first three lines. You don't have to read anything more unless you want to check how the functions connect to the server, display splash screen or start the music. The second script is not as intuitive, although there are comments, especially if a lot of...