Live data from Hacker News

PHP in 2019

stitcher.io

251–260 of 489 posts

Re: PHP in 2019

#251

The thing that matters is language consistency... A language with a pure clean vision of itself in which the programmer can guess at syntax because they understand the general syntax principles to which the language adheres. Nothing here says PHP has been fixed in this regard. Python made the big leap and fixed some huge problems when it went to python 3 - yes it's migration approach was a total fail, but it further…

> Python made the big leap and fixed some huge problems when it went to python 3 - yes it's migration approach was a total fail, but it further cleaned up what was and already clean and consistent language. People keep saying it was a huge failure, but honestly, I don't see how it was supposed to be done better otherwise. Either you make breaking changes that will impact your entire ecosystem or you don't and live wi…

In retrospect, for me many of the problems would have been fixed it they'd wrapped everything in one release, like gcc with the -std flag.

Then once someone had (say) python 2. 6 I'd know they also have python 3.2, and I wouldn't have to figure out that name of the executable to call, it would just be python, with (perhaps) either a command line option or a comment at the top of the file.

Re: PHP in 2019

#252
post #97

Earlier quoted context omitted.

No, it's not. PHP has disabled or removed the major anti-features like magic quotes, globals, URL includes and the bad mysql extension. It has a proper AST-compatible parser which removed tons of quirks, and added syntax sugar to look more normal to outsiders. The remaining things are: • the endless whine about inconsistent underscores in function names and haystack/needle. These are a bad look, but aren't really an…

> (PHP devs memorize the common functions.. Nope (c) Me, after 5 years on trying to but still falling back to googling every 20 minutes despite years and years of using the language. ... And just writing code without looking into docs much after a week with ruby

I didn't use PHP for 2 years and upon coming back still know most of the common functions and the ones I don't the IDE helps with, so I am not sure why you're having such issue. What functions are you using that you don't remember the names for?

Re: PHP in 2019

#253

Earlier quoted context omitted.

funny, because it's what React.js allows to do nowadays

The difference is React actually handles escaping properly. It won't just dump out raw HTML by default, so you won't have an XSS issue. PHP, on the other hand, requires manual escaping with htmlentities() ... It is very, very error prone.

You are comparing a framework to a language though. Escaping in PHP is usually handled by the templating component, you don't go around writing htmlentities() everywhere.

Re: PHP in 2019

#254

I've been using PHP semi-regularly since the late 90s. It's been empowering and infuriating. The ecosystem is radically better than it used to be. Composer and the Packagist registry are as mature and dependable as npm, PyPI or RubyGems. (despite hours lost to my own namespace screwups). I'm also happy to see the Prettier-PHP project automating and enforcing code-style standards. For whatever reason, I often feel clu…

Infuriating? I'm not here to defend php but even when I do agree that inconsistencies are not nice, nothing stop you of creating your own wrapper for these functions.

Infuriating? really?

Re: PHP in 2019

#255

Earlier quoted context omitted.

What's wrong with Laravel or Symfony?

I don't know if there's anything inherently wrong with them. I'm just saying that I don't see any job listings for them as an interviewee, or see any resumes with them as an interviewer. In contrast to other technologies that HN or Reddit declare to be "dead" or "dying", yet actually seem to run the world with no serious disruption on the horizon yet.

Are you in the US? There are TONS of PHP jobs here in the UK (possibly second to JavaScript, although there are a lot of Java jobs too), and I hear that in general PHP is very popular in Europe, whereas Ruby is more popular in the US (some people use ruby here, but not many).

Laravel is not only fine, but one of the best frameworks I've ever used. It's like rails/django, but less opinionated in all the right ways (while still providing loads out of the box). I think PHP has a very bright future.

Re: PHP in 2019

#256
post #6

One of the main takeaways I got from the original Fractal of Bad Design post was the myriad of inconsistencies in both representation and execution of code. This was barely touched upon, mostly this post focused on how PHP has added features and ecosystem. But then so has Javascript.

Unfortunately this is true and it can't be changed, the functions are named and parameters are soemtimes inconsistent like strpos and str_replace, I would have to use the docs all the time if my IDE wouldn't show me the param names. But after you get productive with PHP there is no feature that I think I am missing from other similar languages.

Named parameters would be nice.

Re: PHP in 2019

#257

I think the easiest thing to forget is what made PHP popular was how easy it was to get started writing software that worked good enough. The barrier to entry was incredibly low. It caused a lot of bad code & gave PHP a bad reputation but a lot of good was also made from it. PHP made a lot of careers for developers as they were able to fake it until they made it while learning how to code & providing significant valu…

The thing that I like about PHP is that I can mix HTML, code, and database queries into a single file.

This is incredibly useful when learning basic web development, even though it doesn't scale for more complicated applications.

It's also incredibly useful when trying to bang out a simple experiment.

Re: PHP in 2019

#258
post #153
post #51

As far as I'm concerned the bridges have burned a long time ago and I definitely can't see myself giving PHP a second chance. That being said, if I'm wrong and PHP has really managed to become a decent language (or at least something that's not completely insane) its defenders should focus on actually showing what modern PHP code looks like. Is performance that much of a big deal for most people? In a world where Rub…

I was pretty anti-PHP before I worked for a multi-billion dollar company that was built on top of it. It's not a beautiful language, but it offers a lot of side benefits in terms of dev-ops, and tooling, and frameworks. As a company, the language was not something that held us back. The company moved really fast, and PHP was a large part a big part of why. In my career over the past 14 years I've done web work using…

Most of this would apply to Perl, as well. Which I can't fathom why Perl didn't easily beat out Python in the data science world. It's incredibly stable (version 5, that is), fast, and can just about rip apart and parse any raw data you have with ease. Python may "feel" newer, but there are only a few years age difference. Even Ruby isn't that much newer.

Tragically, Perl developed its "unreadable" reputation because it was the language du jour of the system admin/hacking world. The first time most people experienced Perl was by finding some crufty old script that glued a bunch of shell tools together haphazardly. Few developers today have actually seen what good, production Perl can look like.

No disrespect to the wonderful system admins of years past, but those guys were a different breed. They weren't programmers. But Perl still let them get their job done. Their unmaintainable messes caused a great deal of harm to Perl.

Re: PHP in 2019

#260
post #81

Earlier quoted context omitted.

Yeah, I've been burned too badly by PHP. There are languages I haven't done in years that I would go back to if there was a compelling need to. PHP is not that language. Far to many sleepless late nights trying to clean up some security hole. PHP is like that abusive Ex that everyone says has changed. It may be true, in which case, good for PHP But I won't be putting myself in that position again.

You can be burned by every program language if you dont know the in and outs. It all boils down to, pick the right language for the job and more important, know the language you choose.

Saying that all programming languages are equally good is about as true as saying that all sorting algorithms are equally fast.
Post reply on HN