14 ms·
I don't really understand why in 2020 there's still this kind of blind hatred against this language. It often comes from horrible bad memories from previous ver
by TheHemric 6y ago
I don't really understand why in 2020 there's still this kind of blind hatred against this language. It often comes from horrible bad memories from previous versions or old frameworks.
Objectively, compared to other languages i've been working with it is more than OK. Despite it's lack of "style" it is easy to understand, host, tests, diagnose and it is powerfull for web applications.
I've been working on a SaaS API with Symfony now for 2 years, our metrics are good...
It is a good tool, it builds good softwares
It's essentially sinking in popularity because of bad faith and lack of hype, really sad !
- codegeek 6y agoThe funny part is that all the hate they have towards PHP, pretty much most languages have similar or other problems. I say this as someone who loves languages like Go, Python but I run a SAAS business in PHP which brings in close to 7 figures ARR and employs 15+ people. All these developers shitting on PHP are basically the elitist form of "I don't do PHP so you shouldn't either because it sucks and <my shiny language> is so much better".
- giantDinosaur 6y agoI know people who run decently sized and successful businesses in a variety of mind-numbing technology (try FileMaker scripting or shell scripting) but that definitely doesn't mean those things don't often suck and that there aren't advances in PL's that don't or won't lead to better software. (I personally don't use PHP at all because I haven't yet seen a reason to use it for any new projects over Python or TS. Is that new match expression proper pattern matching? ;)) It's pretty hard to draw a link between these things and commercial success, but it somewhat unseriously reminds me of Jonathan Blow's warnings that eventually everything is just going to fall apart.
- codegeek 6y agoYes I am not necessarily disagreeing. I am saying that people who shit on PHP think that other languages are somehow this magic wand that is so much better. I challenge the "so much better" part because the cost vs benefit matters.
- dgb23 6y agoThis is because you‘ve built up expertise and know the ins and outs of the language and frameworks (which are often very complex and idiosyncratic to achieve their cleanliness and expressivity). You know what to use, how to use it, what to avoid, how to debug stuff etc. However for people who have not invested this time and effort it is an objectively worse language than other web focused ones in many dimensions. PHP is a workhorse for the web and still the most important language next to JS in that regard. But there is a reason it is declining (slowly) as well.
- danmur 6y agoI think that's it. No argument that it's improved, so much, but if you're not already using it then it's hard to pick it over other options. Good luck to the fans though, you can do anything you need with it and if you enjoy it all the better.
- Aeolun 6y agoThe fact that it is worse doesn’t make it bad. I’d take Typescript over PHP any day, but not Javascript.
- ragnese 6y ago> The fact that it is worse doesn’t make it bad. That's correct. It turns out that it's also bad, though. People don't like to hear it because I'm "just a hater", and maybe one or two of these issues isn't a deal breaker. And yes, you can write real, useful, applications in PHP, but it's a terribly awkward language with a lot of missing features and sloppy dynamic typing nonsense. * No (real) async or threads (pthreads never worked on backend and is deprecated anyway for those who always mention it in response to me) * No generics * Interfaces must be complied to at class definition (leading to verbose nonsense like the "adapter pattern") * No const or immutability * `array` is a shitty hybrid of an actual array and a dictionary and it sucks at both * No other native data structures beside the shitty `array` mentioned above * No ability to typehint callable function params * switch statements use loose equality checks, so you should avoid them * foreach is broken and leaves a dangling reference * `array` keys are automatically cast to int if they can be, which is broken and insane. (E.g., if I use `array` as a dictionary and one of the keys is the string "123", it will NOT store the entry as key-value pair: "123" -> $data. It will instead store $data in the 123rd slot of the "array". Iterating this `array` with an index will end in a bad way). But surely someone will drive by and say that none of these things matter and that an experience PHP dev would never be bothered by any of these things, etc, etc. "You can write bad code in any language." But... you can always just choose a better language if you have the choice. I feel like people get Stockholm syndrome over their tech choices. It all sucks, but some suck worse than others. Don't tie your identity to shitty stuff like programming languages: "I'm a PHP dev." "I'm a Rust dev." Give me a break.
- systemvoltage 6y agoMore than anything, I find the language $ugly. Is that fair? No. Am I being unreasonable. Yes. Do I love PHP? Gross. I just have to live with it and go past the ugly syntax. It’s like an unhappy marriage. It’s just fine.
- codegeek 6y agoBut that's just like your opinion man (quoting the Big Lebowski). I like seeing the $ sign. Does that mean I am not a good developer ?
- minot 6y agoI think PHP is a fine language if you are working on an existing application or are building on top of symfony but I’ll begin second guessing all your design decisions if you increase the default execution time of php from thirty seconds to over five minutes. I submit PHP does not belong anywhere outside the request response cycle. If you use it for other stuff, you are not wrong. I mean I’ve used puppeteer and node js to capture screenshots and I still think that ideally JavaScript should only exist in client-side web browser based development. I would never voluntarily do any of the react native or express/hapi server side development with JavaScript. I will do it if there is money involved, it just isn’t my preference. It is ok to have a preference to do non web work with PHP but you owe it to yourself to at least try something else before saying you prefer it over everything else. There is nothing wrong with $ though. That’s just insane. Also I’m very excited to see Drupal 9 being released with twig 2 support and more recent symfony support. I just think you should at least evaluate other options before saying “everything goes better with php sauce” just like the JavaScript crowd should stop and get some help before using JavaScript for native development and or server side development.
- danlugo92 6y ago> Does that mean I am not a good developer ? He never implied anything remotely similar.
- akudha 6y agoMaybe think of money everytime you see the $ symbol, to make it more palatable? :P On a serious note, I find the JS ecosystem more annoying than PHP. Modern frameworks like Laravel (Laravel is nice to work with), PHP is more than enough for its intended use - web applications. PHP 7 has good performance improvements too.
- dcabrejas 6y agoI haven't found any good arguments against PHP in the comments here, just pure hate. Let's name a few of the arguments people are making: 1. Its variables start with $ and that is ugly: I mean, come on, I won't even entertain this bigotry. 2. It used to be better before: This is just pure nonesense, before OOP PHP wasn't good to create any big and well-structured application, it is ironic because most of the bad opinions about PHP come from people who used it a long time ago. Besides, you can still use PHP as you used to, but now you have more tools at your dispossal, You are free to use it as before. 3. It is trying to be Java: Well, sure it is more like Java, only less verbose and easier to write. Developers can be much more productive in PHP. And moving in the direction of Java is not a bad thing as the language moved into the Enterprise space. I worked with Magento every day and I am glad the language is more than Java than it used to be, it means we can organise our code better. Again, ironic that some people who mentioned this as something bad about PHP, then went on to say they prefer Java. 4. Composer has made the language worse: Honestly this is so ridiculous... so now having package managers is a bad thing? I haven't met an actual professional PHP programmer who holds that opinion. All of them like composer, it makes reusing code and creating apps in PHP much easier.
- spockz 6y agoThe latest version of PHP that I used was 5.3. The power, and disadvantage, was that it was basically a scripting language which allowed for quick prototyping and easily making some of a site dynamic and allowing for templating. For the more serious/involved/enterprise applications, a lot of workarounds were needed to cache database connections etc. Lots has improved: ide support, jit, package manager. In doing so it became more mature now joining the realm of more serious, enterprise, languages which had all of this for ages. As such it is also being compared against those languages. At the same time templating is now easier and more cheaply done through static site generators. So imho PHP falls a bit in the middle and it is only kept afloat because of the likes of Magento, Wordpress, and other big products built on top of PHP that thrive by being modifiable by practically any developer.
- jhgb 6y ago> 1. Its variables start with $ and that is ugly: At the very least it seems nonsensical and cargo-cultish: As a non PHP-er, what is the actual purpose of $? In Perl, it indicates variable context (for better or worse, there's more than one, so it has to be indicated somehow). In shell, it indicates the substitution of variable name by its value. In PHP...I draw a blank. It really seems like an "I wanted my language to look like some other language but I had no idea what it should be doing" kind of thing.
- Shish2k 6y agoPeople keep saying “PHP in ${current_year} is actually great, it only sucked in ${current_year-5}!” - I feel like it still sucks[1] today, but it’ll take 5 more years for the fans to realise it, when they have the PHP from ${current_year+5} to compare against :P [1] Being slightly hyperbolic - I won’t deny that you can do good things with PHP, as you can do good things with any tool; and AFAIK it’s still unmatched when it comes to low barrier of entry and shallow learning curve. (I’m coming from the perspective of someone who mostly uses rust, python, and PHP7.3, with odd bits of Hack - in the past week, PHP7.3 has frustrated me with lack of typed arrays, lack of typed properties [fixed in 7.4! Only took 5 years between the introduction of type declarations and consistent support for type declarations...], and dictionary keys being automatically cast from string to int if they look vaguely numeric. It’s a shame Hack never took off in the open source world, as it’s basically “What if we could reimagine PHP without the legacy baggage?”)
- jrumbut 6y agoThe key to becoming a person who thinks PHP is great now is to primarily use features that have existed for more than 5 years. For me, PHP 7 was PHP 5 that was faster and had some nice little bits of new syntax. They started down the type system road but I avoided it then. Now it seems like the basic type system is in place, great. This new stuff in the article I'll probably start using it when 8.4 drops. 5 years is an exaggeration, but staying a version or two behind really helps you stay sane. By the way I found Hack/HHVM thoroughly disappointing. Tried running some fairly complex apps on it and it felt like they reimagined the legacy baggage. Seems like PHP itself borrowed a lot of ideas from it though.
- kenniskrag 6y agosame for c++
- slightwinder 6y ago> I don't really understand why in 2020 there's still this kind of blind hatred against this language. Well, the language is burned for a whole generation of devs, and it's hard to lose the nasty stench once it has settled. A major reason might be that you don't touch again what you learned to dislike. Because you known anyway that it will be painful, why go for it? > It often comes from horrible bad memories from previous versions or old frameworks. Those old versions and frameworks are still around. Companies don't lose their legacy fast. > Objectively, compared to other languages i've been working with it is more than OK. Despite it's lack of "style" it is easy to understand, host, tests, diagnose and it is powerfull for web applications. That always was the case with PHP. Doesn't say whether it has lost it's old flaws. > It's essentially sinking in popularity because of bad faith and lack of hype, really sad ! Is more losing because of competition. PHP still is mainly a web-stack backend-language that can't offer much in other areas. But now there are other languages who can equally shine on backend, while also shine on other areas. So obvisouly people go for the language which can give them more, instead of less.
- oweiler 6y ago> It often comes from horrible bad memories from previous versions or old frameworks. Not only that. There is a huge amount of devs hating PHP w/o ever having worked with it. Same with Perl.
- blunte 6y agoAnd I imagine most people would prefer indoor plumbing instead of an outdoor toilet, even if they haven't used an outdoor toilet before. I also prefer beef steak to catfood, but I admit I have not actually tried cat food...
- tambourine_man 6y agoI think it’s popularity has been soaring lately, actually. It looked like a dead language in the 5.X days, then there was a resurgence with 7.
- blunte 6y agoBecause those of us who know and have used several languages tend to develop a preference for expressiveness, terseness, safety, and dare I say, elegance. PHP (and JavaScript) gained and maintain their relevance, despite being inferior languages, because of their historical placement. I'm sure COBOL has improved over the years, and we know it is still used and "needed"... because of its historical placement. But you probably wouldn't use it, either, unless you had to (or you didn't know a better alternative).
- moksly 6y agoThere is a discrepancy between what’s hip, and what’s actually used. On places like HN where everyone is in love with Ruby... errr... Go.... errrr I mean, Rust, you’d think that those languages are the what’s what. Then when you look at the job market, you get a very different picture of what actually gets used. In my country there hasn’t been a single job posting for all Rust in all of 2020. There’s been a single mention of Go as a “nice to know” PHD job at Google Denmark and there is just a single company who has had openings for Ruby. Hell even with everyone’s favourite Python, almost every job involving it is in DataScience and needs you to be a mathematician first, analyst of some kind second and a programmer third. There are a few django jobs, and good for those guys, but in general, even python doesn’t see that much general usage. The vast overwhelming amount of jobs that’s been listed in 2020 in Denmark have been for C#, PHP and JavaScript, with JAVA still hanging in there somewhat, though typically bundled with whatever they call JBOSS these days. So unless you’re smack in the centre of Silicon Valley, I probably wouldn’t worry too much about the hate PHP gets.
- przemo_li 6y agoThat's quite strange. Rust is system level language. Most web stuff need no memory management and can happily live with GC or even with giant memory footprint and reboot once a day. Ruby is direct competition. One of two PHP major web frameworks borrowed everything they could from it. Even PHP is on Ruby bandwagon .... XD
- Implicated 6y ago> One of two PHP major web frameworks borrowed everything they could from it. Weird flex. So you're saying that an aged veteran in any sport who observes and learns from his younger peers should be looked down upon as being on their bandwagon? Their growth, improvement and continued success should be discounted? > Even PHP is on _Rails'_ bandwagon .... XD I fixed that for you.
- inoop 6y ago> I don't really understand why in 2020 there's still this kind of blind hatred against this language. I don't either, but what I also don't understand is why in 2020 anyone would use PHP over many available vastly superior alternatives. Other than keeping old stuff running, why do people keep beating this dead horse? I just don't get it.
- ragnese 6y agoSame here. Sure, PHP in 2020 is a mostly passable language. But then next to it you have Java/Kotlin/Scala, Go, Clojure, Node w/ TypeScript, even Elixir is pretty awesome. Though, to be honest, I'd probably use PHP over Node even with TypeScript because the Node ecosystem is such garbage. You just have to really like Laravel, I guess, to choose PHP in 2020. Which is totally fair. I haven't used Laravel, but people do rave about it.
- singemonkey 6y agoPerhaps some developers who already know PHP want to get on with building things instead spending time comparing language penis lengths?
- robryan 6y agoProbably the package/ framework ecosystem. There is also a self reinforcing quality, there are a lot of devs which in turn encourage people to do projects in PHP to access those devs.
- paul_f 6y agoIt depends on your goal. I personally think PHP still wins for a solo developers in speed of feature creation. Think of the ratio of business value per development cost. Someone should find a way to objectively measure this. Then there's this, choose boring technology: https://news.ycombinator.com/item?id=23444594 https://news.ycombinator.com/item?id=23444594
- erik_seaberg 6y ago"foo" == TRUE "foo" == 0 TRUE != 0 NULL == 0 NULL < -1 0 > -1 You have to test the simplest expressions because you can't trust the language to do what you wrote.
- francislavoie 6y agoThat's why `===` is a thing. But FYI, "foo" == 0 is no longer true in PHP 8: https://3v4l.org/fQLXX https://3v4l.org/fQLXX RFC is here: https://wiki.php.net/rfc/string_to_number_comparison https://wiki.php.net/rfc/string_to_number_comparison
- deleted 6y ago[deleted]
- stunt 6y agoYou can find bad code in any popular language. Therefore, any popular language will get bad rap. Java, C++, PHP... Bad developers will write bad code in any language, and they will blame the language for it. Scala is one of my favorites and yet I saw some really horrible projects. They made such a mess since lots of Java developers rushed into it. People blame Go for lack of a some features like generics just because they are unable to write clean code.