 Now let's do a survey of the more popular languages in use today. The C language, created back in the 1970s, is a statically but weakly typed language. Like virtually all other high-level languages, C code is composed of expression statements, control flow statements like if and while, and functions. However, unlike most other high-level languages in use today, C does not automatically manage memory, so the programmer must manually allocate and deallocate heap memory. Partly for this reason, and partly because of its weak typing, code written in C can link with code written in assembly with little overhead. On the whole, C is a high-level language that uniquely maintains much of the manual control and efficiency of assembly code. Consequently, C is a good choice for writing low-level software, including operating systems. The Linux kernel, for instance, is written mostly in C. The code sample here is the Hello World program written in C. Notice the use of curly braces and semicolons, which several popular languages like JavaScript later imitated. The C language is not just one of the most successful languages in the history of programming, it's also one of the most influential. The language called C++, for instance, is basically the C language, but with more stuff added. In other words, C++ is a superset of C. It has everything C has but more. Consequently, a C++ compiler should be able to compile any code written in C. However, this isn't entirely the case because C++ is not a strict superset. Over the years, both C and C++ have evolved on their own paths, and while there's still very heavy overlap, if you look at the details, you'll find differences that will cause some C code to not compile properly with a C++ compiler. Today, it's best to think of C and C++ as really two very separate languages. The name C++ is a bit of a joke. In the C language, the operator, which is two adjacent plus signs, is used to increment the value of a variable by one. If you have a number variable called, say, X, and you see X++, that means take the value of X and increase it by one. So the joke is that C++ is like C, but one higher. The primary features which C++ adds to C are for facilitating object-oriented programming. C++ can be basically summed up as C with object-oriented features. To be clear, it's not impossible to program in an object-oriented style in regular C. It's just that C++ adds features that make programming in that style more convenient. Despite these added features, C++ maintains most of the same efficiency that C itself has, so when you want to code in an object-oriented style but also want the efficiencies of C, C++ is the primary choice. For two decades now, C++ has been the language of choice for most commercial applications like Photoshop or Microsoft Word, and for most commercial video games. Objective C was created about the same time as C++ for largely the same purpose. Objective C is like C, but adds features for object-oriented programming. The popularity of Objective C today mostly stems from Apple pushing it as the main application development language on OS X and iOS. Without this push, its doubtful Objective C would be much used at all. The Java language was created in the 1990s by the company Sun Microsystems. Like C++ and Objective C, Java is heavily biased towards object-oriented programming, and its syntax imitates the C syntax. However, Java is not at all a superset of C and has automatic memory management with garbage collection. Java also has strong rather than weak typing and a hybrid mix of static and dynamic typing, which we'll explain in the unit on Java. Java was the first widely used language which compiles its source code to an intermediate form of code and then runs this intermediate form via a virtual machine. By the late 90s, Java had become the most popular language in just a few short years, and so deciding that they needed something like Java, Microsoft created the C-Sharp language. C-Sharp started as a virtually verbatim imitation of Java with a few more features, though over the years it has added several major features to further distinguish itself. Microsoft makes the most popular C-Sharp virtual machine, which it calls the CLR, the Common Language Runtime. While the CLR only runs on Windows, Mono is a free open-source C-Sharp VM that runs on other platforms, including Mac and Linux. The Perl language, which became popular in the 1990s, especially on Linux, was the first example of a dynamic-interpreted language really making it big, especially on commodity PC hardware. Before Perl, dynamic languages weren't used much because of their lackluster performance. Perl didn't actually fix this problem, but by the 1990s, computers became powerful enough that, for many tasks, the slowness of a dynamic-interpreted language was worth the cost. Compared to the primary languages of the time, including C and C++, Perl is much more expressive, allowing the programmer to get more work done per line of code. The Perl Hello World program, for example, is just a single line that says print Hello World. Perl, though, is criticized by many for overly complicated syntax and semantics. This complexity clearly isn't reflected in the Hello World program, but it's actually quite easy to write lines of Perl code that look like line noise, like a bunch of random characters to the untrained eye. Perl suffers from heaping conveniences upon other conveniences, making Perl code often difficult to read and understand. In contrast, another dynamic-interpreted language, called Python, is widely praised for the clarity and comprehensibility of its code. Whereas Perl is criticized for its overly complex syntax, Python is praised for its notably clean and simple syntax. The clean appearance is achieved largely by virtue of Python using indentation to denote blocks of code, just like we saw in Pigeon. So, instead of, say, surrounding the statements of an if-body in curly braces, we just put those statements indented in one level underneath the if itself. Semantically, however, Perl and Python are really, really similar at their core, though I would say that Python has a much cleaner type system and is therefore better for object-oriented programming. Like Python, the Ruby language is pretty much like Perl semantically but with better syntax. However, I personally strongly prefer Python because Ruby has too many misguided convolutions like Perl. PHP is yet another Perl-like dynamic-interpreted language from the 1990s. PHP owes most of its popularity to the fact that, in the late 90s, it by far had the easiest learning curve if you wanted to get into web programming. Though PHP is heavily criticized by many programmers today for being ugly and badly designed in general, it's still commonly used for many large websites. You can't argue with good timing and PHP just came along at the right time. One more language that shares the basic semantics of Perl, Python, Ruby, and PHP is JavaScript. Despite the name, JavaScript really has no special relationship to Java. They're totally separate languages. JavaScript was created as a language to embed in the Netscape Navigator web browser, such that web pages could include JavaScript code to manipulate the contents of the page. This feature became popular, so other browsers added support for JavaScript, and today JavaScript is still the only language that runs in all major web browsers. The most unique thing about JavaScript semantics concern its approach to object-oriented programming. While most languages like C++, Java, and Python facilitate object-oriented programming with a feature called Classes, JavaScript gets most of the same effect with a feature called Prototypical Inheritance.