5 ms·
I'm curious how this changes if you remove PHP being used for WordPress (where the people using it probably didn't choose it). Do lots of companies still choose
by easton 5y ago
I'm curious how this changes if you remove PHP being used for WordPress (where the people using it probably didn't choose it). Do lots of companies still choose PHP for brand new projects? I know Facebook has a dialect they still use, but you don't hear much about it anymore.
- 0x0nyandesu 5y agoPHP is my bread and butter. Yes there are still shops that use it. It doesn't really deserve the bad rap.
- qsort 5y agoAs a Java dev I feel you. PHP, Java are both languages that used to be god-awful, but they have evolved massively in the past decade and most of the criticism is outdated.
- WesolyKubeczek 5y agoIt's bearable since version 7, and unless they make it another Java in version 8 which will make it unbearable again, it's gonna be ok. Kids who want to seem cool have moved on to Go and NodeJS, so PHP is mainly left with people who got some experience and mostly know what they are doing, save for those who really just twiddle Wordpress until it sort of appears to do what they want it to do. I suspect that PHP's ultimate fate is to become another Perl — a quite mature platform with very few people tending to it, obscure, with a community of very expensive veteran programmers.
- deweller 5y agoPHP 8 has been out since November. It adds some typing but everything is optional. PHP has always been a loosely typed language. Converting to a strongly typed language would against the grain of the entire culture and history of PHP. https://www.php.net/supported-versions.php https://www.php.net/supported-versions.php https://www.php.net/releases/8.0/en.php https://www.php.net/releases/8.0/en.php
- hparadiz 5y agoThe funny part is we still use Node for various sub tasks like webpack. Soon we'll be adding a unit testing layer to the JavaScript which will run in NodeJS as well. But I might wrap it with our PHP launcher. We'll see. The thing with PHP is it's very easy to understand in comparison with Perl. When Facebook did a study on which languages take the least amount of time to onboard new hires PHP won every time. It's also why they use their own version of PHP in house (Hack). It's 95% same thing with additional features like async built into their engine.
- godojo 5y agoThe bad rap was probably due to older versions. I used to program PHP in a professional setting (quite a while ago) and it basically interchangeable as any other system script (bash) executed by a parent http server process. The language itself at the time was mostly useful because you could execute a script made of HTML (or anything really) with some embedded magic tags interpreted as PHP instead of the opposite where you had to do some sort of template engine.
- acdha 5y agoOlder versions were worse but the current versions still have a lot of cultural baggage around the idea that ignoring errors is great and that's it's helpful to automagically convert data types. Changing that would break a huge amount of code and habit so the community is kind of slow-walking in that direction by deprecating features, adding opt-in config, and using linters to identify likely sources of problems. I don't disagree that it was useful — especially for having such a simple “upload a file, hit refresh” workflow — but popularity can work against you when it encourages optimizing for easy starts over long-term maintainability and a huge number of people learned dubious habits and aren't quick to switch.
- deleted 5y ago[deleted]
- giancarlostoro 5y agoYeah they do, PHP has a few frameworks like Laravel (inspired by Django iirc) that can be used to work on organized web projects. The nice thing is, you know you can host it online for pennies when you're all done. One of my web hosts has a $8 a year plan for example.
- wongarsu 5y agoAccording to the Stack Overflow Developer Survey it's the 11th most used technology, between C and C++ [1]. It's no Java or NodeJS, but it's still widely used. 1: https://insights.stackoverflow.com/survey/2021#technology https://insights.stackoverflow.com/survey/2021#technology
- chewmieser 5y agoTons of companies still use PHP even for new projects. Likely in part due to its market saturation - it's incredibly easy to find PHP developers. Only developers complain about PHP. And even that isn't really warranted anymore as PHP has grown leaps & bounds since most of the hate.
- Darmody 5y agoIt's incredibly hard to find good PHP developers. I just inherited a PHP project that it's a nightmare. It doesn't make any sense. It works on PHP 7.3 but the quality is worse than the old PHP 4 stuff. It is so easy to write good PHP code nowadays but most devs don't do it. They just go for the old ways, with spaghetti code, no clear architecture, etc, because it just works. They don't have to think, just type. Thats why people hate the language. They see the bad code and they think the language is poorly designed.
- hparadiz 5y agoThese days if you're not using PSR4 configured auto loading with all your code in the src or tests directory and a separate public folder then you're not really qualified to work on PHP at a professional level. I highly encourage using this template for all new projects https://github.com/thephpleague/skeleton https://github.com/thephpleague/skeleton
- Darmody 5y agoI just had my worst PHP dev experience in 5 years of coding. Literally. I just had to leave the office. I'm on my way home and still feel fatigued. The project not only doesn't use composer (well, it does now because I needed some components) but it has the same third party components duplicated or triplicated around the application. It looks like they downloaded them Everytime they needed them. Some of them are modified to make them work on newer versions of PHP. And the views and the logic are mixed together in big 4k lines files with no functions. Html, js, PHP, tens of SQL queries on loops, all mixed together. It's so bad it looks that it was made like this on purpose. The funny thing is a pretty important project for a pretty important and unique customer.
- minimaul 5y agoYep. My employer is a mix of PHP and JS. PHP 8 for our API, JS for the app that consumes it - sharing code both server-side and client-side. It works really well for us. Development on a modern version of PHP with a framework like Symfony or Laravel is so very different to development on old PHP5 versions. edit: PHP 7.x and 8 let you do things like: - no automatic type conversions - typed function parameters and return types - typed object properties - named parameters All of these are little niceties but they add up to making it fantastically easier to avoid stupid mistakes that used to be common with PHP.
- kreetx 5y agoI'd argue that the first three are not all that little ;)
- astura 5y agoYep, only companies that are seeking VC funds have to use "cool" technology to wow investors. OTOH many bootstrapped or legacy companies pick long established technology to build their products as they are only selling product implementation, not the idea of changing the world or whatnot. It might also be the client simply wants php. They don't want to pay to maintain anything extremely over-engineered.