10 ms·
Honestly php seems like the common cold... an annoyance that is everywhere and treated with little seriousness. However every evolution it gets better and stron
by mharroun 7y ago
Honestly php seems like the common cold... an annoyance that is everywhere and treated with little seriousness. However every evolution it gets better and stronger and adapts other learnings from other languages. It really shouldnt be treated as a joke any more.
Ps: I love php and jquery... not for any real saas systems but no other tool set allows me to spin up and prototype full web app prototypes in sub 90 min. As a senior tech manager php and Jquery allow me to show functional prototypes quickly and easily get buy in from other department stake holders.
- irrational 7y agoOne of the biggest complaints I've read about PHP is that many things are not consistently named (having never used PHP, I might be wrong). If this is true, are there any plans to fix this?
- duncan-donuts 7y agoIt is true and no I don’t think there’s much talk of changing it. There’s also a problem with inconsistent method arguments. Just look at array_map[1] and array_reduce[2]. This is just the one example that bit me the most, but there are other inconsistencies like this all over the language that require you to constantly look things up. [1] https://www.php.net/manual/en/function.array-map https://www.php.net/manual/en/function.array-map [2] https://www.php.net/manual/en/function.array-reduce https://www.php.net/manual/en/function.array-reduce
- nkozyra 7y agoI remember reading a cogent explanation for this inconsistency but can't seem to locate it. JavaScript suffers from inconsistent mutation/return of array values in array functions, too. PHPs design problems are mostly being swept away; it's the legacy that keeps its reputation down.
- aspratley 7y agoRasmus Lerdorf has talked about it in other videos but this is one https://youtu.be/iGOAQli7tGc?t=1485 https://youtu.be/iGOAQli7tGc?t=1485 Basically, groups of functions are consistent: string,array etc. Their parameter order was usually based on whatever the underlying C API was.
- cdirkx 7y agoI just encountered this last week. I had to explain to my fellow non-IT students why I was making loud gasps of confusion.
- Moru 7y agoI use an editor that has the php help built in to not get confusing errors. You type the beginning of the command and it directly tells you what part is the needle and what is the haystack.
- dana321 7y agoArray map takes one or more arrays with a callback, so the arrays have to be on the end. Array reduce has one array as a parameter, as does most of the other functions and they all have the array as the first parameter. Its only one function, and its an inconsistency for a reason. Lets not blow it all out of proportion.
- conradfr 7y agoIn practice it hasn't been a problem for me in a long time (I've been doing PHP since PHP3 so I have some perspective on it). First the documentation is fine and easily accessible, second your IDE will hint you the correct order and finally in a real world web framework situation you don't even use those functions that much anyway. My biggest complaint would in fact be the concurrency situation, it's still not easy and relies on external libraries that feel half-hacks. I guess Elixir spoiled me in that regard.
- tpetry 7y agoAnd when enabling strict types you will get an error anyway if you have the wrong order because the types will not match.
- akie 7y ago"My biggest complaint about this language I've never used is something I'm not sure is true. Is it?"
- irrational 7y agoWell, I have worked as a web developer for 20+ years. I've heard that PHP is inconsistent dozens, perhaps hundreds of times. I've just never verified it myself since I've never used PHP.
- haolez 7y agoMaybe the Hack language?
- monoideism 7y ago> As a senior tech manager php and Jquery allow me to show functional prototypes quickly and easily get buy in from other department stake holders I totally get it if you prefer to leverage your knowledge of jQuery, but modern JavaScript is just as quick to use. Eg, `fetch`, `querySelector`, and many more. Combined with modern css with flexbox and grid, and prototyping becomes very quick.
- kyriakos 7y agoI think the comparison is not between jquery and native Dom functions but between making something quickly with jquery compared to using angular or react for example
- monoideism 7y ago> I think the comparison is not between jquery and native Dom functions but between making something quickly with jquery compared to using angular or react for example Probably. I was just making the point that jQuery is no longer needed for most use cases. Lots of folks have no idea what the latest browsers are now capable of.
- mharroun 7y agoI'll admit as I moved into managmemt js has also improved. These prototypes are tossaways so it's just faster for me.to grab jquert. (Btw I love react and use it in any serious project... but each to definitely has its place)
- te_chris 7y agoModern JS is a total shit show of competing build tools, APIs that only work in certain ways in certain places, NIH reinventing the wheel. Thankfully there's some standardisation now, mostly due to the heft of Facebook, but it's still some much more work than it needs to be, espeically on the server compared to other web stacks like Elixir Phoenix, Rails, Flask, even Laravel (despite it's frustrating APIs).
- krsdcbl 7y agoIt never should have, the treatment php gets mostly feels like people finding it "not cool enough", seldomly I've seen someone have a real reason to avoid it
- Beldin 7y agoMy pet peeve: http://phpsadness.com/sad/47 http://phpsadness.com/sad/47 TLDR: checking passwords in php used to rely on using the correct comparison operator. Using the'==' operator would introduce subtle flaws. Using '===', you're fine.
- tudorw 7y agoThat's in the instructions.
- dvdkon 7y agoHaving to read those to see if a working program is fully correct is a failure on the language's part.
- jorams 7y agoDocumented insanity is still insanity. A very clear example that was luckily removed quite quickly: php_check_syntax.[1] > Check the PHP syntax of (and execute) the specified file This function's name and its documentation suggest completely different use-cases. In fact, it apparently does the one thing I wouldn't expect it to do based on the name. It's insane, and it cannot be excused just because the insanity is documented. The example given by GP is a lot more subtle, but this is not a good argument to make. [1]: https://www.php.net/manual/en/function.php-check-syntax.php https://www.php.net/manual/en/function.php-check-syntax.php
- tudorw 7y agoI accept that, but I still don't really understand the issue, which programming language can I pick where I don't need to read about what does what, I don't feel any language is intuitive per se?
- elric 7y agoPHP hasn't been a joke since PHP 4, when it pretty much supplanted Perl, which until then had been the dominant scripting language for the web. Its deceptive simplicity has been both its strongest and weakest point. On the one hand, it helped draw hordes of young developers into the field. On the other hand, it gave a lot of programming power to a bunch of people with very little programming experience, leading to the image of a buggy joke of a language. I don't think who has had a serious look at PHP would call it a joke these days.
- pjmlp 7y agoPHP 5 was what made me make peace with PHP.