History of simplifications and universalisations in programming languages
Programming faster and more reliably while new application areas appear requires an evolution of the languages.
The C language was designed to write an operating system, so to use the hardware directly. This is why there are types like int or string pointer matching the structure of memory.
C wants to break down operations at the expense of work required to the programmer, and was actually designed for critical software where the work of writing is nothing compared to the difficulties of processing and optimization.
C is ideal for achieving the programs for which it was designed. Where things go wrong is when the creators of new languages introduced to C, and building a compiler written in C, believe themselves obliged to take the syntax of this language even if the applications of this new language have nothing to do with the system and does not require this type of syntax. This is the case of C++, a language built like a system language to make applications, and also of those who succeeded, Java and C#.
There has always been resistance from programmers to simplify the language, their work tools, to which they are used. John von Neumann, the inventor of computers, when presented Fortran (1954), had this reaction:
"Why would you want more than machine language?"
When assembler appeared, less than 1% of the programmers wanted to use it in preference to machine language, as it was regarded as a sissy stuff. (Source: References for "The future of Programming".)
Then innovations must be imposed in order to make the code simpler and to make the most with the least amount of lines. Fortunately, the creators were able to let adopt new languages and have the opportunity to simplify the syntax and general functioning. Here are the kinds of simplifications you can found in a list that is probably not exhaustive.
Universalization of the object
In Smalltalk (1970), everything is an object. It is the same in Scala. This allows to inherit attributes and methods of all things and thus reduce code.
The principle of objects such as designed for Smalltalk was not very well understood in other languages, including C++. We can not say they really simplify the programs. But they help to reuse code and that is progress. Scala has done better as we will see.
Loops and no nodes
Python (1991) popularized for in with arrays, which is inherited from Gap (1986) and also "ranges", inherited from Icon (1970).
We can scan an array, or a collection that is an object.
for i in x ...
In general, the syntax of Python eases programming and also facilitates the reading, an aspect whose importance has been overlooked in C++ (the issue of sissy stuff again).
Even more universal objects
Processing and data unified
PHP (1995) has made some simplifications which are more annoying than advantageous. For example, arrays use numerical indices as keys, and it is a source of confusion.
In scriptol (2001) a switch case may have any operators and all types of data mixed.
The syntax of the while loop includes incrementing and there is no risk of getting into an endless loop. Something similar has been implemented in older languages.
x = 0 while x <10 ... let x + 1
Even simpler classes
In Scala (2004), we declare a class and its constructor with the same header. Scala claims to make code five times smaller than Java for the same virtual machine, and that is true with this kind of simplification.
We can do pattern matching with classes which further extends the swith ... case.
A more subtle simplification is the ability to create a trading system in Scala by defining actors and the messages they respond. This facilitates the creation of programs at a more general level.
New languages have become popular due to the simplifications they have integrated. There is no reason why this trend will stop.
Some ideas to further improve programming languages ...
- We must parse anything. Object properties, methods ... This would facilitate the use of 3D printers and generalize the principle of creation by iteration.
- The unification of data and processing is very partial in PHP and JS. We should be able to manipulate code like data.
- Security of application needs a lot of simplifications also ...
If you have other ideas, do not hesitate to add comments ....
See also :
- History and evolution of programming languages. More details on the contribution of each language, especially about the oldest.