Today, at last I found in a wonderful book a good author that he wanted to express for so long, looking at the endless debates around programming languages and the cries of people that their language was better because of this and that.
Cast:
The wonderful book is Code Complete (2nd Edition).
Good writer is Steve McConnell.
The voiceover is me.
Introduction
Recently, Habr has swept a wave of "articles" on programming languages,
advantages of one over the other, about optimizing programs for ...
Reading them, I became more and more irritated, because many of them are completely meaningless - for example, attempts to compare php and perl, or to optimize the php script at the level of removing variables from the string.
')
Actually, this article I want to give food for thought to those who think in the right direction,
and a discussion topic for the rest.
Development
Steve's book came out great. Anyone who wants to learn something new about programming, or to improve their understanding - I advise you to read it.
While reading the book there is one thought that expresses my feelings well:
"It is
necessary to program using the language , not on it ."
This phrase perfectly reflects the essence of many disputes around programming languages, disputes when people argue, perhaps perfectly programming in their own language, but not accepting another.
Such disputes are simply stupid, because the programs are still not a computer, and if there are any difficulties, then you can bypass them, then you are a programmer, not a machine.
If you want to be a professional, it is not important to be able to write in perl or ruby, it is not important to be able to write dozens of operators and functions in one line.
It is important to be able to program
professionally . Like this? Yes, in general, is simple.
This means that you do not need to limit yourself to what the language provides.
Are you missing something? - do it with the use of available means, and do not run with a howl, that “it is impossible to do this in this language”.
Stop whining and arguing, it is meaningless.
Stop shouting that “this language is better,” it is even more meaningless.
Use good writing style, defensive writing techniques, debugging, logs, assertions, tests. Write programs so that they can be easily read. Design your system before writing.
I fully agree with these statements, their truth confirms my personal experience.
Any programming language with its shortcomings does not pose a barrier, but simply a task for you. What you perceive as disadvantages and limitations is a reason to think - are you programming
with the language ?
For your information, many of the currently existing patterns were born precisely as a means of solving problems encountered in languages and programs.
Climax
It was written a little, but I think the case.
It is important, after all, not to hammer out a useful thought into the head of the majority, it is important that few understand that will spread this idea further.
Comrades who write what they write in cut. You decide already, are you writing on the cut or on the tracks? For me, most people write on rails.
Comrades, writing that one language is better than another. Open your eyes, guys, you are mistaken.
Comrades optimizing scripts in php. The latter - pleased, plus him for it. I
for ($i = count($big_array) - 1; $i > 0; $i--)
another optimization method to the previous ones:
for ($i = count($big_array) - 1; $i > 0; $i--)
and say that the main optimization is a good preliminary design and a good programming style.
By the way, many of the tricks of professional programming remind me of using web standards. Analogies draw yourself. Hi, Max, Vadim, Alexey, Dima and the rest of the gang;)
And in conclusion. Anyone who is programming - read the book.
ps. Here's another thing. In order to have a complete understanding - I will say that each language has its own scope, and there are other languages in this area. And comparisons of languages in one area are meaningless for those who program
using language .
pps. To avoid unnecessary talk. Discussing about the tools before the start of programming is right and necessary. With arguments and considering the levels of opponents. After the start of programming, such discussions are meaningless.