Compiled languages

Compiled languages from the 90’s

We will go back about the same time, but in a different way. At that time, C++ was used for almost everything you had to write not for the web, not for text processing, but just for applications, for operating systems, for toys, in general, for anything. But C++ is a creepy language really. Why? Because, first of all, it inherited, because of the backward compatibility, all the problems of C. You could still get killed there in a million different ways, the same ones that were in C (of course, new ways were added in C++ as well). At the same time, if you write everything well and correctly, as intended by the C++ authors, you certainly couldn’t kill yourself with the old C ways anymore, and there are sort of less of them. Nevertheless, it had a very strange object model of its own. Breaking up a program into modules, into pieces of some sort generally came from C (if you can write in C or C++ – in fact it was just meant to put a library text into your program, and as a result when you write a bunch of inludes everything – if “primitive” as it was in the beginning – is put into one file and then it all gets compiled awfully long, because it goes through several times. The same Pascal, Virtuoso, was much smarter in this respect, and later versions are even better.

In general, C++ has a lot of disadvantages. The programmer had to be highly qualified to write in C++, and such programmers were expensive (both training and something else, that is it is difficult to find programmers on the market, they must be paid a lot, and in general it is not a business…). But computers are counting faster and faster, they become cheaper and cheaper, people buy new computers and want more applications, more toys for the phone, in general – more fun.

This is how Java (Java) came about. There’s also a funny story about how the name of the language came about. There programmers, they drink coffee all the time and at that time it was fashionable to drink coffee, which was growing on the island of Java. The language was conceived as a language for embedded devices, particularly for a coffee machine. That’s how the name came about…
What started with it in the first place, what was good about it, and why did it gain a lot of popularity? First of all, they got rid of the legacy of Sishny, completely. No pointers, far fewer ways to shoot yourself in some body part and break everything. Second, they introduced much fresher ideas in terms of the object model – that is, C++ came much earlier than Java and used a more archaic, “wild” object model. But here (the lecturer points to Java) it was already much more thought out back then, and in theory people thought, and in practice they applied and made everything much cooler.

And then the third thing. You had programs in Java that were not put together in machine code, but in virtual machine code. That is, you had a JVM (Java virtual machine). Your programs were compiled into an intermediate representation and then executed through that machine. What did it do? Firstly, it was very slow, and secondly, it ate memory very badly. And thirdly, it could be put anywhere (in theory), even on the coffee machine, even on the coffee grinder, even on the computer, even on the cell phone. On the one hand it’s good, that is, you just wrote a virtual machine implementation, then you run your java programs anywhere. But on the other hand, the bad thing is that on the same phone at the time there was little memory, was low performance and it all in addition started to stall and slow down.

But even this is not the main reason why the language was invented in the first place. The Java language was invented to reduce the requirements for the skills of programmers. That is, more bad programmers can write good programs in Java, because it does not allow to write bad programs – there is no means to write bad programs. You can only write good, programs there. Good, as understood by the creators of the language.

That is, if in C, C++, Python or whatever else we can turn our project into some horrible cesspool, where everything is mixed up, gathered for hours and so on. In Java you can also make a mess, but it takes some effort. That is, by default, there is not a “dump”, we get other problems, that something is inherited, inherited – in general, for one meaningful string we get ten not very meaningful. On the other hand, such a moderately skilled programmer can write pretty good code.
We’re almost at the end. At us, the next thing that appeared – this is .Net (dotnet), well, in particular, we are interested in C# (almost the same [lecturer points to Java], that is the difference in details, if you choose between them – look, where the money pays more).

And one more thing – JavaScript. Has nothing to do with the language of Java, appeared in the same year – the word was fashionable, they licensed a trademark to use.