DEV Community

Cover image for Thoughts on legacy code, diversity and inclusion

Thoughts on legacy code, diversity and inclusion

Erika Heidi on May 06, 2019

TLDR; If you're still dropping snarky commentaries about PHP on Twitter, just grow up already. As some of you may know, I've recently started a ne...
Collapse
 
rewmu profile image
Andrew Murray

I've often winced as I've heard people deride languages like PHP, small throwaway statements like those betray an ignorance. I started my career on PHP and the tools that you mention, I've built many web sites and smaller web-based utilities using PHP 4 and 5 that brought a lot of value to their users. With the benefit of hindsight its easy to criticize the deficiencies but I felt just as productive and able to meet requirements then as I do now (working in the .net ecosystem). PHP, like any other language, is fundamentally a tool that helps you accomplish a goal. If you use it irresponsibly, it's on you. Granted, it's possible to build in safe guards so users of your language don't hit problems but PHP was a pioneer of sorts, lessons learned fed into new languages and frameworks, it laid a small part of the groundwork for what we have today. Let's also not forget that PHP still has a vibrant community and ecosystem. Can something that's survived all those supposed failings be so bad?

Collapse
 
vedgar profile image
Vedran Čačić

Absolutely, PHP was a pioneer, and it was a very good language by the criteria of 15 years ago. I think nobody in their right mind criticizes that. But the times have changed, we now know much better ways to do some things (the hindsight you're talking about), and let's be honest, most of the community and ecosystem is there by inertia, not by explicit will (which is ok). Learning new tools is hard.

Collapse
 
Sloan, the sloth mascot
Comment deleted
 
vedgar profile image
Vedran Čačić

I meant for a particular purpose: hacking together a dynamic homepage in one night. Of course if you want to write a microframework with it, you'll encounter weird roadblocks. You could say that the reason people who hack a homepage in one night don't complain is simply that they don't know any better, and there is a bit of truth in that argument -- but still, many people used PHP quite successfully back then.

Collapse
 
erikaheidi profile image
Erika Heidi • Edited

These are wonderful points, Andrew! Thank you for sharing this! 👏👏👏

Collapse
 
fennyfatal profile image
FennyFatal • Edited

I only snark at the prospect of beginning new projects in languages such as PHP. Knowing well the deficiencies of certain languages or libraries, it is unfortunate that people wilfully refuse to learn from the past.

I have no problem working with, integrating, or porting a legacy codebase, but I think it is important to be mindful of the lessons (both positive and negative) we can glean from projects and developers that have come before us.

Collapse
 
laurieontech profile image
Laurie

I'll admit to having written a snarky comment about hating PHP. I believe I added the proper context in saying that I was thrown into a legacy application with no experience in the language and debugging something that started as open source and had been forked and customized. It was the perfect storm of terribleness and the language was secondary to that.

But on behalf of my past self, I apologize. It's true that certain languages and tools get treated like red headed step children in this industry. Those languages and tools still exist and it does no one any good to marginalize them and the people who work on them.

Your tweet in this post is spot on. Legacy code is complex and we need to stop using current assumptions to judge past actions.

Collapse
 
cabmok profile image
Moea Cabral • Edited

"Instead of condemning the usage of software like phpMyAdmin and criticizing the developers who wrote that code, you'll be way more helpful to your community by sharing practical advice on what to do in order to improve security and usability of such applications."

You've said it all!

Collapse
 
zakwillis profile image
zakwillis

Hello. Good article. A lot of valid points raised by others already.

I would put it like this. Two things seem to challenge people most;

  • Thinking one approach is better. (And blustering)
  • Knowing an approach is better. (And showing respect and guidance).

Both of the above are irrelevant once we consider "Jobs to be done". This means it is okay to use anything to get the job done. Making everything the best tech must have a fundamental reason. As a technologist, you can decide on an approach but it should fit in with a lot of other jobs to be done.

However, bad development code bases and approaches really causes a lot of headaches. People should be allowed to voice their dissatisfaction and they should be listened to. This is aka freedom of speech. There is nothing more demoralising to be on a project with people saying - "Yeah, we know it is shit, but it is out of our hands."

Collapse
 
fdrobidoux profile image
Félix Dion-Robidoux

Oof that hits close to home.

My lack of experience in SQL means I'll desperately try to make PhpMyAdmin work on my dev environment or on my web server, because the muscle memory is still there to do everything, but when I do MSSQL or PLSQL I end up spending more time googling and searching stackoverflow than writing SQL requests.

This is also why Entity Framework and similar ORMs are a blessing. But that also means I can't work in big enterprises because they always end up doing more SQL than actual development.

Data is important, I get it, but presentation of said data is equally as important !

Collapse
 
mrtnrdl profile image
Martin Riedel

But writing snarky comments on twitter and bathe in the glorious 'lulz' is so much easier than doing something useful. Not that i want to tell anybody how to spend their private time - but yeah, the problem you state is clearly there...

Collapse
 
leob profile image
leob

I get your point, well said. Never good to look down on people, programming languages or even programs just because you have the elitist idea that your language, your software or even yourself are "superior" ... if it's useful and people get stuff done with it, then who are we to judge.

Collapse
 
jcadima profile image
Juan J Cadima • Edited

Good points Erika, those comments are mostly made by some people referencing the language more than a decade ago, they havent looked at the way things are now and languages changed over time, an example of this will be Laravel which is the most popular php based fullstack framework, and also Rails which is in decline, one got faster, the other got slower to todays standards.

Collapse
 
moopet profile image
Ben Sinclair

You can become a millionaire with oil and coal - making money from something doesn't have anything to do with it being a good idea.