3 ms·
I stopped reading at "strong typing". (well, not really... but I started typing this comment roundabout there) First of all, what he describes is not called st
by swombat 17y ago
I stopped reading at "strong typing". (well, not really... but I started typing this comment roundabout there)
First of all, what he describes is not called strong typing, it's called static typing. Ruby, for example, has strong typing (every object is one type and one type only), but not static typing (you don't declare the type of an object when you declare a variable).
Secondly, there are many powerful languages that don't have static typing. Is the author implying that those languages are inherently buggy?
Thirdly, the author is not advocating what he declares in the title. He proposes methods to catch bugs, not to avoid them. His methods are also flawed in that redundancy does not ensure bug-free code - only that you haven't made any silly mistakes in your coding. Bugs come from all sorts of sources, and "code typos" are only one minor source. Other sources include: maintenance changes (which cause unforeseen effects that were not previously covered by tests), design flaws, and changed external circumstances. None of those are covered by the technique he lists.
Sorry, but this is just a poor attempt to capitalise on a catchy title. Nothing to see.
- clawrencewenham 17y agoYou're right, I meant static and not strong typing.
- amalcon 17y agoStatic typing doesn't necessarily mean type declarations, either. See OCaml. What it does mean is that the compiler knows the type of all variables at compile time, but it's OK if it figures that out for itself.
- scotty79 17y agoStatic typing gives you 'redundancy of meaning' solution for a fairly rare and not especially harmful, or hard to detect by other means, error of holding some data types under identifier that you meant to hold values of different type. It's a hard solution (vide generics and all the redundant typing) for minor problem and it cannot justify its existence on such basis. For me static typing is just a hack on the side of compiler guys to make their work easier for them. It was claimed to have benefits for programmers at later date.
- silentOpen 17y agoHave you written in anything from the ML family? I strongly recommend you take a look at OCaml or Haskell. I believe you will find that static typing, when done right, is immensely helpful.
- tetha 17y agoYou are right, even though you have to give him the point that a lot of the existing static type systems around by now are bad. Haskell is approachig a really nice, hassle-free type-system, but take, e.g., Javas typesystem? Bleh.
- scotty79 17y agoI'm using language without static typing for most of my work and I can hardly remember any bug that was caused by having wrong type of data in unexpected place. I remember very well redundancy of using language with static typing, I know how much boilerplate code is needed in languages such as java, and how complicated can generics become in C# if you want to achieve fairly simple architectural things that can be concisely expressed in dynamically typed languages.
- silentOpen 17y agoOk. Those languages do static typing incorrectly. Try a language that sports type inference. It isn't redundant. There isn't boilerplate. The type system is far more powerful than in Java or C# (polymorphic types, polymorphic variant types, algebraic types and constructors, functors, etc). You owe it to yourself to learn these systems. In many cases, there are type-side symptoms of logic-side bugs. If Haskell's laziness and purity scare you, try OCaml -- it's fast and straightforward.