Parse, Don't Validate (2019)
From the Twitter link:<p>&gt; IME, people in dynamic languages almost never program this way, though—they prefer to use validation and some form of shotgun parsing. My guess as to why? Writing that kind of code in dynamically-typed languages is often a lot more boilerplate than it is in statically-typed ones!<p>I feel that once you&#x27;ve got experience working in (usually functional) programming languages with strong static type checking, flakey dynamic code that relies on runtime checks and just being careful to avoid runtime errors makes your skin crawl, and you&#x27;ll intuitively gravitate towards designs that takes advantage of strong static type checks.<p>When all you know is dynamic languages, the design guidance you get from strong static type checking is lost so there&#x27;s more bad design paths you can go down. Patching up flakey code with ad-hoc runtime checks and debugging runtime errors becomes the norm because you just don&#x27;t know any better and the type system isn&#x27;t going to teach you.<p>More general advice would be &quot;prefer strong static type checking over runtime checks&quot; as it makes a lot of design and robustness problems go away.<p>Even if you can&#x27;t use e.g. Haskell or OCaml in your daily work, a few weeks or just of few days of trying to learn them will open your eyes and make you a better coder elsewhere. Map&#x2F;filter&#x2F;reduce, immutable data structures, non-nullable types etc. have been in other languages for over 30 years before these ideas became more mainstream best practices for example (I&#x27;m still waiting for pattern matching + algebraic data types).<p>It&#x27;s weird how long it&#x27;s taking for people to rediscover why strong static types were a good idea.