Re:PHP Sadness
by alphadevx on Thursday November 29, 2018 @10:20AM
(#18560799)
It only appears to be "insane" if you are not used to working with dynamically-typed languages. PHP has been dynamically-typed from the very beginning, so you need to program defensively and check type at runtime (no assumptions are safe).
[ Parent
| on HN ]
Re:PHP Sadness
by IgorPartola on Thursday November 29, 2018 @10:21AM
(#18560815)
These days I do 99% of my work in Python3 and JS/ES6. PHP is still the most insane version of this, though JS isn't far behind.
Make the jump to including TypeScript in your toolchain, even if you don't ever intend to write any TypeScript.
The type checking it does on regular javascipt is still beneficial in catching and preventing a lot of coercion mistakes or attempting to accessing things that are potentially undefined.