4 ms·
some people found error messages they couldn't ignore more annoying than wrong results, and, when judging the relative merits of programming languages, some sti
by lemming 16y ago
some people found error messages they couldn't ignore more annoying than wrong results, and, when judging the relative merits of programming languages, some still seem to equate "the ease of programming" with the ease of making undetected mistakes
This is interesting, I think - this is really one of the core parts of the argument between static and dynamic typing. I prefer bondage and discipline to free love when it comes to types - I find programming in dynamic languages mushy, ill defined and error prone. And yet, lots of people love them and manage to do amazing things with them. Although in general I agree with Dijkstra's essay, maybe there is more wiggle room for a "more natural" language than I'd thought.
- edanm 16y agoThat quote also stuck in my mind. I'm more of a dynamic-language type for most things, and his argument seems to go heavily against dynamic languages. By the way, I'd quote the sentence before as well since it adds important context. It was a significant improvement that now many a silly mistake did result in an error message instead of in an erroneous answer. (And even this improvement wasn't universally appreciated: some people found error messages they couldn't ignore more annoying than wrong results, and, when judging the relative merits of programming languages, some still seem to equate "the ease of programming" with the ease of making undetected mistakes.)
- ozataman 16y agoActually, I don't think this has to do with dynamic vs static typing. It is more about strong vs weak typing, i.e. implicit type casting. In many dynamically but strongly typed languages (like Ruby), you would still get a type mismatch when you try to add a string to a number at runtime. It's just that with static typing, you would have realized your error much earlier at compile time.
- DougBTX 16y agoWhile I think you're right, my guess is that he had strong static typing in mind when he wrote the article. Ultimately they lie on a scale. With a dynamic, strongly typed language, you still leave plenty of opportunity to make undetected mistakes. The obvious example is changing the expected type of a method argument, while only updating a subset of the call sites.
- contextfree 16y agoI'm not sure what he had in mind at that time, but Dijkstra was never all that enthusiastic about type theory. He thought it was a promising and worthwhile avenue, but was suspicious of it being treated as a panacea. http://www.cs.utexas.edu/users/EWD/transcriptions/EWD12xx/EWD1243a.html http://www.cs.utexas.edu/users/EWD/transcriptions/EWD12xx/EW... "Another thing we can learn from the past is the failure of characterizations like "Computing Science is really nothing but X", where for X you may substitute your favourite discipline, such as numerical analysis, electrical engineering, automata theory, queuing theory, lambda calculus, discrete mathematics or proof theory. I mention this because of the current trend to equate computing science with constructive type theory or with category theory."
- cabalamat 16y ago> [Dijkstra] was suspicious of [type theory] being treated as a panacea I'd be suspicious of anything being treated as a panacea.
- contextfree 16y ago=) Sorry, I was being sloppy there - couldn't come up with an accurate and un-platitudinous way to characterize Dijkstra's attitude. There are other places in his writings where he's suspicious of an overemphasis on types, I think his criticisms of Ada mention it for example. Dijkstra was a big proponent of rigorous mathematical means of establishing program correctness in general, of course, but he didn't necessary equate that with types.