3 ms·
Static vs Dynamic typing... Why one has to win? I don't think it's about being convinced of benefits of one or another. We need to be convinced about the drawb
by ceronman 9y ago
Static vs Dynamic typing... Why one has to win?
I don't think it's about being convinced of benefits of one or another. We need to be convinced about the drawbacks of each approach. Then we will understand that there is no silver bullet and each kind of language has strengths and weaknesses.
I love static typed languages. I love that they show me silly errors as soon as I type them on my IDE. I love that I can get auto complete and automatic refactoring tools. I love that I can easily jump from one function to another by just clicking on their names names as if they were hyperlinks.
I also love dynamic typing. I love how few lines of code you need to do some complex tasks. I love how easy is to manipulate complex structured data coming in JSON, YAML or XML forms. I love how easy is to do metaprogramming with them, how easy is to create your own DSL and make tasks like DB access a piece of cake. I love how you can just REPL into your server running in production, change things, test them and leave.
I like that we have both kind of languages. I chose static typing for some projects and dynamic for others. I hope no paradigm wins. Let us the best tool for the job.
- he0001 9y agoFor me static typing is one less thing to think about and I can concentrate on the problem.
- hellofunk 9y agoIronically, those who prefer dynamically typed languages would make the exact same argument.
- throwaway7645 9y agoYea as someone who really learned coding in a dynamic language, static typing drives me bonkers and makes me think about things I'd rather ignore. I know static typing has many advantages, especially when coupled with an IDE, but I don't want that. I only really need a REPL to test out snippets and a text editor to assemble them into a coherent program before feeding it to the compiler. Well, that and Stack Overflow. Some of my ideas might change if we're talking about a large project though as I mostly code for task automation, data analysis, and helper scripts.
- he0001 9y agoWell just because static typing isn't present in your language the benefits of the concept is still something one has to consider in a non static language. My experience of people coming from non static typed languages to a non static language really have a problem with the effects of what static typing brings, like encapsulation. While the contrary, when I write in non typed languages I really benefit from the thought patterns static typing creates and helping me to produce better code. Not having static typing is just freecard of doing what I want instead of relying on explicit (language) structure. With that said you can still produce good code in non static typed languages, it's just damn easier to not to since the language doesn't help you with it.