Type safety is like writing code which already has a bunch of tests for the types, or in other words, we do not need to write tests that the compiler can do for us.
As you have mentioned, it's horrible to feel as though you are going through the motions just to satisfy a higher level of automation. However, when working on large projects I think I've started to feel the itch in my brain saying "god this would have been perfect to start trying static typing". Let's face reality, we are clever folks being in development work. It's the engineering, mathematical and creative parts of your brain firing off constantly as you develop your code. It's the most fulfilling job anyone could do (in my opinion!), there's a great level of satisfaction from making things just "work". However, we are human and whilst the brain is a brilliant component we can only utilise a small percentage of that to keep track of everything we develop. It would be naive to believe that you can remember every facet of your code and ever use case that could run through your functions. For me, this is why static typing really offers benefit.
Automation is augmenting my skills, it is not blindly replacing gaps in my knowledge. I knew I needed to assign a variable or add a parameter when I was writing my function out, but can I be damned if I remember that fact 2 years later when building on top of my old application!
Wow, this makes my day! I love that it inspires you to try it out!
One of the things you have to get used to with Elm is the compiler. Most of the time, if it compiles, it will not crash. So, the compiler catches (and therefore complains) a lot, moreso than most other compiled languages. The compiler errors have to become less of a smack on the head and more of a TODO list. This makes refactors really nice. Change stuff, then fix all the items the compiler complains about, and you can be reasonably sure it all still works.
That's a great way to frame it. Viewing it as a TODO list makes it feel much more helpful than like something you have to fight.
A really well thought out post. My first language is C# so I'm used to static typing. If I ever need to do extensive JS work I'll be sure to check out some of the tools you mentioned!
Thanks for the encouragement! If you're used to C#, TS will feel fairly familiar to you. Microsoft definitely patterned the language pretty closely on C#.
In fact both languages were created by the same person, Anders Hejlsberg.
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.