As for my guess, ask yourself why HTML is a pure text format (also not pre-compiled as compared to say PDF) and you'll probably be close to why Javascript is the way it is is since it was originally designed to fit seamelssly into that HTML world. Also, JS is not compiled well in advance, like traditional compiles language. Below is the way how declarations are handled in JavaScript. . The meaning is slightly different in the two contexts, but related, and both approaches (server-side and client-side) usually work together. Note: If your example doesn't seem to work, go through the steps again and check that you did everything right. Unlike C++ or Java, that's because you do not have to run this language through a compiler. With PHP many people use one of several caching mechanisms such as APC, eaccelerator, etc to hold compiled versions of scripts in shared memory for all webserver threads to use. Questions about "why" some design decision was made 20 years ago are generally pointless here as none of us were in the room when the decision was being discussed. The major problem is, there is no body or organization which regulates this; i.e. Being a full-stack engineer no longer means you must learn multiple languages. String manipulation and validation is one of the most important features in web development. Interpreter & Compiler. This demo has exactly the same functionality as in the previous two sections, except that the