Re:PHP in 2019
by out_of_protocol on Wednesday May 15, 2019 @08:34AM
(#19918749)
> (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'm quite shocked that a common complaint of any language is function syntax. Maybe it's been awhile since I've used PHP, but is it really worse than any other language? The problem with PHP is that, at least years ago, it had no equivalent of C's man pages. In C, you're constantly doing "man memchr" or what have you. Perl has "perldoc -f sort".
Don't get me started on Ruby, though. Wading through a tower of classes to figure out where and how some method is defined, only to much later find out it was actually created by define_method or method_missing is absolute torture. And yeah, I know the REPL can provide this info to you. The point is: source code should be obvious in how it functions. Not obscure things through cleverness.
What are you talking about? I have been using php.net/{funcname} since forever.
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
by out_of_protocol on Wednesday May 15, 2019 @12:39PM
(#19921160)
Ruby does not have the best standard library, just good enough. replying to the question - basically all of them, from strrpos, str_ireplace to array_search. Also, Null, false, 0, "" etc are adding degree of chaos
An auto-completing editor is a big help when using PHP. :)
Switching to a whole nother editor to use php might be annoying to some people
Well really programmers shouldn't be using notepad.exe to write code in any language.
Re:PHP in 2019
by colshrapnel on Wednesday May 15, 2019 @09:24AM
(#19919125)
And on its quest towards JIT the language becomes less and less dynamically typed. strict_types=1 is already a standard in most major applications and all the cleanup that has been done already, such as count() raises an error if you try to count a non-countable variable, and many more.
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 obstacle to using the language (PHP devs memorize the common functions, rely on IDE or docs for the rest, and move on).
• being offended about use of backslash as the namespace separator. It really doesn't matter at all.
• old constructs and edge cases that exist, but are not used in new code.
• general upset about dynamically-typed languages, and all the consequences and compromises that dynamic typing brings.
That post is just a rant. It presents insignificant/arbitrary choices as flaws (e.g. "clone is an operator?!" — so what?). Some complaints are totally ridiculous, e.g. exceptions thrown in destructors were fatal errors, and that was bad. When the restriction has been removed, the post has been updated to complain that this is bad too, because now you can throw literally everywhere! Apparently, no matter what PHP does, it's bad.