4 ms·
This reminds me of that old joke: "Doctor, doctor, every time I lift my arm it hurts! What should I do?" Doctor: "Don't lift your arm." Instead: "Every tim
by edw519 17y ago
This reminds me of that old joke:
"Doctor, doctor, every time I lift my arm it hurts! What should I do?"
Doctor: "Don't lift your arm."
Instead:
"Every time I get lazy and expect Language <x> to catch my problems, it doesn't respond the way I think it should. What should I do?"
Don't be so lazy. Code it right in the first place.
- jrockway 17y agoPeople make mistakes. Computers don't. So people program computers to catch their mistakes, before those mistakes become problems like "crashing" or "losing money". If you give the compiler invalid input, a subtly-broken program should not be the output. The output should be an error pointing you to your mistake.
- potatolicious 17y agoTrue, but in this case PHP corrected its error (it now returns null for this use case, as it should)... this is why you don't rely on undocumented behaviour as canonical. If it says it should return null, but returns zero instead, check this result always.
- jimbokun 17y ago"Code it right in the first place." Isn't this advice better applied to the developers of PHP, in this case?
- nir 17y agoThe developers of PHP created the most popular language on the web. They built a language that is not only preferred by people with no programming background, but also powers some of the most influential and popular websites (eg, Wikipedia, Facebook). They did all this with zero-or-negative hype around them and while competing in a space that some of the richest companies in the world (Microsoft, Sun, IBM) have poured massive resources into. So, yeah, they did screw up here and there. But very few projects were remotely as successful as theirs.
- smharris65 17y agoJavaScript is the most popular language on the "web".