6 ms·
Once or twice a year I have to peak at the code of a PHP app that was developed by interns more than 10 years ago. No framework was used, max 3 letters variable
by jmnicolas 6y ago
Once or twice a year I have to peak at the code of a PHP app that was developed by interns more than 10 years ago. No framework was used, max 3 letters variables are the norm, no blank lines and the only comments are from code copy pasted from examples.
These days I would be more inclined to celebrate the death of PHP than its birthday !
However this app isn't GDPR compliant and I have good hope that it will be gone in about a year.
- methyl 6y ago> max 3 letters variables are the norm, no blank lines and the only comments are from code copy pasted from examples It's hardly PHP's fault.
- elric 6y agoAh yes, the classic "my application is shit so the language must be shit" straw man argument. Sorry to hear you have to work on shitty code. But neither the choice of language nor the lack of framework are to blame. Blame the developers and/or the organizational culture that caused it to be in such a poor state.
- wlll 6y ago> But neither the choice of language nor the lack of framework are to blame. This is partly true. It is possible to make something great with substandard tools. I suspect a master craftsman with a set of dull saws and blunt chisels using his shoe for a hammer will still have the skill to create something pretty good. But it will be frustrating, and most people aren't master craftsmen so what they will produce will be adversely affected by the quality of the tools. If you give most people better tools they will have more chance to create something good. PHP is the rusty saw of the programming world (and yes, I have spend a fair amount of time programming it). You absolutely can create something great in PHP, but the sheer amount of gotchas and edge cases mean that for a lot of people it's hard to produce something good. There are a lot of people out there who aren't master craftsmen at PHP, and this is reflected in the frequency of the low quality PHP application that are out there.
- simion314 6y agoyou mean your favorite language prevents you to copy paste code, have variables shorter then 4 letters and also fixes the bugs for you, let me know this cool language so I can try it. I am also sure that in your first years of coding your code had no issues similar with the ones you described.
- wlll 6y ago> your favorite language prevents you to copy paste code, have variables shorter then 4 letters "here's one place that PHP doesn't prevent poor quality code that is the same as other languages, and so all languages are the same" No languages prevent these things (that I am aware of), but not all languages have the same number of edge cases that PHP has. > and also fixes the bugs for you, let me know this cool language so I can try it. I've written a lot of languages over the years, but right now I'm enjoying Go, which kinda does help prevent me from writing bugs with it's static typing, but also it's simplicity. > I am also sure that in your first years of coding your code had no issues similar with the ones you described. What's your point here? Noobs write bugs and bad code? Sure, we agree! But that doesn't mean that PHP is a good programming language.
- simion314 6y agoIf PHP is a bad language, your complaints are just just irrelevant, I could probably find some bad code base made in Go and prove that Go is bad. > but not all languages have the same number of edge cases that PHP has. I agree , some have more some have less The things is that from your comment it shows you have no idea what you are talking about, I suggest you let people with experience in PHP to explain hat are the issues and how to work around them. I have a few experience in PHP, experience with 5.4 and older PHP not the 1990 version. What I could complain about PHP are small things I do not feel that I need some feature from Java or C#, my time is spent reproducing bugs reported by our users, debugging and fixing them or spent on adding new features, creating solutions etc. I admit when I was younger I would complain about why do we have to use AS3, or PHP or X for this, there are better languages but this days I know that the language is a small part of the entire project, the hard part is creating solutions, a new dev will start by typing code and offering you a fast solution that someone else needs to fix it later, an experienced dev will think at 2,3 or more solutions, consider all the advantages and disadvantages, test then and finally start writing the code - so IMO the fact that soem language has a bit more sugar coding or and IDE starts 2 times as fast is irelevant, what is important is the person that generates the solutions and the person that when a bug is raised can dig deeper and find the cause and fix it.
- hanikesn 6y agoOnce or twice a year I have to peak at the code of a C app that was developed by interns more than 10 years ago. No framework was used, max 3 letters variables are the norm, no blank lines and the only comments are from code copy pasted from examples. These days I would be more inclined to celebrate the death of C than its birthday !
- exikyut 6y agoI'm not sure why this comment identically copies the GP with the exception of the last line, but it doesn't appear to be a spam account.
- hanikesn 6y agoI switch PHP to C to show OP in a mirror how ridiculous his statement is.
- exikyut 6y agoWoops. Thanks :)
- iamsmooney 6y agoPrevious poster is making a joke, replacing PHP with C
- exikyut 6y agoThanks :)
- willcipriano 6y ago> interns > more than 10 years ago How that looks to me: Wow, that application has provided so much business value (over a decade worth) despite being designed by less experienced software engineers. PHP must be a great language.
- somurzakov 6y agothis. PHP just gets shit done. newbies might add few sql injections here and there, so you gotta hand them some code convention/code review/frameworks, but PHP just gets stuff done fast and with extremely low overhead
- jmnicolas 6y agoIt's non critical and isn't core to what we do. I don't have much time to allocate to it. My point is that all else being equal if it had been developed in Java or C# my job would be much easier.
- jiriknesl 6y agoWhy haven't you refactored those 3-letter variables to more descriptive ones?