3 ms·
This is the important bit > Once you're aware of the gotchas (and keep your head stuffed with this useless info the whole time you are working with PHP) its no
by imakesnowflakes 11y ago
This is the important bit
> Once you're aware of the gotchas (and keep your head stuffed with this useless info the whole time you are working with PHP) its not as bad as everyone makes it out to be..
First, you need to be aware of the gotchas. But this is not possible because,
1. We are still counting (take a look at /r/lolphp).
2. Even experienced (8+ years) php programmers know a very small percentage of the php gotchas.
See this http://www.reddit.com/r/PHP/comments/2zhg6z/how_true_is_this_php_bashing/cpjhx04 http://www.reddit.com/r/PHP/comments/2zhg6z/how_true_is_this.... You can see one commenter. who is an experienced php programmer who was not aware of that at the time. I myself had 8 years of experience when I was bitten by this bug..ahem..feature. So unless you haven't gone through all of /r/lolphp and commited the relavent ones to your memory and check them for every single line of code you write, you are bound to be bitten by one of those.
3. And documentation does not help. Even php core develpers agree that some of the important parts of documentation is incorrect but NO ONE CARES about things like that. Every one is out to implement flashy new stuff that fanboy can brag about. Even the existing documentation is does not go much deep into details. eg this is the php.net page regarding exception handling
http://php.net/manual/en/language.exceptions.php http://php.net/manual/en/language.exceptions.php
compare this to Pythons documentation
https://docs.python.org/3/tutorial/errors.html https://docs.python.org/3/tutorial/errors.html
https://docs.python.org/3/reference/compound_stmts.html#try https://docs.python.org/3/reference/compound_stmts.html#try
If you want to find how a return statement behaves inside of a finally block, the info simple isn't present in the php's documentation. Because "who cares because we copy stuff from java, so we probably does not not what is important to document anyway."..
I mean, it is very subtle and the recent 'facelift' that php received makes it hard to see its truly shitty nature for newcomers. When they look, they see all the shinny new features (often half assed) and think that php is on the same level as Python or whatever....