Slashdot Mirror


Do Strongly Typed Languages Reduce Bugs? (acolyer.org)

"Static vs dynamic typing is always one of those topics that attracts passionately held positions," writes the Morning Paper -- reporting on an "encouraging" study that attempted to empirically evaluate the efficacy of statically-typed systems on mature, real-world code bases. The study was conducted by Christian Bird at Microsoft's "Research in Software Engineering" group with two researchers from University College London. Long-time Slashdot reader phantomfive writes: This study looked at bugs found in open source Javascript code. Looking through the commit history, they enumerated the bugs that would have been caught if a more strongly typed language (like Typescript) had been used. They found that a strongly typed language would have reduced bugs by 15%.

Does this make you want to avoid Python?

6 of 456 comments (clear)

  1. Re:You have to look at the source by Z00L00K · · Score: 5, Informative

    Since I have programmed in many different languages I have personally discovered that strongly statically typed languages do solve a lot of problems because the problems are encountered already at compile time, not during runtime. The problems are also less elusive.

    There are of course still bugs around, but they are more often on the strategical level than on a pure sloppiness level caused by misspellings and mismatching methods where a method is changed but one caller isn't.

    --
    If builders built buildings the way programmers wrote programs, then the first woodpecker would destroy civilization.
  2. Re:You have to look at the source by Crashmarik · · Score: 4, Informative

    Microsoft's big platforms are C,C++,C# this really doesn't do much for them.

    Lots of Borland/Pascal programmers are saying we told you so though.

  3. Title of this thread is messed up. by Jane+Q.+Public · · Score: 4, Informative

    The title of this thread incorrectly conflates "strongly typed" with "statically typed".

    They are two completely different things.

  4. Re:Bug Conservation by jeremyp · · Score: 4, Informative

    But the destructive hard to find bugs are still there with the weakly typed languages. It just takes you longer to get around to dealing with them.

    --
    All I want is a secure system where it's easy to do anything I want. Is that too much to ask ~~ Randall Munroe
  5. Re:Python solves this with decorators by zhiwenchong · · Score: 4, Informative

    I don't mean to be pedantic, but Python is inherently strongly typed.
    What it is not is "statically typed".
    I think there is a general confusion in this thread between strong vs weak typing, and dynamic vs static typing.

  6. Re:Perl is strongly typed by Srin+Tuar · · Score: 4, Informative

    Thats still weakly typed, just a different kind of weak. Strongly types is when you fail; "a" . 1 would throw an exception and say "i dont know how I can possibly proceed" if it was strongly typed.

    Strong typing vs weak is a minor detail anyway; the real meat is dynamic vs static.