Programming Basics #24 Splitting the Code
Programming Course. The Basics of Programming.
#24 Splitting Code

Learn to code.

Splitting Code Into Different Files

We can ends up with thousand of lines of code very quickly. And all though we will being splitting them in to functions, they can still difficult to read and navigate.

Another way to make your code more manageable on every programming languages, is instead we try to keep all in one file, we just split it up in to several files.

Now you wouldn’t do this randomly, having half a function in one file and another in the other, but you might group several functions together in one file, and several more in another.

But the question is, if you do split it up, how does the web page knows where to find every thing.

We already tell to our html page where java_script is. Is we use a script tag. This is what we using all along.

And if we split our javascript to multiple files, we simply add more script tags.