Why I still love PHP and JavaScript after 20+ years

More than two decades later, there are still many people who have a soft spot for PHP and JavaScript.

Over the past two decades, I have worked with more than a dozen programming languages , from C to Common Lisp, from Java to Python, from C++ to TypeScript, but I have a soft spot for languages ​​that are of poor quality.

Why worry about the quality? Because PHP and JavaScript have a lot of criticism: PHP is a loosely typed language, so it often breeds bad code, and JavaScript and Node.js are basically the same.

Even so, I still enjoy programming in PHP and JavaScript.

Python is nice, but PHP is really easier to use

PHP was born in the mid-1990s, even older than many programmers. I’ve been with PHP since the early 2000s, when it was just transitioning from version 4 to version 5. Later, I started writing applications in the CodeIgniter ZendFramework framework I wrote myself.

In my opinion, the main reason why PHP has remained young and has not aged over the years is that it is embedded in old and new applications all over the world, and in the minds of developers of all ages. Some people have used it for a few years, some have used it for decades, and PHP has left a deep impression on them . Developers aren’t going away, and commercial code isn’t going away, so PHP is still alive and well. And interestingly, Python was actually born in 1991, even earlier than PHP. And despite having a longer lifespan, Python has never been able to reach the current heights of PHP.

Why is this happening?

From a personal point of view, I think Python is more cumbersome to use than PHP. This problem has improved in Python 3, but going back 15 years ago, Python didn’t have those “fancy features” (functions) that came with PHP out of the box. Many features have to be installed manually or they won’t work.

And another long-standing problem with the Python language is the interval syntax. This syntax, which is determined by the number of spaces between the codes, delimits the relationship, which many people hate. Many programmers like to separate code the way they like, and can’t stand the programming language’s own brainstorming here, and PHP does a good job of this.

What fascinates you about PHP and JavaScript?

In addition, PHP and JavaScript have more fascinating places, including the following aspects.

People who really do things are using

How can understanding PHP and JavaScript be useful to real people? That said, for those who can understand business needs, iterate quickly, and have a lot of experience developing and maintaining projects, PHP and JavaScript are two languages ​​that are a must .

Years of development allow them to grow with their own ecology

PHP 8 is not the PHP3 your great-grandmother used, and ECMAScript 12 is not the JavaScript your great-grandfather wrote. The ecosystem these venerables depend on isn’t standing still. Tools like CPAN, PECL, npm have rolled up the development of other languages. JavaScript has always been a hotbed of innovation, driving the emergence of new paradigms and frameworks.

Their quality is often compensated by other factors

These “poor quality” programming languages ​​weren’t known for their elegance in the first place. They are more likely to outperform their competitors in terms of speed, deployment difficulty, scalability, tooling, development community, framework, or platform.

I prefer PHP because of its CGI-bin mode, which allows refactoring legacy codebases in chunks, and provides easy-to-use caching and extension methods, and developers don’t need to worry about resource leaks at all.

More fun

These languages ​​fail even on basic problems, which means that programming with them always feels like an experiment. Being able to write elegant code in an inelegant language always brings the satisfaction of being successful.

All programmers are equal in front of these languages

These languages ​​do not have strict background requirements for programmers , and even a novice who knows nothing can make a real website run in a few days. I grew up all the way from copying and pasting basic code segments to writing my own website with PHP2 and PHP3, and now I can also use my accumulated experience to repay the community and help those who are just getting started. This makes me very proud.

It is not advisable to dismiss programming code written by a twelve-year-old or a young man who has just graduated from a code boot camp. It is precisely because these users have a variety of educational backgrounds that the imperfect programming language has a friendlier and more active community environment.

Nothing can stop you from writing good code

Whether it’s PHP, JavaScript, or Perl, these languages ​​provide well-established tools for functions, variables, classes, first-class functions, and some additional traits and prototypal inheritance. And an excellent software needs to have product positioning, software design, naming and design patterns, by strengthening invariance in static analysis or unit testing, providing developers with a fast and effective feedback loop, and a good team communication environment. These elements can be completely independent of any programming language. For JavaScript and PHP, they provide solid libraries, useful static analysis tools, and excellent IDE support, and you may even find that they are more powerful in tooling than many of the more “premium” programming languages.

I love legacy codebases

The legacy codebase means guaranteed product performance and I can make more immediate and effective optimization improvements on it. For me, there is nothing better than optimizing a product with other users.

Original link: https://the.scapegoat.dev/why-i-love-php-and-javascript/

The text and pictures in this article are from InfoQ


This article is reprinted from https://www.techug.com/post/why-do-i-still-love-php-and-javascript-after-more-than-20-years84f87ee76f0d9ed43cc0/
This site is for inclusion only, and the copyright belongs to the original author.

Leave a Comment