6 ms·
How is dynamic typing easier? It makes it way easier to introduce bugs- Recently I was working on a timer (for speedsolving Rubik's cubes) and I had accidental
by bwbw223 8y ago
How is dynamic typing easier? It makes it way easier to introduce bugs- Recently I was working on a timer (for speedsolving Rubik's cubes) and I had accidentally had tried to format an already formatted time for user display, so all that was shown was `undefined` for times over a minute. It was hard to uncover, because the calls were in seperate parts of the codebase, and I wasn't able to make the field/formatter only allow numbers because of the nature of Javascript.
- mabynogy 8y agoIt is known by studies. People are more comfortable and productive with dynamically typed languages. The most productive language is smalltalk.
- scarface74 8y agoHave these "studies" taken into account maintainability? There is a whole class of bugs that won't happen with a statically typed language. There also a whole class of automatic refactors that you can do with statically typed languages.
- mabynogy 8y agoIt's about productivity not correctness.
- scarface74 8y agoHow can you be "productive" writing code that isn't "correct"? That's the worse type of developer - the one who does "negative work". Negative work is when someone does work so badly that it takes more time to correct their errors than it would have for them not to do the work at all.
- mabynogy 8y agoYou're talking about you and your opinions. For a given task, random programmers are quicker at achieving the goal with dynamic programming languages. That's why scripting languages are popular. They are also easier to learn.
- scarface74 8y agoHow could it be a "goal" to have incorrect code?
- mabynogy 8y agoYou're dishonest. The goal is to measure productivity.
- scarface74 8y ago"Productivity" in the real world is how long does it take me to get to a working solution. A solution that isn't correct isn't working.
- mabynogy 8y agoIt's a sophism. That's what they did.
- bwbw223 8y agoSure, but it doesn’t scale well. Static-typing makes code easier to come back to a year later or collaborate on because it’s more self-documenting. You don’t have to dig through the codebase to figure out that a function should have only accepted a number, because the interpreter/compiler would have screamed at you the moment you try something else. Scripting languages may be easier to learn, but they aren’t as scalable and efficient. In requiring less scaffolding and structure, they’re not as well suited at creating correct code in large codebases. They’re still great for prototyping, though.
- 8y ago
- steveklabnik 8y agoDo you have those studies handy? The ones I’ve seen have been inconclusive.
- mabynogy 8y agoThe one I've seen with smalltalk shows that clearly. I'll repost it if I can find it. IMO about smalltalk, it's not just because of dynamic typing but also because of the builtin IDE, VM and DB.