I was wondering how the cover flow effect is coded. I used this link which gave me the code on how it all worked out : http://luwes.co/labs/js-cover-flow/. I am completely new to complex programs so I had a hard time in understanding how it all works out.
Why do we program each file separately and place them in separate folders and how do all these file come together? Why is there build files, what do they do?
3
Looking at the build file, it is just a command line, I saw uglifyjs2 which is being passed on the command line a list of files. I googled uglifyjs2 and apperently it is a combiner/minifier. You can remove most of the whitespace and comments in a javascript file and it will work fine, so we do so to make the file smaller when downloaded to the browser. This is minification. We also combine multiple javascript files into one so that only one request is needed to retrieve them.
They are edited in seperate files just to make it easier to understand the layout of the program. There are other reasons that relate to version control, architecture, frequency of change, etc. that might have been a factor in the developer deciding how to sepereate them out. Some might actually be javascript files from other projects on which this program depends/needs. Since those files might be updated by the other projects, keeping them separate allows the developer to just copy the file over the old one when it is updated. This would be very difficult if he copied those other project’s code into a single file.
Since for development you want seperate files, the build file is an automated way to to keep the files seperate, but combine them whenever you want to create the single minified/combined “release” file that you will provide to those who want to use your tool/application.