Are all programming languages the same?

Table of contents

Are all programming languages ​​the same?

Yes, programming languages ​​are different

The more advanced the language the better, right?

Derivation of various programming languages


Are all programming languages ​​the same?

"  "Programming languages ​​are all similar, knowing one is equal to all" .

Yes, programming languages ​​are different

Our discussion is based on high-level languages, the vast majority of programmers program in high-level languages ​​most of the time, and few people use assembly language these days. Programmer's time is much more expensive than computer time, which has gotten so cheap that it's hardly worth the trouble of developing software in assembly language. Only a few of the most critical parts may still use assembly language, such as when developing a computer game, you need to control the hardware at a micro level, so that the ultimate speed of the game can be maximized.

Fortran, Lisp, Cobol, Basic, C, Pascal, Smalltalk, C++, Java, Perl, and Python are all high-level languages. They are just a few of the more well-known ones. There are probably hundreds of high-level languages ​​today. The instruction sets of different machine languages ​​are basically the same, but the high-level languages ​​are different, and the modes of their development programs are quite different. So, which language should you use?

Well, there's a lot of debate about this right now, partly because if you use a language for a long time, you slowly start to think in the language's mindset. So, later on, when you come across any other language that is significantly different, even if there is nothing wrong with that language itself, you will find it extremely difficult to use.

Inexperienced programmers are often misled by this mentality in judging the pros and cons of various languages, perhaps because they want to show off their knowledge, and some of their peers will tell you that all high-level languages ​​​​are basically similar. "I have used all programming languages", a colleague who looks weather-beaten and cool sat down in the bar, "It doesn't matter what language you use, what matters is whether you have a correct understanding of the problem. Things other than code That's the key."

This is, of course, nonsense, the languages ​​are so different. For example, FortranI and the latest version of Perl are two completely different languages, and the difference between the early version of Perl and the latest version of Perdl is also amazing. However, that boastful colleague might really believe his own words, and it is indeed possible to write programs in all the different languages ​​that are nearly as good as those written in the original Pascal language. Because if you've ever eaten at McDonald's, you know that McDonald's all over the world taste pretty much the same.

Some colleagues only like the language they use and hate all other languages. Others speak all languages ​​the same. The truth is somewhere between these two extremes. There are indeed differences between languages, but it is difficult to say which language is the best because the field is still developing rapidly.

The more advanced the language the better, right?

In terms of expressiveness, high-level language is closer to human language than assembly language, and further than other languages. For example, the C language is a low-level language, very close to the hardware, almost a portable assembly language, and the Lisp language is quite high-level. If the high-level language is more conducive to programming than assembly language, you may I think the higher the level of language, the better. This is generally true, but not absolute. Programming languages ​​can become abstract and completely detached from the hardware, but they can also go in the wrong direction. For example, I think the Prolog language has this problem. Its abstraction ability is incredible, but it can only be used to solve 2% of the problems. The rest of the time you think hard and use these abstraction abilities to write programs that are actually Pascal language programs.

If you are very concerned about running speed, then it is better to use a language that is close to the machine. The reason why you will use a low-level language at this time is efficiency. It's no accident that most operating systems are written in C. However, hardware is getting faster and faster, so the need to develop applications in a low-level language like C is decreasing, but everyone still seems to want the operating system to be as fast as possible.

Derivation of various programming languages

The derivation of different variants of programming languages ​​reflects the different original intentions of designers and various solutions.

Perhaps the biggest divide among language designers is that some people think that a programming language should prevent programmers from doing stupid things, while others think that programmers should be able to do anything they want with a programming language. The Java language is a representative of the former camp, and the Per language is a representative of the latter camp.

Since there are several ways to prevent programmers from doing stupid things, the above debate has gradually broken down into several smaller issues. One of the most active topics at the moment is the debate between statically typed languages ​​and dynamically typed languages. In a statically typed language, you must know the type of each variable when writing code, while in a dynamically typed language, you can set a variable to a value of any type at any time.

Proponents of statically typed languages ​​argue that this prevents bugs and helps compilers generate faster code (both reasons are true). Advocates of dynamically typed languages ​​argue that static typing places constraints on programs (and for good reason). I personally prefer dynamic typing and hate languages ​​that limit my freedom. However, there are some really smart people who seem to like statically typed languages. Therefore, this question is still worthy of discussion, and there is no fixed answer.

Recommended reading:

Kafka high-throughput, high-performance core technology and best application...

Intelligent flow control in high concurrency services...

Mysql database optimization cheats...

Extensibility of database sub-database and sub-table and data skew/hot issues...

Five minutes to build real-time monitoring based on Prometheus+Grafana ...

Guess you like

Origin blog.csdn.net/qq_34417408/article/details/126135023