Those in the strong typing camp claim that their method helps produce better programs, thanks to the additional compile-time testing. This is absolutely true, and helped me find a handful of errors back when I wrote Java on a regular basis. The trouble is, this extra security comes at the expense of language verbosity (
ArrayList<String> stuff = new ArrayList<String>();
anyone?). Being a liberal when it comes to programming, I prefer to have a concise language that allows for rapid prototyping and development. This does create errors but not nearly as many as my CS Professor would predict.Of course, this entire entry depends on strong typing being used exclusively as a sort of baseline test (My freshman mantra: "It compiles!
Liberals argue that this provides false security. "How can we tell if the variable's value is correct, not just the type? We need more tests!" In either case, more tests are needed. If you're building something significant, you need tests. Liberal programmers are free to throw caution to the wind and depend on their own tests, claiming that the time lost to writing tests is made up by writing in a simpler language. (I haven't found any studies to back this up, I'd love to hear it if you've got one).
So far, I agree with the hippie liberals. It's much better to write your own tests to determine what's going wrong. Who knows your code better: You, or a compiler? Using strong typing for testing purposes also breaks separation of concerns, but that's a nitpick.
If you can't tell, I don't really like strong typing. Oddly enough, I also don't like it when a program doesn't fail on what should be an error, but continues soldiering on with weird results. (thank heaven for
'use strict';
). Back to where I was: People who get paid more than me to write terrible code.It's a sad reality that there's a huge amount of terrible code out there. A large portion of this code is glue between several plugins mashed together into a "website." Scary. However, strong typing (thanks to that very breaking of separation of concerns) forces basic testing onto whoever is using the plugin/API. The "programmer" (and I use that term loosely) must provide semi-correct data.
Of course, those who write glue code are looking for the easiest plugins to
So strong typing is bad because it forces you to write extra code that amounts to more tests that you'll have to rewrite anyway.
[0] In this case "strong typing" means that the language gives an error if a variable is of a type that wasn't expected. This means that the programmer
Not quite as much blowback as you expected, eh?
ReplyDeleteAlso, you kinda did contradict your title. Just sayin'.
Yeah. I've been writing more stream-of-consciousness lately. It was a great idea in my head, but lost more credibility as I explored it in type.
Delete