4 ms·
"I don't think it's particularly controversial, that static typing in general has advantages" That's not really true, just a belief. I give you an example to s
by zzzcpan 9y ago
"I don't think it's particularly controversial, that static typing in general has advantages"
That's not really true, just a belief. I give you an example to start understanding these things: the exact same program written in a very high level and very expressive language, like Perl, instead of Go, is going to have at least 3 times less code and since defect rates per line of code are comparable, you would end up with at least 3 times less bugs. Suddenly reliability argument of static typing doesn't make any sense. That's because in PL research there is a huge gap in understanding of how programmers actually think.
- raphinou 9y agoI think you are right, but you only cover producing code. For maintaining code, it is another story. If you have to take over an unknown code base, I think static typing will prevent bugs to be deployed, because the typing system will detect errors you might not be aware of due to your incomplete knowledge of the code. I was in favour of dynamic typed, but lean more and more towards static typing, like ocaml.
- Symmetry 9y agoThat's an argument for higher level languages over lower level ones rather than against dynamic typing. And I'm not sure you should expect the number of bugs per line to remain constant across languages. Extra lines required because you have to do your indexing by hand as you're iterating over a list certain increases the chances of an error but the extra '}' required to end the block in some languages increases line count with very little chance of causing an error.
- scarmig 9y agoAlthough I'm skeptical about the 1 to 3 ratio, let's run with it. Given a million line codebase written in Perl vs a three million line codebase written in Go, which do you think most engineers would prefer?
- 3pt14159 9y agoHonestly the Ruby or Python one, but I've never seen them because you don't need a million lines in Ruby or Python to get something productive built.
- smaddox 9y ago"...and since defect rates per line of code are comparable..." That's not really true, just a belief. A naive belief, if you ask me.
- zzzcpan 9y agoThat claim is supported by more than one study.