DEV Community

Cover image for 20+ years into my career, I still love PHP and Javascript
Manuel Odendahl
Manuel Odendahl

Posted on • Edited on

20+ years into my career, I still love PHP and Javascript

Over the last twenty years, I have used over a dozen languages professionally, from C to Common Lisp, from Java to Python, from C++ to Typescript.

Yet, I love janky programming languages. In particular, I really enjoy PHP and Javascript.

Here's why.

They are used by people who get shit done.

This makes it easy to find people who:

  • understand business needs,
  • can iterate quickly
  • have shipped and maintained many projects in the past.

There is a lot of FUD that has been cargo-culted throughout the years.

PHP8 is not your grandmother's PHP3, ECMAScript 12 is not your grandfather's Javascript.

Their ecosystems haven't stood still either. Tools like CPAN, PECL, npm have put significant evolutionary pressure on other languages. With its daily new paradigms and frameworks, Javascript has been a hotbed of innovation for years.

Their quality is offset by other factors.

These languages are not popular for their elegance, but for other reasons.

These can be:

  • speed
  • ease of deployment
  • malleability
  • tooling
  • community
  • frameworks
  • platforms

PHP is a favorite of mine because of its cgi-bin model:

  • legacy codebases can be refactored in pieces
  • resource leaks are non-existent
  • caching and scaling are simpler

They are fun.

Because basic areas of the language are problematic areas means that programming comes with a sense of experimentation. There is pleasure in finding ways to write elegant code in a language that doesn't prescribe any.

Janky programming languages are great equalizers.

Because they are quite permissive, they allow people of all levels and backgrounds to get started with programming. You can be a complete PHP beginner and get a real website going within days.

Having started by copy-pasting BASIC snippets and later on making my own websites with PHP2 and PHP3, I feel pride in being able to pay back by helping newcomers where they are.

Poo-poo-ing a 12-year-old or a recent BootCamp graduate because they are writing actual code is missing the point.

In fact, because users are builders and learners because they have diverse backgrounds, janky languages tend to have very active and welcome communities.

I never had issues writing good code.

PHP, Javascript, Lua, Perl all provide effective tools:

  • functions
  • variables
  • classes
  • first-class functions
  • sometimes traits and prototypal inheritance.

Good software is:

  • product alignment
  • software design
  • naming and design patterns
  • enforcing invariants through static analysis or unit testing
  • providing fast and effective feedback loops to developers
  • good team communication

None of which depend on the language.

Javascript and PHP in particular come with:

  • solid libraries
  • pragmatic static analysis tools
  • great IDE support

In fact, they have better tooling than many a "serious" programming language.

I love legacy codebases.

A legacy codebase means that the product is performing well. It means that I can often make immediate and impactful improvements.

For me, nothing comes close to the pleasure of improving a product with many users.

(Cover Image: CC BY-SA 4.0 - Jcak - Wikimedia)

Top comments (5)

Collapse
 
garrett profile image
Garrett / G66

I started my webdev journey w/ PHP but kept reading all the hate and stopped learning it. I tried lots of other things over the years and nothing stuck. Now I'm back to programming and decided 'forget the haters' and I'm using PHP and having fun and getting stuff done.

Collapse
 
hexydec profile image
Hexydec

I have been using PHP since 2003, and have never seen any reason to change. PHP is great because everything is built in, there is no need for a library for say json encoding, or image resizing. They improve PHP, all the code you have ever written is now better.

So why does everyone hate on it so much? The barrier to entry is quite low, so there are a lot of developers who dabble with it. Also it is not very prescriptive, so you can create code however you want.

Whilst for a seasoned developer this makes it very flexible, for newbies this makes it easier to create crap that sort of works. Note you can create crap in any language, but the combination of the above means there is a lot of bad code and bad advice out there.

But this doesn't mean PHP is bad, it is actually very good, you can rapidly create scalable, modular and fast applications. It is just that a lot more low quality code has been created than good quality code.

Collapse
 
koas profile image
Koas

100% agree! I started writing server side code around 1999 with PHP because it looked like C but didn’t have all the C cgi quirks, many years later I stick with it because I get things done fast. That’s all that matters to me 🙂

Collapse
 
pedrocarrasco profile image
Pedro A. Carrasco Ponce

I am working with PHP since 2000. I use PHP and Javascript in web development, also I use Java, but for me is faster to start a project in PHP than in Java, and the project scales and performs as well in Java as in PHP. Now there are frameworks like Symfony that are like Spring in Java (the same patterns apply), tools like PSALM and a big community and documentation. For me, PHP is a good choice and Javascript also (I use Javascript in both back and front with Vue in front and NestJS in back)

Collapse
 
wesen profile image
Manuel Odendahl

I am fully prepared for the PHP backlash!