4 ms·
I started my career as a php dev 15 years ago, and yes, there was plenty of wrong with php. Messy Api, terrible default, wonky typing, no namespace, etc. It su
by BiteCode_dev 7y ago
I started my career as a php dev 15 years ago, and yes, there was plenty of wrong with php. Messy Api, terrible default, wonky typing, no namespace, etc.
It succeeded, as it's often the case in IT, not because it was the best, or even very good, but because it was easy to adopt and had a killer feature.
- lucideer 7y ago> there was plenty of wrong with php. Messy Api, terrible default, wonky typing, no namespace, etc. "Messy Api" is discussed above ("it came down to people complaining about some function names / param orders as if it were the end of the world") so I won't comment. "terrible default": would be interested in specifics here "wonky typing": every scripting language had wonky typing 15 years ago, and many of them still do today. This has never been a valid criticism of PHP when comparing to it's primary competitors. "no namespace": THIS is a very valid criticism. PHP really wasn't a sane language before they added namespaces. But... they added namespaces 11 years ago.
- imron 7y ago> would be interested in specifics here Magic quotes would be the first one I can think of off the top of my head, which incidentally, was made a default because the mysql api in PHP was so prone to sql injections, that PHP decided to automatically escape all user input as a way to protect inexperienced programmers. Pretty much everyone agrees magic quotes were a bad idea and they were eventually deprecated in 5.3 and removed entirely in 5.4.
- hrktb 7y ago"Messy Api" isn't just parameters. For instance "Fatal" errors and regular errors going to two different logs was very messy and would byte you if you didn't pay special attention to it. Or multi-byte compliant methods that are a variants, and not the standard method, thus biting anyone who just thought utf-8 would be default. "terrible default": the poster child for this is register globals, which it took ages to have off by defaults. That's just a single line to set it properly, but that was part of the boilerplate that could have been avoided way earlier. Overall developing for PHP meant to defensively remember a ton a weird stuff, just like javascript was for a while. I am so glad we mostly got past that, even if I am not in PHP anymore.
- lucideer 7y agoFatal errors is fair enough; though I only ever experienced this with parse errors, PHP being stateless did make this less likely to be caught until well into runtime, so it could be an issue. String encoding though is, again, something other languages had similar gotchas with. Remember we're comparing PHP to its popular alternatives at the time, not to our hypthetical ideal runtime. The bad defaults you and a sibling commenter are referring to (magic quotes) are, again, from 11 years ago. Sure, 15 years ago PHP had serious issues, but here we are today acting as if they didn't fix most of them over a decade ago.
- catach 7y ago> but here we are today acting as if they didn't fix most of them over a decade ago. Recall that the defense of PHP in this tree leads with "There was never anything wrong with PHP, really."
- imron 7y ago> The bad defaults you and a sibling commenter are referring to (magic quotes) are, again, from 11 years ago. That's because the context was the state of PHP 15 years ago.