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?
Why switch from one crappy thing to another?
Have you seen the cruft that people have made with this??
It's not the language. Who cares what others are doing?
If you can't find decent people to work with in PHP, then you're probably not good enough yourself.
No matter what language you'll switch to, you'll find yourself down in the dregs.
However, it must depend to some extent on what your constraints are. If you support 32 PHP websites that are online and working (and not running on Intel architecture), migration might be a rather expensive waste of time.
Have you considered becoming a PHB?
Sent from my ASR33 using ASCII
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.
There are a ton of languages that makes it easy to "start" something, they lack ... it is trapped into it, sunk cost
- strong typing
- strong debugging support
- reliable libraries
- reliable refactoring
- capability of scaling to large and distributed projects
A beginner starts using the language and
New languages are just reinventing the wheel, really, they are the result of people forgetting history.
The main difference is that a few keystrokes are saved with a resulting code that is impossible to understnd a week after you heve written it.
A pity that Microsoft bashing of Java (to then make Java clone c#) result in knee jerk reactions on the name.
There are very few practical differences between python and php, other than php having a larger attack surface due to all those wordpress installations.
They're both the same shitty "fail-at-runtime-only" language, with the clear majority (some 80+%) of practitioners being skilled in everything other than in building software (hence the reason both of them have such poor design decisions).
There are occasional gems but this shit (that word chosen deliberately) isn't language dependent.
If you are so frustrated with PHP you should switch, perhaps another language will fit you better, or at least it will be a good experience. Keep in mind that PHP doesn't have a monopoly on bad code, bad configuration or bad performance.After you switch to a different environment such as a corporate .net environment you may find you get different types of problems that you you may not even have realized existed when you used PHP. Either way, still good experience.
If you don't like using because of what other people are doing with it then you're not really affected by but by the idiots who don't use properly. What they do with is their business. What you do with is your business.
If you find that is intrinsically flawed and doesn't offer you the coding experience or opportunities for professionalism that you want then you should drop in favour of one that doesn't have those but still provides .
The PHP is bad bait threads are always good for a laugh though, to be fair.
..it's easy to get stuff done in PHP. There are certainly languages which are 'better' in various respects than PHP, but it is not going to replace the fact that if you want a website done quickly then PHP is your tool of choice.
Also, it's cheaper to find PHP employees. That doesn't necessarily mean that you find great coders, but looking on the job boards, the level of salaries offered to PHP developers can be half to a third of salaries offered to developers experienced in (say) Node.js/ React. Not only that there a PHP developers on every street corner.
At the moment I'm amazingly doing PHP at what I call 'financial developer' rates. But these jobs are hard to come by
Donte Alistair Anderson Roberts - hi son!
Karma: Chameleon
But you should dig it a hole, push it in, cover, then run, run like you've never run before.
If you have to ask someone what you should do, you have bigger problems.
A bad programmer can screw up in any programming environment. Running away from PHP isn't going to help. The real question is: what is this person doing, that involves him with so many poor programmers?
The differences between PHP and .Net are huge, and should be based on something other than your spleen.
Enjoy life! This is not a dress rehearsal.
Learning Elixir was a very refreshing and pleasing experience. The language, the tooling, the documentation are excellent, developper-friendly. The underlying OTP is powerful for making resilient and distributed applications.. The Phoenix framework is very well-made. Learning functional programming made me a better Python and perl programmer.. I used this online course, I recommend it:
https://www.udemy.com/the-comp...
(price reduced with the coupon)
When @Qbertino first starting using PHP, he was almost certainly just as bad as the devs he's complaining about. For an experienced dev to hold less experienced devs in contempt is not the nicest thing to see no matter how frustrating they can be and even if it's not intentional. Many if not most of them will get better with experience and maybe @Qbertin would find it more rewarding to help them rather than start the cycle all over again. After all, switching to a different platform will just turn him into a less experienced dev who is found frustrating by experienced devs.
The problem with PHP is that there's too many novices and bushwhackers using it, resulting in insecure code and an unsafer internet. How many PHP CMS's haven't had total break ins just because the people writing the code just didn't know a thing about programming.
I associate PHP with unprofessional behavior, and that's why I stay far away from it.
C# is a vastly better language and .NET a vastly better framework and ecosystem. It's totally secure and AFAIK there have never been any large break-ins on ASP.NET websites.
Oracle does that for decades get used to it.
These days ist just a normal job. Can't do this or that? Maybe find some other job like flipping burgers or writing code.
In this age computers are no longer for highly motivated and technically apt individuals, but for everyone. Because so many people are needed and there's no barrier to enter the field at all.
Because it's within the concepts of specific languages, which may not actually dictate *what* people can do with them, but which clearly specify *how* they have to do it. Which may very well imply different values for the average quality of code for different languages...
Unfortunately Javascript and single page applications seems to be the future, I think Angular 2 will be the winner in framework battle. .NET is also quite hot at the moment, but you can be fairly certain that it will go away in a few years, just like everything else from Microsoft has. If you don't mind being a silverlight developer for a few years and then switching to another language again, then .NET is OK, just be careful not to spend more than 10 years with it or the switch becomes nearly impossible when .NET is axed by Microsoft.
On the server side Java is most likely the winner. It amazes me that despite Oracle buying Java, it did not die. This means that the OpenJDK community is healthy enough to survive without big companies. Also if you are not already, you just be familiar how to use cloud technology. Not because it is hard (it is quite simple actually), but mostly because HR will like to see knowledge and experience in it and it is usually always good to be able to design software so that it can be scaled.
This is from the analytical point of view. However the most important thing is, what do you want to do. If you really enjoy working with PHP, why should you stop? If you enjoy .NET, why shouldn't you use it even you know it will be axed at some point? (It will most likely take years before that happens).
Before calling someone knuckle-dragger, perhaps you should know how to spell knuckle-dragger first.
the question is clearly comprehensive enough that the poster knows there's something deeply, deeply wrong with PHP. a more detailed investigation shows that the actual core developers are ignorant of system-level security programming... but it takes time to actually find that out.
what stood out for me was that the poster clearly sees an extremely high degree of incompetence surrounding PHP. as in: way-above-average. in part this is i feel down to PHP attracting "web-only" developers who have "a bit of HTML and CSS" and consequently genuinely believe that they are god's gift to the internet, but it's more than that: it's down i feel to the way that PHP programming started out.
in 1995 i remember being incredibly excited to do my first PHP programming, sitting in CB1 Cafe in Cambridge, after downloading all the source code for apache2, mysql and php onto a NeXT Workstation over a 56k dialup modem. embedding actual dynamic functions into HTML, seeing the results change depending on what was in the database, that was just absolutely ground-breaking.
what didn't occur to me at the time was how much damage the approach of embedding a programming language's functions into HTML.
fast-forward ten years later and a friend and i were tasked with "recovering" an absolutely disastrous PHP application gone wrong. the programmer had written 3,000 line PHP pages.... times four.... one for entering a "new" record (with 40 or 50 fields per record), one page - cut/paste modified with "error strings" inserted. a SEPARATE page for edit and a SEPARATE page for edit-with-errors.
this "style" was copied enough times so that the application was over a HUNDRED thousand lines of ineffective unmaintanable code. my friend cut out EVERYTHING so that there was not a single piece of interleaved php plus HTML, and with a lot of refactoring the entire application was down to under 10,000 lines and much more powerful.
he wasn't the only programmer i've seen make this mistake.
the point is: it wasn't so much the incompetent developers' fault: it was the style that allows PHP functions to *be* embedded into HTML/CSS that *causes* people to think that this is both "normal" and "acceptable" (readable / maintainable).
now, there are likely to be quite a lot of replies saying "But You Don't Have To Do It That Way, You Can Use Templating Library {insert name of one of dozens of templating libraries here}", that's not the point and it's not helping: the point is that people who *don't know* that those libraries exist *will* end up writing shit unmaintainable code, by default.
there's more than that, obviously, which boils down to: where there are inherently good programming practices *right from the start* as well as an easy-to-read inherently tidy and elegant "style", even bad programmers have to work really quite hard to screw up.
and that's why i love python, particularly for web programming. i maintain a top fastest 1% website for a client (the render time is under 0.7 seconds even from half way across the world), and it's entirely written in python *with absolutely no external framework dependencies*. i gave up using sqlalchemy, django and so on, a *LONG* time ago, as i learned that using python's string "format" function is perfectly sufficient. do a for-loop, generate the fields from a python list with a function, voila you have the input fields for a form. or the fields from a database query. if you want readable HTML rather than {0} in the thing, you just use python main_html_page_string.replace("", left_menu_string). it really couldn't get any easier.
... I'd say have a thorough look into Java, at least if you want to keep platform independence as an option, with the JDK offering forays into other and more modern languages too, like Kotlin, Scala, Groovy or many others, and being the next best thing in terms of performance after natively compiled code.
With Oracle's latest change in update policy, though, forcing commercial users to upgrade JVMs/JDKs to the next major version – possibly breaking things – every six months, at least if they want to keep getting security updates without paying heavy subscription fees, I'm not sure anymore what the future of Java and the JDK/JVM will be.
He's pretty sharp, this Qbertino guy. How come nobody spotted this earlier?
P.S. Are they so ignorant and clueless that they can't spell vicinity?
Confucius say, "Find worm in apple - bad. Find half a worm - worse."
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.]
I guess itâ(TM)s a âoetestâ by Microsoft to see reaction of masses. Surely PHP is PoS, but itâ(TM)s an Open Source PoS. Going to a vendor-locked ecosystem is shooting yourself in a foot. So: 1) Ditch? Well, just keep learning. There are proper languages around you know. 2) Submit to MS? Why? Learn C# if you must, but donâ(TM)t limit yourself. I still think itâ(TM)s MS-trolling.
> "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."
Are you fucking kidding me? I've worked with just as many clueless .Net developer as I have Php developers. The general problem with career .Net developers is that they have no idea how to solve problems outside of the Visual Studio IDE bubble, and no real bearing on how HTTP works. Some of the worst APIs I've had to interface with have been written in .Net, which is obvious due to the trailing ".aspx" wart on the end of the URI. Java developer are not any better, and if it's anything outsourced from one of a few particular countries, you're totally screwed, enjoy your rewrite.
Language has little impact on quality of code, some bonehead will find a way to somehow write enough code that will make its way into production that you'll have to fix it when it falls over.
And you should have done the same.
It's just full of bad programmers and the only applications people build in PHP are crappy websites.
Moved to a real programming language with a niche that values skill, and I easily multiplied my salary by 10.
It's not about other coders. Other coders in my field are generally nice people although it is strenuous explaining to them time and time again why it's important to do versioning and CI. It's about the whole environment. Doing double and triple the work because someone needs babysitting to do his versioning correctly is a common thing in the web agency / PHP camp. This has nothing to do with self awareness and everything to do with me getting tired of it. Hence my question and request for input.
Thank you for yours btw!
We suffer more in our imagination than in reality. - Seneca
I've been coding PHP, Java and more recently JS for a while. I feel like PHP has dropped the ball when it comes to async programming compared to the others. I think that's one of the reasons why facebook forked PHP (hacklang.org) to make it async friendly. ReactPHP is slow compared to node, and the fastest PHP async framework, Swoole by Tencent, is still limited in what it supports. I've been trying vert.x on Java which isn't bad and not minding koa. I feel like they need to do more to support projects like ReactPHP with native extensions like Swoole.
sage and report.
In short: YES FUCKING YES DITCH IT
Quick reply to other arguments
- "Bad developers are universal" => of course, but the ratio of bad developers doing PHP is not even on the same scale as for other languages
- "PHP has changed" => nope it hasn't, it's just a nice coating added on a shit cake
- "Modern frameworks are much better" => you see the gap from WordPress to Laravel ? There's the same from Laravel to Django
- (any other pro-PHP argument) => whatever, PHP makes people want to kill themselves and there is much better options out there
As for alternatives, I'd recommend Python which solved my last serious complaint with version 3.4 in 2014 and which I've been using for basically 10 years now with a complete success in terms of code quality and adoption within the team.
I don't think the problem isn't PHP or not,
but "Web Sites"...
If you make websites you deal with people who wants websites,
And everybody knows how websites are done, right?
This attitude drives away any "good" developers.
So you're stuck with the one you can't or won't or just don't care...
Not all developers in this area , but the majority.
If you want to write good software you need project and customers who understand what "good" means.
The language is secondary,
Your challenge is finding these "good" projects.
PS:
(and perhaps saying "i dont do php" shows the right attitude... just saying...)
And keep selling your PHP competences. If you're better, PHP being a huge market, you'll make a difference and claim a higher salary.
Slashdot, fix the reply notifications... You won't get away with it...
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."
This is actually one of the things I was thinking / considering.
Not sure yet if I'll go that path, but your feedback resonates.
Thanks for your thoughts!
We suffer more in our imagination than in reality. - Seneca
"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."
I wonder what Agret's thoughts on C# are?
I was afraid there is no easy answer and I guess we can all agree on that. Truth be told, there is an advantage to being the experience guy in a web agency / PHP shop and I can't really complain about my salary right now either, although I would like it to improve within the next 3-4 years.
Whatever I do, I'm not going to stick with standard PHP fiddeling. If I stay in the PHP camp, I'll specialize and focus on things that come with it, such as web projects as a whole, performance and high-availability and such. ... I asked the question because if I stay in the PHP camp, this is going to be the point at which I start getting certifications (Zend, Magento, etc.) in order to up my long-term income prospects.
It is a toss and I'm experienced enough to know that simply switching to Go/Elixir/Node or whatever fad I chose to join when leaving PHP is going to come with its very own set of problems. I also get that shitty code is everywhere, not just in PHP. Which gives PHP the upper hand with this, as no one in the PHP camp automatically asumes the code he runs into will be good.
Either way, please keep your thoughts coming, this is helpful.
Thanks a bunch!
We suffer more in our imagination than in reality. - Seneca
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
A good designed and implemented language it's not enough to prevent a programmer to write bad code. At least a good tool can give some hints, feedback about what's wrong with some portions of code, but still it's the roll of programmer to push harder to rewrite to faulty codes, until entering in the phase in which become acceptable.
For some jobs, PHP is more suited than Java or C# for others vice-versa.
In webdevelopment there are way too many crappy programmers. He should switch to embedded where such things are not tolerated.
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.
The summary is too well built for not being surreptitious Microsoft advertisement.
I always liked working with PHP. The only down side I saw with it was the same down side I see in every other language I work with. I have to clean up other peoples messes. PHP isn't the problem, crappy programmers who came before you and refuse to fix their garbage are the problem. That can be fixed by taking away their pay till they fix it or you hire someone new to replace em
The PHP Singularity:
https://developers.slashdot.org/story/12/06/29/1458234/the-php-singularity
Is PHP the new VB6?
PHP: a fractal of bad design
https://eev.ee/blog/2012/04/09/php-a-fractal-of-bad-design/
That's was in 2012. But for now it's still true?
PHP, itself, is a crappy language. It relies on a massive, accreted standard library, and has only fairly recently become halfway acceptable as an object-oriented language.
It's filled with stuff like this: array_map($callback, $array) vs. array_walk(&$array, $callback) (with the array being changed by reference in the second).
That's what happens when you have a million monkeys on a million typewriters.
That said, it's here to stay for a long time, and is a VERY powerful and well-supported server language. It's one of Facebook's principal languages, and they have contributed to it in a big way. It's quite legitimate as a business choice for server support. It has a ginormous support community, and millions of articles and recipes.
There's any number of languages that are much more elegant, and, depending on the application, appropriate, but you need to realize that sloppy programmers will create garbage in any language.
There's this "cargo cult" mentality in software development, these days, where people think that the tools make the software, so they get whatever shiny tool is hot right now, and throw it into a room with a million low-cost monkeys, and wait for the collected works of Shakespeare to emerge.
Languages like PHP and C++ are constantly being slagged by hipsters, these days, but they keep going, and still power some of the most important infrastructure on Earth; usually because the people writing code in them are very good.
Linux is still pretty much all C. Not C++, not C#, not Objective-C. C.
That's because Linus is not a monkey, despite his penchant for sometimes throwing poop. He's a damn good architect and engineer. That don't come from a Cracker Jack box.
If you are a monkey, then I suggest making sure that your fundamentals, like design ethos, ethics, quality, and structural discipline are in good shape. These will translate to any tool that you use, and allow you to choose the most useful, business-relevant tool to use for a given application.
A new banana won't help.
I left the insane PHP world quite a while ago and wrote a post detailing some of my reasons. Even though PHP has improved a lot since then, the foundations still suck. For example, the vast majority of people writing PHP are still "web designers" who know nothing about writing proper code. And I just don't get it when people tell me I have to be patient because PHP is improving - why wait that PHP becomes better when you can work with better tools now? I get much better salaries and enjoy the projects I work on a lot more since I dropped PHP. It's just not worth it.
Experience is more important then the language.
Exactly. Serviceable code can almost always be written in any language. And crap code can always be written in any language. It's a poor workman who blames his tools...
A language is just a language. It's the developer who makes code crap or good. It's very easy to start developing with PHP. Because of that, many young and unexperienced developers use PHP. That and only that is the reason why so much PHP code is crap. It has nothing to do with the language itself. With PHP, it's very well possible to write good, solid, fast and secure webapplications. You want proof? Check out the Banshee PHP framework.
It doesn't have to be like this. All we need to do is make sure we keep talking.
But those people never tried to use another language for web development. Usually people will move away from PHP to Python and Ruby, and I never faced any of them who moved back after truly make a project on those languages. The only friend I have defending PHP is the one who never tried other language/framework for real, always saying "it's not the language".
Yes, it is. The core is really a mess, features are moved away and returns, the team making the rules has weak technical skills (search for the reason why namespace uses backslash). You have a dozen of broken/abandoned frameworks trying to mimic Rails/Django, but the better is 10 years away from them. And the worst: the community is really, really weak. Of course, you'll find people to hire asking few buckets, but they'll make you cry.
All languages supports both good and bad code. The problem is, goodness is not in the spec. The spec only says what the site looks like, what you can do there. So of course bad code gets written - you get the functionality but the implementation is unreasonable.
Add some specs like these:
1. The data transferred between client & server should measure in single-digit kilobytes (excluding imagery), not hundreds of kB or megs. Anything else won't scale. Do the test and NO PAY if they fail on this. Otherwise, it will be expensive to scale.
2. A demo server with only 10 users should be able to run on a raspberry - and perform nicely! Rules out all those "lets load huge libraries for no reason". You may need a big server for a million customers, nor for "running at all"
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.
Ditch the agency work and pickup laravel
A good programmer can write good code in any language. That said, an average or bad programmer has the tendency to write really horrible code in PHP. Let's say the nature of the language leads you to bad code, more so than say C# or Python. You have to fight the nature in order to avoid it.
I was strictly a .NET programmer from, jeez, 1.0 up to almost v3. Loved the IDE, code base felt "bigger" than it needed to be for projects. My main issue was that the application on the server just dies a lot. And this wasnt just 1 app, at one company, my experience across multiple companies, multiple setups, it just seemed the the application would crash for no reason and need completely restarted pretty regularly.
.NET/IIS might be better now, but that was my experience.
Been on PHP/LAMP for several years now and that bastard never so much as went down once.
//TODO: Insert catchy phrase
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.
As a developer who did 6 years of Java, 4 years of C# and 5 years of PHP for a living, PHP is not a good language for long term maintainability in a team. So, if you are alone on the project, you know perfectly your way around the language quirks, know how to use composer properly and have no need for scalability, then PHP is probably good enough for you. In any other case, do not use PHP.
PHP is a bad language for teams with various levels of knowledge of the language, who do not pair-program or when scalability (connection pooling issues mostly, and not only DB connections) matters, of if you want to use microservices inside of a PHP script (there is a circle in PHP hell for that).
In a nutshell, PHP is a bad language to have legacy code in, and not easily scalable. It is quirky, though not unmanageably quirky with the right tools, but once you ignore warnings, do not use proper code quality tools (sonarqube and such), you are definitely fucked with PHP. And these days, I am maintaining several of those nightmare no-framework, reinvent-the-wheel, warnings everywhere and no composer and custom classloading PHP application.
By the way, beware of C# in a team. C# is a huge and complex language. Just like C++, you must agree on a subset of a language, for consistency sake. Once you got your subset, you are good to go.
Stupidity is the root of all evil.
If you’d like to specify the language which you think is more suitable than PHP for projects where PHP is often a sensible choice, I’ll be more than happy to come back and offer some specific examples of its failings
I get the impression from eevee's notorious "fractal of bad design" rant that she'd prefer Python. I've been trying to keep my own page about the issue more nuanced, distilling the problems that "fractal" mentions into a set of coding standards, inspired by the work of Douglas Crockford, and another set of failures that coding standards alone cannot prevent.
So where does, say, Python fail in comparison to PHP? (Other than ability to collaborate over channels that are broken in that they mangle leading whitespace.)
Better programmers know they need better tools and will move where they can get them. (Compare and contrast the desperation evident in the endless stream of ``transpile-to-javascript'' contraptions.)
How much of this "desperation" is related to non-JavaScript applications 1. being operating system specific, 2. requiring an install step on the user's part, and 3. in many cases needing approval from the operating system's publisher before they will execute on retail devices?
I will admit that there is a ton of bad PHP code out there. Some of that stems from PHP being a gateway language (first language for self taught coders) for a long time. However I have been working part time on a .Net web service for the last year and it is awful. Right up there with the worst PHP I've ever seen. Three different ways to connect to the same database? check. Three different partially completed attempts to redesign the thing? check. A client that doesn't understand that the project has grown into a monster and refuses to allow fixes until it is well and truely broken? check. Oh and the one bit that I replaced with PHP? Sold to client because it was 10 times faster... this is PHP it is not supposed to outperform compiled code but 10,000 requests handled in the same CPU time as 1,000 for .Net.
So please don't give up on a language because the client doesn't let you fix things... Instead take small chances to fix things and show the client how fixing things can be better... Still hoping my client breaks out of their "not my decision, finger pointing, go around" and contracts me to fix some more things... Fixing code is easy, fixing clients is somewhat harder.
Oracle isn't doing Java Enterprise Edition anymore. It's under Eclipse's governance now and called Jakarta EE.
Th post the other day about python brought out all the curmudgeons who damned it as a "toy language" not fit for "anything longer than a page". Meanwhile the comments here are people defending PHP as "the right tool depending on the environment" and "its not the language, there are bad developers using every language."
Slashdot really confuses me sometimes.
It breaks down to PHP being much less capable than ASP.NET in its capabilities, though I admit it's been a while since I've used PHP, some of these limitations are built into the basic design of PHP so I'm not sure how they could have improved those aspects since then.
ASP.NET and ASP.NET Core have control of pretty much the entire web server stack (to a point). So you can do things like declare REST APIs and map them to single functions, whereas it is much harder to do that in PHP because first the web server needs to map a request to your PHP script file before you even get control in the first place, so you need to use Apache mod_rewrite or whatever (as opposed to a single line of ASP.NET code embedded with your REST API function.
I think that's really the biggest thing. PHP code starts and ends at the PHP script file and all code is run in the context of a HTTP request. There's no built-in way to do background processing outside of that, and you are writing a collection of scripts, not a full application. In ASP.NET you are writing an APPLICATION, and you get as much control over requests into your application URLs as you need. You can filter requests, add middleware, and your app doesn't even serve static files from disk unless you tell it to.
PHP has also had growing pains, starting out with no OOP support but having such things added eventually and having their APIs eventually converted over to use OOP (I stopped using it before this point so I am not sure how good it is). Also some bad security decisions that had to be corrected have led to things like mysql_escape and mysql_real_escape functions. Meanwhile in .NET you just use SQL parameters and you're good from a security standpoint. It has been awhile so I would hope PHP has SQL parameters now. I can't speak to the current state of PHP from a security standpoint but they've had a rocky journey for sure.
Also as a side note, .NET has EF/EF Core, which is amazing. I fell in love with it. Use any DB you want. Write classes that represent objects. And then EF/EF Core generates DB structures and queries for you; you don't have to deal with any of that. Change the object structure? DBs will be migrated to the new structure. It's pretty much magic. With PHP you're stuck picking a specific database and manually writing queries. If you want objects to represent your records (a database abstraction layer of some sort is a good idea for security reasons) you have to build all that by hand.
PHP encourages short bursts of code, a remnant of it's non-OOP past. ASP.NET encourages well-organized code. And the VS IDE is awesome. I can't speak to any of the other alternatives like Java but I would expect it to have many of the same advantages of ASP.NET over PHP. Though the one time I worked with Java in a desktop application I disliked how it insisted I had to catch every exception. Sometimes you want SomeObscureException to crash your app since you can't do anything about it anyway.
PHP is way behind modern javascript frameworks even Laravel and Symfony are way behind.
We'll make great pets
Have seen the memory and CPU usage of anything created in it?
Not to mention to read the code. You need a 4k monitor in order to.
But use a god linter and visual code and it will teach you good coding behavior, have just used it for node.js but I assume it is as great for most languages
I think aticus.finch meant languages in which the parser does not statically type-check the abstract syntax tree (AST) in the process of producing bytecode that the interpreter proper runs. What counterpart does PHP have to Mypy, a static type-checking extension to Python?
I've developed and released several web apps in PHP now.
My biggest frustration is when 3rd party libraries and tools don't exist for it because "It's PHP". Google is a great example of this. They have "native" Node.js libs for the majority of their API's, but for PHP, they either don't exist, or they are written by third parties, which means maintenance is slim to none.
Also, uniformity across platforms and distribution headaches...
Running PHP on Linux is different from on Windows is different from RasPi is different from docker. And then depending on the backend webserver, you may or may not ever even be able to get the project running.
BUT...all of these headaches aside - working in 7.2 has been pretty nice, and fixes a lot of the shortcomings of 5.x versions. Using a proper IDE and debugging tools, I don't see any major issues with it as an overall language. If they came up with a native way to run multiple threads/async code and fixed up a lot of the weirdness with method names and library distributions, I think it wouldn't have a problem keeping up with other "modern" languages...
Still, I'm already starting to learn Node.js, simply because there's a lot of places that don't look at PHP as favorably as I do...
One language that is clearly worse than PHP is the absolute mess that is modern JavaScript and the calamity that is Node.js. I’ve never seen a more fucked up ecosystem than that.
"Should I swap using a hammer for a screwdriver?"
The answer is "maybe". Use the language that makes sense for the project.
PHP lets you write awesome stuff easily, and PHP lets you write hideous stuff easily. I promise you that I can write shitty, buggy, insecure code in any language you want, not just PHP. Or C++. Or Javascript. Or Python.
It's not the fault of the language- you can say "Me so hungry want eat" in any language.
Just cruising through this digital world at 33 1/3 rpm...
. . .the last time I checked!
PHP as a scripting language on par with (or better than) Python FTW.
So many self-taught PHP devs from the wild west days of the internet. I have never seen so much shitty code in my life.
and developers. It doesn't matter what it is the cycle always seems to be the same:
1) a language or framework is created to solve a current problem.
2) early adopters show up who in my estimation seem to be on the upper tail of the intelligence distribution.
3) Said developers start solving the problems the new tech was intended to fix.
4) articles appear, discussion groups, etc. start touting said tech as a magic bullet
5) the thundering herd of developers follow it, most of whom are lower skilled than the early adopters.
6) New features are requested and cruft develops.
7) The vast majority of developers are not that good. They are disorganized, arrogant, lazy in the wrong way, can't see the big picture, have no imagination, and don't care about the users.
8) The software written in the new thing degrades and problems develop.
9) due to 8 go to step 1.
I left out the part where vendors and managers screw things up by misunderstanding the technology and selling their "implementation", see agile software development and SAFe as examples.
*ranting and raving*
After 20+ years in the business in just about every role imaginable; department head, developer, QA, BA, DBA, SA, build miester, etc; code has always sucked. No matter what tech is being used it sucks.
Most developers suck. I have seen the same problems described in TFA in .Net, COBOL, Fortran, C++, C, SQL, Spring, ORM frameworks, Java, Python, Perl and probably more that I can't think of right now. It is not the technology, it is how we select, train, and reward people in the software development process. So I say to EditorDavid, good luck with that. I am going to spend my time on a quest with a higher possibility of success, finding the fountain of youth.
*end of ranting and raving.*
putting the 'B' in LGBTQ+
Facebook's Hack language may be worth a look, to leverage what you already know in, well, a better setup.
Hack is backwards compatible with PHP, but adds a few nice bits. The goal was developer efficiency, but you also get CPU efficiency wins.
Every language has it's problems and trade offs... A lot of people have mentioned python as a language to switch to instead as its often viewed as a "cleaner" language. Some of that has come at a massive backwards compatibility cost that was Python 2.x to 3.x. A decade later countless python developers are still paying the cost of that change.
PHP took a different approach of rare and very narrow backwards compatibility breakages. No doubt it has resulted in a language viewed as "messier", but developers aren't wasting decades dealing with old versions.
This is why newer languages seem so great near the beginning, things seem "fresh" and "clean", but 10 years in they will have many of the warts that langauges before them have.
It's also why many developers "go-to move" is to rewrite code from scratch. They don't understand that code gets messy, it grows warts over time as the application grows and requirements change. Any actively used application/website is a living, breathing entity that is constantly in motion. Even the best design specifications are just for one tiny snapshot in time (version 1.0), then the warts begin appearing with v2.0, v3.0, etc...
In my opinion, if you aren't an expert in learning other people's code and refactoring it, then you aren't a senior developer, since you haven't been on a project long enough to get to that point.
Part of that has to do with website development vs. application development. Most websites are small/short projects, done on the cheap, and "one hit wonders", meaning once done you move on to another project and rarely touch or see the code again. This breeds the worst of the worst.
Instead look for application development jobs, preferrably from non-startup companies that have been around for a while. They will usually care about their codebase and invest in quality developers and give them the time to properly refactor as necessary.
If you code in .net then how much will it cost in 10 years to upgrade to a newer version of .net? .net.
It is also proven that Microsoft products has holes in it for attacks by hackers.
I would say that people that are real developers understands other programming languages than being connected at the hip with
The momentum is coming from Open Source and GNU license.
Many people argue factoids about programming such as MVC etc and completely miss the whole point is to deliver a working product.
If you follow every bad practice and generate tech debt as fast as you can you will probably start tripping over your own code and either not deliver or deliver a bad product.
At the same time, if you focus on pleasing your 3rd year academically oriented uni prof you will also probably end up not delivering or deliver a bad product.
So, the question is: what set of technologies will deliver the quality the client wants for the least amount of cost? The simple reality is that for the vast majority of web developments that aren't going to just be another wordpress heap of crap that LAMP or something else ending in P is probably best.
I personally do mission critical stuff that has management reporting through web. I do it in C++ so that it continues to appear "mission critical", the reality is that I would easily deliver equal or better quality with PHP in far less time.
To me PHP is like having an adjustable wrench. There is no arguing that proper high quality drop forged wrenches and sockets are better, but why then does my adjustable wrench get used so much? Because it is handy and in many cases the bolt/nut is off faster than if I had done the longer task of getting the correct wrench, only to find it wasn't an exact fit, so getting another wrench, trying it, then finding it is a metric nut, getting those wrenches, etc.
That said, there are many jobs where PHP is so wildly ill-suited that it is just abuse to use it.
PHP is an HTML template language. Full stop. It allows the mixing of some control logic with the front end. The further you push PHP away from this ideal the more wrong you are. But at this point any other combination of technologies just doesn't fill this niche anywhere near as well.
PHP is the best language for web. Easy to understand, maintain, a lot of supporters, tutorials, examples. If you switch to something other I guarantee you will have 10x times more issues.
The key is agreeing on what a "bad" programming language is.
Is a language that's 1) quick and easy to learn, 2) used in an environment that reinvents itself from scratch every X years, and 3) free? No.
PHP is the plastic member of the programming utensil family. It's so relatively cheap to throw out and replace that the users don't care if it's not strong and reusable.
If we had all just stayed with pascal, the world would have beed nirvana by now!
PHP v7 is good stuff. If your organization isn't using v7, then they don't care about making use of the improvements to the language and you are most likely doing legacy work. BAIL! ... and go find an organization that does or move to Kotlin/Java or even NODE.js (great money and lots of interested, so long as they use TypeScript).
PHP is like Visual Basic of the 2000s. Actually, PHP is just like PHP of the 2000s too (for some organizations). It's low barrier to entry makes for quick prototypes, by inexperienced programmers. While you can also say, "there are bad programmers in every language". Some are worse than orders and PHP is that worse. In addition, the PAY $$ can suck for PHP compared to "enterprise" languages.
I agree completely. I do not like PHP, and I'm not doing any new projects in it, but PHP has arrived. They somehow made it fast, it has solid libraries, good tooling, and the language itself has a reasonable level of abstraction, without giving people too much rope (or is it parentheses?) to hang themselves with. If someone hasn't already become sick of PHP, there's not really any reason to leave now. Developing in Laravel with the Psy REPL is a pretty good experience. Composer works pretty painlessly, too. There's really not a lot to complain about these days, except that I think it's verbose and ugly, and occasionally limited in expression. On the one hand, you can't write the same kinds of one-liners that you can in Perl or Ruby, and on the other hand, you can't write the same kinds of one-liners that you can in Perl or Ruby. PHP is not for the people who like their code to be a perfect gemstone. It does get the job done though.
WordPress is its own separate self-sustaining ecosystem at this point, God help us. Nothing can save it, nothing can kill it.
Those who advocate genocide deserve every protection afforded by law, and none afforded by common human decency.
https://eev.ee/blog/2012/04/09/php-a-fractal-of-bad-design/
It is just so easy, to fuck up in php. Ditch it ASAP.
Yes, yes, yes. Now that there is a software history, no one is studying it to do things better. If you paid attention you can solve the same problems over and over, unless the kids are literally too stupid to let you solve them. Looking at you node.
What's change?
Often it is a matter of personality and preference. Certain languages and/or frameworks attract certain personalities such that one size doesn't fit all. Try a different company or stack if you don't like the current environment and feel trapped in a rut. Since everyone who will give you advice prefers different things, in the end there's no substitute for actually trying.
Table-ized A.I.
There are buttheads everywhere. But there are certain things that work better for largescale program development. Object-Oriented code and strong typing are good things for larger programs on the back end. Web technologies are still intrinsically ugly, but at least that part of the stack is a huge improvement. Moreover, because PHP has no structure, lots of idiots learned to hack it. The barriers to entry for .Net and Java are higher so the quality of programmers are often better.
For a quick graph I would write a couple of lines in Matlab, not write a Java program, but I would never write a several thousand line program to build thousands of graphs per day in Matlab unless forced at gunpoint. Oh, look: http://hudson.dl.stevens-tech....
Good languages do not prevent bad programmer from producing crap. See how most java programs are just insane bloatwares?
The notion of going from PHP to .NET is terrible, really horrifying idea. For the sake of all things good and decent, NO! Going from an open source platform where you are not vendor locked and can control the source to giving all of that up for Microsoft's closed source solutions is a horrifying idea.
The notion that since a certain project has problems that the language it is written in is bad isn't sound logical thinking.
What these people need is a commercially supported PHP, Python, Ruby or Java CMS, they do exist in large numbers, you can find them. This way you do not give up access to the source code for the platform. If you want real support and responsiveness, you should pay and expect to pay the company that develops the code, even if, in fact, ESPECIALLY if it is an open source project!
You should use open source, BUT, Stop thinking you can using open source you can get something for free. Stop thinking that using open source doesn't mean you should not pay, especially if you are using it for a large commercial project for an enterprise. Expect if you want something fixed and want developers to pay attention, that you will have to pay for the commercial support package for the open source software.
Don't go for closed source software, instead go with commercially supported open source. You can and should do this by using one of the many commercially supported open source systems that are available, such as Mangolia CMS, ERP5, there are many others.
All server side programming technologies are awful, we have discussed this issue before and ir won't be better, that's why we keep making horrible frameworks and stupid tools to ease the Paine (like assembly.js or typescript)
PHP requires Javascript, asp.net does the same, the only reason to use asp.net is to generate dll pages and to use that crappy SQL server.
And the JAVA side is not better, so there is no sunny time in the web programming sky... unless tour website is just a showroom.
It sucked, I believe it still does, besides it's really boring as language.
If you're worried about what single language to use. I use PHP but can't think of a single project I've ever done where the whole project was accomplished in PHP. PHP is best for the middleware. I use whatever language is best with the database chosen by the project for the stored procedures. The client is usually done in JS, though I have occasionally dealt with rich clients in other languages. I have also used JS in the middleware, but I'm generally more comfortable with PHP there.
Do you actually do your client in PHP? Your stored procedures? Are you on one of these weird projects where they don't break the functions up into small enough pieces that the same person can implement a function all the way through from user to DB? If so, go find a real programmer's job.
Javascript on the front end and a good interpreter on the back end. Node, Python, even Ruby is a good choice. For parts of the application that requires high performance you an use Java. I'm starting looking at Go and Rust.
Hey can anyone specify a good coding language for game development
I'm really want to learn game development
professionals can write shitty code in any language
I recently ditched PHP for reasons unrelated to the language (needed a fullstack framework). I'm now writing backend and frontend code in Javascript and boy do I want my PHP back.
I strongly recommend you ditch PHP and make a tiny hobby project in whatever candidate language(s) you have in mind. Languages are like ex'es- sometimes you're happy to be rid of them, and sometimes with a little bit of distance you realize just what you lost. Unlike ex, your programming language can be ditched as a trial.
So ditch PHP for a while and try something else. It will make you see more clearly, and allow you to make a better decision.
Assorted stuff I do sometimes: Lemuria.org
I make a living writing PHP software and I've been making a living writing .NET (C#) software. I still dabble in some .NET every now and then.
If the totality of your exposure to PHP is the brain-dead, obsolete code patterns in WordPress you will find PHP a disappointing fossil that needs to die. However, WordPress still supports PHP 4, a version of the language which has indeed died TEN YEARS AGO. Therefore all you see is PHP 4 patterns with a few bits and pieces of early PHP 5. You see the language as it was before 2010. Yes, it's popular; but so is McDonald's. People tend to go for easy, not for good quality.
If you take that factor into account it's as though the only .NET you ever saw is .NET 1.0. I would argue that .NET 1.0 was charming but thoroughly lacking in features which make .NET actually useful. I can't imagine myself writing .NET code without async or LINQ just like I can't imagine myself writing PHP code without enforceable type hinting, generators and namespaces.
Choose whichever language you feel comfortable with. If your primary reason for writing code is making a living then definitely go with the language which will more easily make you a living with a minimal degree of anguish. That's how I ended up doing PHP instead of .NET or Delphi (both of which I enjoyed more).
You might consider learning Go (http://golang.org).
Some advantages:
* Static typing
* Type inference, do you don't wear out your keyboard time writing boilerplate to accommodate that static typing
* Compiles your code into a single binary file. Easy to distribute.
* Very modern, high quality standard library.
* Goroutines - CSP-style multithreading. Writing threaded code in Python is excruciating. In Go it's easy and fun.
* Go programs are notoriously fast - nearly as fast as C programs.
* It's a small language, easy to learn.
* Go community culture and the godoc tool strongly encourage good embedded documentation.
* Large, high quality, and still growing community. Kubernetes, Terraform, and a lot of other cool stuff are written in Go.
* Good tooling available - Jetbrains Goland IDE is awesome. But not free like beer or speech.
Disadvantage:
* Nil pointer exceptions. The nemesis of Go programmers. Really a shame that Go doesn't have null safety built-in to the language.
* It's corporate open source, owned by Google. No democracy. If you want to contribute to the the language itself, you are required to assign copyright to Google and to abide by their petty-authoritarian "code of conduct". Most users therefore choose not to contribute to the language itself.
* It's a relatively young language. The ecosystem is not as vast as e.g. the Python ecosystem.
If you're planning to write APIs - like the kind that power modern single page JavaScript apps - Go is ideal. On the other hand if you're going to be doing a lot of CMS stuff, you'll be better off choosing the CMS that best suits your needs, and learn whatever language it uses. There's no point re-inventing the wheel.
Kotlin, which you mentioned in your question, is another strong contender. I haven't personally written anything in Kotlin. But it looks pretty awesome.
There are so many facets to this conversation that it's hard to even find one simple place to start. However, being a 20 year+ experienced web dev (perl -> php) I would feel remorse if I did not at least give a tidbit here. I have seen the entire gambit of good and bad code. Every time when it I think I have seen the worst... guess what? it's the third Tuesday of the month and BAM! We now get a new definition of ROCK BOTTOM! However, every piece of bad PHP code that I have seen was: a) made in the past b) fixed the problem of that moment So can you really say it's bad code? It did what it need to do at that place in time. Also if a project has been online and functioning for 7 years can you really say it's a piece of crap and refuse to work on it? Yes it should be remade with a newer vision, budget, tools, technology but for real it's been online for 7 years and got the job done. That's more than what you can say about any phone, automobile, laptop, etc... The php web dev sphere is filled with these "perfectionist" young kids who spend all day complaining about PHP. Everything to them should be done in GO, Python, or ... These people don't last long at any one job because they are never happy with what they have and never see the potential for what is possible. If they would spend 1/2 of the time finding joy in PHP that they spend complaining about PHP well...
Bad stuff is made by bad people, or by companies that don't focus on quality and focus only on time and money. The worst projects to work on are for companies that don't have a clue what they are really doing and hire contractors 3 months at a time to Band-Aid problems. But this is not a PHP problem this is a make money and shut up problem of the economic system.
After 22 years of doing this I can say that if you want to work with a good environment, with good code, with good tools, with positive experiences, then you need to look for and find a work environment that practices proper Agile and Socriocracy methodologies. Make sure that they have a scrum master, that they do real stand ups daily, retrospectives, refinements, sprints, adhere to a correct definition of ready, definition of done, etc... It makes a HUGE difference trust me.
When you are working in a quality first model and not a waterfall, support desk fix the problem model, you will find a real inner peace/zen to your daily work and coding. It will become a pleasure and you will stop going from emergency to emergency. Switching web dev languages will not fix the problem. Hanging out with better people will.
try { println( SigString ); } catch( Exception e ) { println( 'Who cares?' ); }
The most important concern should be how your target audience will respond to your web application - among other things how it depends on Javascript (is your service useable if the user turns off Javascript?), and the use of AJAX (I don't think many people like it if the whole page has to update when you change an option). Whichever language or set of languages you use should support a sensible design-pattern like MVC.
I would agree that PHP is probably a poor choice for web development (based on my probably outdated experience of the language). The way I remember it, you sort of write an HTML document with embedded PHP code, so unless you are very disciplined, you easily end up with a mess that is hard to maintain, especially if it has to be picked up by a new developer.
But I wouldn't go with .net - not simply because I'm anti-Microsoft, but because you end up tied to Windows, and Windows seems to be increasingly a niche-OS, that has had to move closer and closer to Linux as the de facto standard. What I would go for, personally, is Java Enterprise - I know it is controversial in many circles, but Java is in a way in a similar position as COBOL and FORTRAN: a lot of time and money has already been invested in it, and it is deeply embedded in many places, so I don't think it will go away. Plus, despite whatever critics have to say, it is a good language surrounded by a lot of useful tools and standards.
For when vicinity isn't enough, and vincinity doesn't cover it either... you need to break out the vincininity!
but I don't know why the worst programmers gravitate to php
I rose to a pretty high profile in the PHP/LAMP world. Every couple years I'd proclaim "Y'all suck" and stomp off to some other language... In the late 90s / early 00s it was Python, Zope. Couple years later, there I am writing PHP for a living again. "Y'all suck" and then I'm off to Ruby and RoR, couple years later there I am writing PHP again... "Y'all suck" and this last time I was off to Node.js.
This was when I reached a point where I chose the language to solve the problem, instead of choosing the language of preference, and then solving the problem with that language's approach.
Since then I've branched out to golang (my current fave) but reach for a mix of go/node/python based on the problem domain.
And I've seen **** code in all of them, especially java. I have no problem with the language, but absolutely detest what people do with it!
On another point, as "web applications" evolve into a more decoupled client/server design, what language we use on the server becomes less relevant to what's happening in the browser. RESTful services, microservices, if they are decoupled then you can scale where you need to, and not have to scale a single monolithic stack.
My last point is - who do you have on your team? And what happens to your code after you ship it? This may be a bigger factor than you'd think on the surface. I love me some go, but if I'm in a python shop shipping an app to a longtime python customer, maybe my shiny new toy isn't such a good choice - even if *I* think it would produce the most efficient result.
"The mind is a terrible thing to, um, uh, oh bollocks." -- Me
VB is total garbage, C# is hands down better in every regard. Starting VB vs C# maelstrom, in 3....2...1....GO!
I work with a guy who likes to say, "You can write FORTRAN in any language." Coders who lack the care/ability to structure code cleanly and keep it maintained will have absolutely no trouble porting the same bad habits to any programming language/framework/platform/IDE/etc. The problem isn't PHP. It's "PHP programmers."
I'll admit the problem is more prevalent in PHP and generally in languages that are easier to get started in. To get a webapp running in .Net, you've got some structural work you need to do. To get a PHP site up, you edit index.php in notepad & FTP it somewhere. There's something to be said for a little barrier to entry serving as a wall to keep the riffraff out...
Whatever environment you work in, you need to have the discipline to examine any open source apps or third-party dependencies you're considering using. Check out the source, make sure it's reasonably well structured. Check the revision history to make sure it's updated regularly & relatively recently. A lively users mailing list is a good sign. If the project looks like crap, you need to choose whether you use something else, write it on your own, join the project and attempt to fix it or fork it, or just make a shit sandwich and take a big bite... None of that changes if you move to a different language.
anybody that likes PHP now it's the time to speak up, before the eggheads turn it to a Java hybrid/Frankenstein. PHP was not designed to compete with Java, PHP became popular due to its simplicity, changing its DNA will make it irrelevant. justUseJavaForYourEnterpriseFactoryFactoriesFactory
Lo, in the beginning the web was without interactive websites and the firmament was constructed from HTML and CSS only with a sprinkling of Perl script. Then was formed Linux which begat Apache whose cousins were MySQL and PHP and became known as the venerable LAMP stack and it was good. Then along came millions of amateur web designers versed in HTML and CSS and they quickly went to Barnes & Noble and Walden Books and eventually Amazon to buy PHP books galore the thicker the better. But woe, woe to the coders who did not learn but the bare minimum of secret knowledge for they have polluted the Internet with evil. Giving in to sinful lusts, they crafted such abominations that make even TheDailyWTF blush.
Seriously, the garbage PHP code out there is a direct result of amateurs with limited skills turning out web applications much the same way a bunch of similar so called programmers turned out with VB & MS-Access. There is room for this all over and it's not just the PHP language. Without a proper educational foundation in proper software development there is a lot of bad code out there irregardless of language.
True, more modern languages such as C#, Swift, others try to prevent developers from doing dumb things along with quality web app frameworks have forced best practices through opinionated development. It is still important for developers to learn the correct way to do things. Just because it works and or compiles doesn't mean it's not incredibly sloppy and seriously flawed. You don't need a degree but you do need to take care to learn things before jumping in and creating an incredible mess.
All said and done, PHP can be done correctly or it can be done incorrectly. That is the same for most any language even with some protections it won't prevent you from doing ridiculous things like re-inventing a standard library function cause you think you can do it better. Each language has its strengths and weaknesses but the biggest flaw is the human behind the keyboard who arrogantly believes they are a rock star.
If you're good at php, python is the next logical step. You'll love it. It has a really nice IDE and it's awesome. You'll be wondering WTH have you been using PHP all this time when there's Python.
Long before you care about what language to use/work in (which you should take the time to select based on the job you're doing and the experience/skillset of the engineers you have available), you need to understand the people you will work with.
.NET (which I haven't used for almost a decade). That said, professionally, I'm doing a mix of Python, Go, and Java.
.NET).
.NET because it's the least portable of the bunch.
I love PHP, I'm using PHP 7.1 for personal projects and will soon migrate to PHP 7.3 (I could live without nullable return types for now) and I can write better code in there than anything I ever did in
The reality is, almost every language can be abused. You can write bad Java, bad Python, bad PHP, bad Ruby, and lots of other bad code (especially
You know what's hard to write bad code in? Go. Also hard? Rust. So if your goal is to write great, concise, clear, performant code then you should switch to Go or Rust.
But if you just need a quick website, maybe just internally, or informational, with few moving parts, I cannot recommend PHP enough. The MVC frameworks range from super simple to absurd. Python and Django are way more complicated. Ruby on Rails wants to be simple but fails miserably when it comes time to deploy unless you're using Heroku.
Also, don't use
If you look on weworkremotly.com and other places like that were top programming jobs are offered, you will find that a few companies are looking for PHP developers, but the pay is about 30% less. If you want to work at the top of the top, you should be working in rails, which still dominates in silicon valley despite a general decline in interest since 2012. Remember, GitHub is one big rails app.
I have been programming in .NET for 20 years (Basic, C#, but not web development) and am a big fan. Of course it is a strongly typed language - it has borrowed many features from Pascal.
Unfortunately, when I built my own website, I had to use PHP and JavaScript (bleah) - because they are FREE (no costs) whereas .Net ISN'T.
PHP and Javascript are wekaly typed, but there are ways you can make sure a variable is of a certain type. And PHP is an "old" style language, so it can be mastered quite well. Its main drawback is the absence of a debugger or IDE (unlike .NET) - which, I understand can be had if you use the Java IDE. But that in itself is another big burden, having to familiarize yourself with Java if you have never used it before.
There are bad programmers no matter where you go. It's a matter of degree.
The less "accessible" a language is, the less likely you're going to run into people (I refuse to call them programmers) who will vomit some crap into a text editor and think they're the Rembrandt of programming.
It's one of the reasons why I prefer strongly typed languages and always will. That, plus other aspects of languages that encourage strong typing, require a higher level of skill just to get off the ground.
Languages like PHP and Javascript are *too* easy, and gives people a false sense of competence when they manage to regurgitate some crap and it vaguely resembles what they were hoping for. The Dunning-Kruger principle applies strongly in this case. Just cause you manage to figure out how to make your code produce a certain result, in no way means you actually did it right, or securely.
If you need proof of this, just look at the skyrocketing incidents of security issues popping up in latest generation software. Look at how breathtakingly inefficient and bloated current software is. (The Facebook iOS app, plus their Messenger app, clock in at almost 1 freaking GIGAbyte).
Again, just cause you're using a more complex language doesn't necessarily mean you will be free of idiocy. For example, I was once looking at Java code and the bonehead iterated through a hashmap to find a desired value. But generally speaking, the incidence of such things is relatively less.
So fucking wrong. First of all the world is much bigger than PHP, Java and C# thank the programming gods for their infinite mercy.
Secondly, it is impossible to write good code in PHP. It gets in your way and stays there.
numbnuts
1. It is impossible to write good php code. Good php code is an oxymoron as shit weaves and touches every single part of this abomination.
2. It is the only language that if the person willingly uses it it marks them as a clueless idiot, forever. You can't wash the stink of PHP off you.
3. It is the only language where a total rewrite in something sane is always better path. In the case of PHP Brainfuck is more sane.
numbnuts