About programming style
Recently, more and more often one can hear such opinions: "PHP is a language for housewives" or "PHP and web programming have nothing in common." Actually, the reason that prompted me to write this topic is just a link to LJ, flashed on a hub, where Perl and PHP are compared. The comparison, of course, is not in favor of the latter.
I decided to figure out where the legs of the stereotype grow: “PHP is a misunderstanding that cannot be taken seriously.” I believe that, firstly, PCP owes this opinion to its syntax, which is very easy and easy to learn. This, in turn, encourages beginners who study it to write and publish their first scripts, barely knowing the basic constructions of the language and without delving into the general philosophy of programming. Numerous articles, which are in abundance in the open spaces of Runet, also dictate an inconsistent approach to programming. So, we have identified two main problems.
How to get rid of this? How to prove (at least to myself) that PHP is a great programming language that allows you to create real, highly loaded, serious web applications?
You need to start with the basics. All articles, such as “master PhP in 2 hours and write your first guestbook” are evil. Evil to be eradicated. The problem is that really useful materials that will teach a real programming methodology, and not dumb scripting, are not in nature. Numerous textbooks (with rare exceptions) also do not provide this knowledge. How does a beginner who begins to learn a new language for himself find out what is good and what is bad? How does he find out what programming patterns are, what MVC is, frameworks, competent design and much more ...
Following the articles published on sites about PHP, he learns the possibilities of the language, but does not learn to write on it. I repeat that, probably, the syntax that allows and forgives the spelling of the so-called “bydlokod” is to a large extent to blame. What to do with this? Let's look in the direction of other languages, for example, C ++. This, of course, is not a very appropriate comparison, but we will be able to adopt some of the trends present in this language.
C ++ will not allow us to write any kind of complex program without prior design. Libraries, header files, namespaces - all this makes a code disciplined and responsible approach.
What about our favorite PHP? Everything is very simple here: there is a task that can be accomplished in different ways, and often the simplest and most obvious one is chosen - the task is solved “right away”. Those. the encoder stupidly sits down and immediately begins to write the code, "as God puts a soul". No design. Nothing. This is of course wrong.
So, I suggest the habrasociety to reflect on the topics:
I decided to figure out where the legs of the stereotype grow: “PHP is a misunderstanding that cannot be taken seriously.” I believe that, firstly, PCP owes this opinion to its syntax, which is very easy and easy to learn. This, in turn, encourages beginners who study it to write and publish their first scripts, barely knowing the basic constructions of the language and without delving into the general philosophy of programming. Numerous articles, which are in abundance in the open spaces of Runet, also dictate an inconsistent approach to programming. So, we have identified two main problems.
How to get rid of this? How to prove (at least to myself) that PHP is a great programming language that allows you to create real, highly loaded, serious web applications?
You need to start with the basics. All articles, such as “master PhP in 2 hours and write your first guestbook” are evil. Evil to be eradicated. The problem is that really useful materials that will teach a real programming methodology, and not dumb scripting, are not in nature. Numerous textbooks (with rare exceptions) also do not provide this knowledge. How does a beginner who begins to learn a new language for himself find out what is good and what is bad? How does he find out what programming patterns are, what MVC is, frameworks, competent design and much more ...
Following the articles published on sites about PHP, he learns the possibilities of the language, but does not learn to write on it. I repeat that, probably, the syntax that allows and forgives the spelling of the so-called “bydlokod” is to a large extent to blame. What to do with this? Let's look in the direction of other languages, for example, C ++. This, of course, is not a very appropriate comparison, but we will be able to adopt some of the trends present in this language.
C ++ will not allow us to write any kind of complex program without prior design. Libraries, header files, namespaces - all this makes a code disciplined and responsible approach.
What about our favorite PHP? Everything is very simple here: there is a task that can be accomplished in different ways, and often the simplest and most obvious one is chosen - the task is solved “right away”. Those. the encoder stupidly sits down and immediately begins to write the code, "as God puts a soul". No design. Nothing. This is of course wrong.
So, I suggest the habrasociety to reflect on the topics:
- How to make PHP gain a reputation for a healthy, serious language, to be respected just like Ruby or Python?
- How to prevent the degradation of beginners who begin to get acquainted with PHP?