Re:PHP solves problems. Oh, and you can program with it too
by Joeri on Saturday June 30, 2012 @02:12AM
(#4180881)
Javascript has weaker typing than PHP (in php you can have typed parameters for object parameters), but javascript is the new hotness and php gets no love. Typing is not the issue that makes php so ugly.
Also, i write php all day and i almost never run into bugs due to typing. You adopt some habits like always casting before use, and use an ide that warns you when you're doing stuff like using uninitialized variables (phpstorm is awesome), and the whole issue goes away for 95%. I'm not saying it doesn't cause bugs, just that i've found it to not be that big of a deal.
Re:PHP solves problems. Oh, and you can program with it too
by 10098 on Friday June 29, 2012 @06:50PM
(#4179542)
Ostensibly, by writing lots and lots and lots of unit tests.
In practice, however, no one has time to write or update unit tests. Which is bad, but understandable, because circumstances can be pressing. In that case, the only fix for weak typing is praying that nothing blows up :-)
Re:PHP solves problems. Oh, and you can program with it too
by Ralith on Friday June 29, 2012 @06:55PM
(#4179570)
While I appreciate that your post is mostly jest, it's worth noting that a "fix" that places an immense amount of additional load on the programmer is not worthy of the title (in part due to the consequences you describe). And even then, even the best unit tests rarely cover every case.
How do you fix weak typing?