Ask Slashdot: Should I Ditch PHP?
Long-time Slashdot reader Qbertino does PHP for a living, but says he's growing "increasingly frustrated with the ignorant and clueless in the vincinity of PHP."
Crappy code and baaaaad application setups is one thing, but people refusing to fix them or simply not even understanding the broader implications of bad applications or attempting SEO with gadgets while refusing to fix 3.5 MB-per-pagecall are just minor tidbits in a history of increasingly unnerving run-ins with knuckledragers in the "web agency" camp...
Will I leave the larger part of this backwards stuff behind if I move to another server-side programming language such as Java or Kotlin for professional work in the broader web area? Do I have a chance to do quality work on quality projects using PHP, or are those slim compare to other programming languages? In short, should I ditch PHP?
"I think .NET is a much cleaner language to work in with Microsoft's excellent Visual Studio IDE and debugger," argues Slashdot reader Agret , adding "there are many large projects in my city hiring .NET developers and being a strongly typed language the code quality is generally better than PHP."
But what's been your experience? And would a frustrated developer find more quality projects by ditching PHP?
Will I leave the larger part of this backwards stuff behind if I move to another server-side programming language such as Java or Kotlin for professional work in the broader web area? Do I have a chance to do quality work on quality projects using PHP, or are those slim compare to other programming languages? In short, should I ditch PHP?
"I think .NET is a much cleaner language to work in with Microsoft's excellent Visual Studio IDE and debugger," argues Slashdot reader Agret , adding "there are many large projects in my city hiring .NET developers and being a strongly typed language the code quality is generally better than PHP."
But what's been your experience? And would a frustrated developer find more quality projects by ditching PHP?
I actually enjoyed writing Assembly more than C# and Java. My version of hell involves some idiot making me write factory classes to do basic RegEx comparisons.
My little site.
And that's where you're wrong. I'm a senior Java/C++ developer (architect by position) and I'm also using PHP. The problem is that languages like PHP, JavaScript or C++, that allow you to do practically anything anyway are a very, very, veeeeeery bad choice for beginners. PHP in itself is not bad and it has a lot of quality frameworks (Symfony, Laravel, etc.), but it also has a very bad reputation because any wanna-be-developer first starts with PHP and as there is a lot of other wanna-bes, he's learning the wrong things from the start. Starting with a language that keeps you more in check is a lot better, but should not stop here. Knowing certain solutions, design pattern and such is a must, to learn things properly. After that you can go the PHP, JavaScript, etc. route, as you'll be used to doing things the proper way and the freedom thouse languages give won't get in the way of properly designing your solutions.
PHP has a lot of problems, but what they poster reported isn't near the top of them.
the 3.5 Meg with Gadgets isn't PHP it is Google. Also for a lot of other page size issues, the biggest problem is less with the language but with added Javascript Add ins such as Jquery or Angular.js this moves your few kilobyte page to megs very quickly.
In .NET I had aspx pages that seem to place a meg of session data onto the page, which I normally disable because I don't program websites with point and click, and I would rather have more more control when the screen refreshes or just does an AJAX cal and DOM the results back in.
I have been doing Web Application Development (I don't do web sites) from the beginning I know what is happening in general on all sides of computers the clients and the servers.
A particular web language sometime can help sometimes make particular tasks which are annoying much easier. But they cant stop you from making a crap Web Application, and they all have a feature where people may misuse or abuse to create utter garbage.
The posters experience probably has PHP Developers fresh out of college bight eyed and ambitious, looking to change the world with Open Source Technology however lacking the experience to know how to debug (I still have to show recent college grads on how to use the programming debugger, and they are always worried because for some reason that it isn't pure enough for them, or cheating.. For those college professors out there why arn't you showing these kids normal debugging software that has been around for generations!) and also they are often happy when it works, they don't know when to go back to make it better, or they also don't know when to call it good enough and continue on.
The posters experience with .NET developers are probably with professions who have been doing it for a few years, they have families and their goals to change the world isn't going to be their unique take on how to format that textbox. They have more years experience and learned from their younger years. They know when to dig and optimize, and when good enough is good enough. They uses the tools in .NET (Or in PHP or whatever freaking language they are either told to use or what is best suited for the project) more carefully and more often. They know each tool is a double edge sward while making one job quicker and easier it may have a side effect that you need to mitigate, work around, or decide that it isn't worth it. Now I normally don't code sites with point and click programming, because it really bloats up the Application, that doesn't mean I never do it. Sometimes that method would save weeks off my development cycle. And bloat isn't a big issue for the project.
Experience is more important then the language.
If something is so important that you feel the need to post it on the internet... It probably isn't that important.
Yes, a great deal of PHP code in the wild seems unruly. However, this is not due to PHP per-se. Choosing a solid framework (such as codeigniter or cakePHP), following its conventions, and practicing good team dynamics makes all the difference. I have been coding since 1984 in a variety of languages and, although PHP's verbosity annoys me (requires too much finger twisting on the keyboard), I have never seen a more generally productive language. You can easily build a lot, fast. The discipline to make maintainable code is worth the effort that you need anyway, even if coding in Python.
Here are the reasons code becomes unruly:
(1) undisciplined and/or weakly experienced coders
(2) not clear design pattern (usually goes with #1)
(3) well experienced coder's tendency to over-engineer
The worst of these is #3 and it's very common amongst head-strong developers who are knowledgeable.
There is a higher-order thread running through this argument that has to do with good programming practices regardless of language. Modular code and UI components are Good Ideas, for example. Containers are a Good Idea. Git is a Very Good Idea. Typing is a Good Idea if you generate code. Templating is a Good Idea. Observer Pattern is a Good Idea. Eventing is a Good Idea.
What I do is listen to our industry, study their good ideas, and incorporate them in my next project, fitting them to the language and framework the customer is using. Language is primarily a *business* decision, it has to do with what kinds of IT resources the company is willing to commit to.
That shouldn't stop good development. As John Lennon famously said, "I'm an artist. Give me a tuba and I can get you something out of it."
Now go code. Make beautiful, good code with whatever tools they give you. Be the artist.
"We receive as friendly that which agrees with, we resist with dislike that which opposes us" - Faraday
Microsoft bashing of Java? Are you sure you know the history there? For a long time, Microsoft shipped the best JVM on Windows, better than Suns
Fastest != best
Microsoft's JVM was an incomplete implementation, created for the purpose of deceiving customers, and was used as evidence in the US v. Microsoft antitrust case in which Microsoft was found to be guilty of abusing their position in the marketplace (before being effectively pardoned by Dubya's dog Ashcroft.) This effectively makes it the worst JVM of its day.
"You're right," Fisheye says. "I should have set it on 'whip' or 'chop.'"
I once got hired to fix a PHP-based website that had been done by a couple of fly by nighters. It was a fucking nightmare. Because they were lazy and/or stupid, they had enabled every bad directive from the bad old days. They didn't even use functions, it looked more like BASIC spaghetti code. In the end I refused to do any more work until the contract was rewritten so that I was billing out time. At the end of the day I essentially threw out what these idiots had written and rewrote the whole thing from the ground up. But I vowed after that that I would never take on a job where I had to fix someone else's spaghetti code. Hire me to rewrite, that's fine, but not to repair.
The world's burning. Moped Jesus spotted on I50. Details at 11.