Many developers in the javascript community today lean towards type inference, citing readability as a key factor. However, readability is not just about fewer letters. Consider the difference between:
I hp I mk m slf clr
vs I hope I make myself clear
It's important to be open-minded and explore both approaches before forming a solid opinion. Stay flexible and don't let your views hinder progress.
Keep in mind that
opinion is what I have when I haven't done enough research
If you fully understand the implications of different choices, you won't need an opinion - you'll simply choose the best option. This approach lets logic guide your code, rather than personal preference. It's wise to support decisions made by your team in most cases.
Waiting for runtime errors to surface is a risky strategy, as it can lead to unnecessary downtime and costly bug-fixing processes. Taking the time to identify errors early on can save resources in the long run. Precise types play a key role in this process.
This is why explicit types are my preference. Types should not be hidden - they serve as a formal proof of correctness in your program. Embrace your type system and it will benefit you in return. Remember to annotate variables with their types, even when it may seem unnecessary.
There have been instances where lack of proper typing has resulted in significant losses for companies and projects. Having type information visible can prevent costly mistakes, even if your compiler isn't strict enough to catch them initially.
If your types become overly complex, it's a sign that adjustments are needed. Don't underestimate the importance of precise typing in your codebase.
But remember, everyone makes mistakes - including me...