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?
Don't blame tools for the things that people do with them. You'll find the same problems wherever you go.
My little site.
Doesn't matter what language you use, bad developers are universal.
The thing is PHP 7.2 is actually pretty good, and 7.3 is looming.
My advice is start your own projects "the right way" (that's subjective), and start your own firm or agency and win with quality.
I'll be 100% honest, this is what I did. Working self employed over 4 years now. Business is doing well. Even have a couple of staff now.
I worked in a place where the whole codebase was PHP, partially as a result of the web site being done in Drupal. I'm aware of many problems with PHP, but my approach there was to continue to develop with it because of the existing codebase and institutional expertise.
A new guy came in who was big on Python, and immediately started implementing server-side Python stuff. I warned that there may be difficulty integrating the Python and PHP services, but the new guy thought I was just an old who wanted to keep doing the old and busted thing because it's all I knew.
The boss didn't nip it in the bud early enough, and I wound up having to write code to share session information between the PHP and Python services. It was a kludge, but it worked. It would have been seamless if we'd kept working within the same language we'd started in, or if we'd undertaken to port the existing code to Python. Oh, and then the new guy quit and left us with this two-language system that few of the other employees could easily maintain.
Point is, I agree that there's more to consider than what is the "better" programming language.
If you came from PHP without any other language experience (except javascript). You cannot understand how PHP exclusively fit for Web development until you start do something with other language.
Other languages need for spesific frameworks, configurations, concepts for web projects. PHP was ready to run. When you try to learning other languages web stack you will be frustrated and return to PHP again. Other languages need extra steps to do simple things in web because of their nature.
Sure php much worse syntax and function names most other languages. However that was language quirks any professional can handle.
Problem is, php entry level is low and with abundant documents and training videos people easily put something on web and so they think they can handle big projects.
And without strict guidelines for project management, php can be lethal as a dodge viper on rainy day.
What you need is, find a battle hardened Project manager which uses Jira and other tools to agile development plus getting know automated testing.
After 6 months You will be fine with php any given sunday.
If you insist to change, you should look Google GO. not .NET it was for windows shops for who develop desktop applications. It wasn't just a language, you have to change your development style, development environment working environment etc.
Google GO was logical next step, It was easy (to comparing other static languages) and it was forced writing disciplined code practices by nature. It fast and you do not need change entire environment. Plus you get military grade arsenal (comparing to php) for complicated projects.
My 2 cents after 20 years of PHP Web development.
[My english is better than most other people's Turkish, so please point out mistakes politely. Thank you.]
As someone who used the early JVMs i production, Microsoft's was NOT better. It was a JVM that would crash randomly, that could not interface with OLE even though Sun bent over backwards to make it possible, and like many Microsoft code bases at the time had very poor docs and failed to follow even them. That was easily the nastiest buggiest JVM impl that I ever touched.
At least, this is what my flashback tells me, now that you set it off! %-P
Rgds
Damon
http://m.earth.org.uk/
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.
It's also pretty rude to fire an entire team and replace them with offshore monkeys, but it happens all the time. This is just the reflection of that - his obligation ends at the last paycheck.
I can't comment on the specifics from a technical POV because I don't know the details - and neither do you. As for the personal attack, he might have got cancer and decided to use his remaining time travelling for all we know. Even if he was just jumping ship for a better offer, why is that wrong?
Confucius say, "Find worm in apple - bad. Find half a worm - worse."
Ok, I will not rag on .Net just now, but I'm definitely not moving to .Net should I leave PHP behind. So you have a point there.
We suffer more in our imagination than in reality. - Seneca
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
Moving to .net won't make you any happier, because strong typing does not make a better code base. Better programmers make better code base. And neither PHP nor .net require you in any way to be a good programmer. Both come with sufficiently plentiful training wheels that both of them attract people who have no idea what they're doing and rely mostly on cargo cult programming.
But this is how programming is these days. Yes, you still have a few good (and very expensive) people who know what they're doing and who actually understand the implications of using this function (or API call) instead of that one, but for every programmer who does know that, you have at least a dozen who copy/paste most of their code from various online sources after googling the problem du jour. This is an universal problem and not one you can solve by switching the programming language.
If you want to solve that problem, you have to switch the user base.
We used to have a Bill of Rights. Now, with the rights gone, all we have left is the bill.
New coders look at crap PHP and think "I can do that!"
Experienced coders look at crap PHP and think "That's crap PHP."
Old coders look at crap PHP and think "Job security."
Red to red, black to black. Switch it on, but stand well back.