DEV Community

Mario Hernandez
Mario Hernandez

Posted on

Should I drop PHP?

TL;RD I'm unsure.

I started programming in ColdFusion, when it was owned by Macromedia (remember "Shockwave"?), since then I've learned more than a few languages, both compiled and scripted, and I've always believed that every language has its time and place. C/C++ has been with us since always (maybe the "more experienced" devs can say "I remember when C was just a letter") and is still here because of it's speed?, reliability?, documentation?, Java for its portability, even Cobol had an specific orientation (given by the technology available).

Around 2002 I decided that I'd drop ColdFusion (no matter how much I love it) and make the switch to PHP, both Web oriented languages. But I'm also a sysadmin (maybe I'm a sysadmin first), I need to be able to quickly write a script for something, or a daemon for whatever reason, Bash and Perl were the selected languages for my sysadmin stuff.

I was very happy with that combo for quite a few years, I also added some ADA and Pascal at university, Java/C++ when I started my Mobile Development phase, then I met Python and replaced Perl completely. I don't really remember how many programs and systems I've made with PHP for web development and Python for server stuff.

Enter Rust

I'm more of an old-school-sysadmin, I prefer stability and reliability for my servers, that's why I use Debian and don't particularly like Ubuntu for servers. Same goes for languages, I saw from a distance how Ruby dethroned Java/C/C++ as language of the year in 2006, then I saw it fall (It went from 11th to 15th according to TIOBE a the time of writing this post). Something similar happened when I learned about Go (I don't believe it's going to stick with us, no matter how much Google would like that) but I'm currently unsure.
Have you seen Rust's performance? I mean: wow.
Take a look at Rust. If you're interested on software to work and not get carried away by other secondary things, I believe you'll like it.

Anyways... my thought process at this time is this: I relly like PHP (I understand why you might not like it, but remember "a time and a place"), it gave the speed Web Development needed to develop the way it did, and not sacrificing too much in the process. Python is Python: pretty, fast, simple, and easy to read. I've been moving from server stuff to web (I love Flask, I hate Django) and it has proven for me a better alternative than PHP/CodeIgniter, so... now I'm faced with the question: Should I drop PHP/CodeIgniter, replace it with Python/Flask and learn Rust for the server stuff? I don't know.

I'm about to start a huge project, I know how I'm going to use CodeIgniter 4, the modules, the design, every thing is in my head, but I'm not sure to start with it, a gut feeling.
I'm not sure how I'm going to design the system in Flask, too many unknowns, but for some reason I believe it's better to make the switch...

Top comments (9)

Collapse
 
djnitehawk profile image
Dĵ ΝιΓΞΗΛψΚ

I've had a similar journey as yours but I'm more of a back-end/api developer now. I've moved to c# and been using .net core for most of my work. the developer experience has been unparalleled with visual studio and I find it extremely disturbing to even look at my old php code nowadays. if you're going to build large systems that freely evolves without much hassle, have a look at vertical slice architecture. it has been a huge a game changer for me. if interested, have a look at this starter template project I made. good luck with your new project!

Collapse
 
mariofix profile image
Mario Hernandez

Thanks! I'm not familiarized with "Vertical Slice Architecture", the name sounds like something I'd like =D

Collapse
 
djnitehawk profile image
Dĵ ΝιΓΞΗΛψΚ

this is a c# video but I believe the principles can be applied anywhere: youtu.be/Fn1IKJ-ZDOk

Collapse
 
stereoplegic profile image
Mike Bybee • Edited

I have, by and large, dropped PHP, but for a different reason: When I first really started working with Node.js, I saw the writing on the wall and shifted my focus to really digging into JavaScript as more than just the "toy language" that so many developers called it back then (many of whom are now JS devs, ironically).

Collapse
 
marcusatlocalhost profile image
Marcus

Oh Cold Fusion, that's what I started with as well. Looking back, I think it was easier to get a CF Application Server running than trying to setup PHP and Apache :D. But I'm glad I was forced to switch to PHP (because CF hosting was rare here), and now I'm comfortable with it, it gets the job done and there are many solutions.

For a recent job, I thought it was wise to learn something new (vue.js) and I started the project with the same unknowns.
You'll learn a new framework/language on a real world project, that's for sure, but only if you, your client, or you company can afford it. I kind of paid the price with a lot of refactoring as I learned vue, along the way with endless unpaid hours (luckily the project was not time critical, but of course money played a role).

Looking back I'm glad that I learned so much about using vue and more modern JS approaches, but I also learned about the technical debt and the pitfalls that come with these new technologies (writing build scripts, why my old build process (uglify) not worked anymore (ES6 Babel). I'm more convinced than before, that the simpler I can make changes the easier the project is to maintain (trying to figure out build processes 3 years later, when everything is out of date, is not fun, and JS is just too fast moving - in this case).

Collapse
 
crimsonmed profile image
Médéric Burlet

If it's a big project then use a technology you are familiar with IF that technology is suited for the project.

If you check w3techs stats you'll notice that 79% of websites use PHP. A good example is WordPress which is one if not the most used website builder uses PHP under the hood.
w3techs.com/technologies/details/p...

We use PHP at work with YII2 framework and have built applications supporting heavy loading and usage by many users.

If you want to use python/flask I'd recommend doing it on a small project until you've gotten a hand on the learning curve.

One of the good sides of PHP on my end is that most PHP frameworks come with front-end and back-end ready solutions with for some code generators to kick-start basic work. This can be very useful to get all the little and basic stuff done on big projects.

Collapse
 
goceb profile image
Goce

My first language was ColdFusion too, lol. With PHP I went through the whole spaghetti code -> framework -> clean code, hexagonal, DDD, CQRS, ES path and I totally agree with the time and place thing. First thing you need to figure out is how complex the project is and how long it is going to run. If it is mostly a CRUD-ly one, use a framework, the language does not matter. If it has a bit more complicated logic, ditch the framework and go frameworkless, or if you do not want to deal with the whole infrastructure thing, use the framework but do a clean separation of your core logic from the supporting code. DDD is a good starting point here. My advice is, both Python and PHP are good languages, there are not perfect but they provide enough, especially PHP since 7.4 is a different thing, use the one you are most comfortable with. Since you used "huge" to describe the project the more important question is what kind of architecture are you going to use, how maintainable will the project be in 2 years time, etc...

Collapse
 
steelwolf180 profile image
Max Ong Zong Bao • Edited

It depends on the type of jobs within your area does it has demand for it and people willing to pay for it.

Cause to me, PHP is still used but the question comes to. Does it provide a good amount of jobs or competitive salary to continue to stay in it. I would definitely look at using those for ML/AI. As data pipeline has to be built and people might pay a premium. Using Rust for speed or performance, while Python is due to the huge AI/ML & web development ecosystem.

Collapse
 
jsn1nj4 profile image
Elliot Derhay • Edited

I would say it depends (as with everything else).

This is my two cents based on my experience, but I actually don't have a lot of time to completely switch to something else and I live in WordPress. I wanted to try switching to something else a few times in the past, but I ended up deciding to learn Laravel instead since I was already using PHP. Overall, I felt pretty good about the decision since it's at least a path forward in my circumstances, and Laravel is pretty darn awesome for someone like me.

FWIW the 2 most recent things I've wanted to get into were Elixir and .NET Core with C#. Both seem really nice. Just not enough time to justify it in my case. 🤷‍♂️