3 ms·
the biggest point is that people are focussing too much on PHP own quirky edges but then are fine with other languages insanity (I'm looking at you javascript a
by thinkindie 7y ago
the biggest point is that people are focussing too much on PHP own quirky edges but then are fine with other languages insanity (I'm looking at you javascript and python). PHP is not perfect and I'm pretty sure it's bad name comes from code written for wordpress or joomla or the guy that came before you than PHP itself. Otherwise I can't understand how Python or Javascript can get away with way worse issues.
- uryga 7y agowhat python issues do you have in mind? the linguistic gotchas i can name off the top of my head are: - the way mutable default arguments are handled - the weird behavior of closures referencing loop variables - leaking variables out of if/for/with (yes, i know it's convenient, but can bite sometimes) - GIL stuff - exec not being able to introduce new local variables (yes, i know code-objects have their local variables decided at compile time, but it's surprising if you don't care about that implementation detail) other than that i can't think of many "insane" behaviors that can bite you. i'm curious what you're referring to! and sure, i'd change a lot of the language to make it more FP-friendly if i could, but being what it is, the semantics seem pretty unsurprising most of the time
- rvnx 7y agoIsn't the base indentation style of Python insane ? I remove a "if:" block and and have to press backspace, maybe 100 times ? If I add one "if:" then have to press 100 times on space ? Yes, nice you can have Python-adapted editors where ident levels can be tuned, but no, it's still a big defect
- eru 7y agoNo, the indentation is a feature. Your editor can help you with the editing. (And the problem you mention are exactly the same, if you write production code in other language. Your teammates will hopefully insist on consistent indentation in C or Java as well.)
- uryga 7y agoit's never really been a problem for me, i just select the block and tab or shift+tab it as needed. honestly i'd be doing the same in C or whatever braces-based language