Live data from Hacker News

Study of 49 programmers: static type system had no effect on development time

cs.washington.edu

151–160 of 192 posts

Re: Study of 49 programmers: static type system had no effect on development time

#151

Earlier quoted context omitted.

I use tests for documentation. They seem like more work at the start, but they're more flexible. You can self-document things with tests that you cannot with just types. For example, here are some tests from the lisp interpreter I've been working on: http://github.com/akkartik/wart/blob/8a8cf96816/030.test You're right that tests aren't close to code. But that can be good or bad. Since it's not next to the code it ca…

Static type systems don't excuse you from writing tests. But they do effectively write a whole class of tests for you, and run them much faster and give you more precise errors than manual testing ever will. People complain about C++ compile times but I've heard of big Ruby projects with test suites that take 20+ hours to run.

> I've heard of big Ruby projects with test suites that take 20+ hours to run.

I'd assume those tests go well beyond type checking.

Re: Study of 49 programmers: static type system had no effect on development time

#152

The study may or may not be flawed, but what's really interesting to me is the reaction. We need more science in our computer science, which means more experiments and more results like this. We should also be open to the truth that we use the tools we like because we like them rather than because they're technically superior, even though we pimp them ad nauseum as though they are. I once read an article about a tech…

> We need more science in our computer science, which means more experiments and more results like this. There is an ongoing experiment wrt the usability of programming languages, libraries, frameworks, concepts, ... It's called the market.

Counterexample: JavaScript. It is the best demonstration I know of that our choice of languages and tools is mostly based on historical accident rather than any technical criteria.

Re: Study of 49 programmers: static type system had no effect on development time

#153
post #73

Earlier quoted context omitted.

You are hitting exactly the main point. Dynamic languages are very good for prototyping or small scale projects. But they fail to address the context of programming large scale applications with teams distributed across multiple sites.

I'm betting youtube is bigger than all of your sites combined, and they use python.

YouTube is of a different class of complexity as faced by enterprise developers integrating millions of lines of code across disparate systems.

Re: Study of 49 programmers: static type system had no effect on development time

#154
post #134
post #89

Earlier quoted context omitted.

http://forums.construx.com/blogs/stevemcc/archive/2011/01/09...

I'm not sure how that link helps me. I've already seen many of those studies. Which one satisfies, "students were given identical tasks, and a fairly large amount of time to do them"? That is the specific study I am searching for to add to my list of papers. Did you give me this link because you were referring to Humphrey (A Discipline for Software Engineering), or something else? I can track down Humphrey, but it wi…

My apologies. I misread what you were looking for. Mostly by not actually reading what you wrote. :(

Perhaps the previous author was thinking of the Prechelt "An Empirical Comparison of .." paper? http://page.mi.fu-berlin.de/prechelt/Biblio/jccpprtTR.pdf . Section 5.7 has "work times" for Java and C/C++ programmers using well-observed times. However, that is not for a "fairly large amount of time."

Re: Study of 49 programmers: static type system had no effect on development time

#155

The study may or may not be flawed, but what's really interesting to me is the reaction. We need more science in our computer science, which means more experiments and more results like this. We should also be open to the truth that we use the tools we like because we like them rather than because they're technically superior, even though we pimp them ad nauseum as though they are. I once read an article about a tech…

No study can control all the variables enough to convince a fanboy that his favorite language isn't the greatest ever. However, the current state of PL research is as close to astrology as you can get. Why are we working on type systems and modules and concurrency primitives et. al. without a scrap of evidence that any of it contributes to programmer productivity? There's no science there. In fact, everyone here shou…

PL research is not necessarily for "contributing to programmer productivity." Formalization of various programming language concepts into a type system[0] allows researchers to apply analysis and verification techniques. The simplest example I can think of is the Maybe type. Instead of having null pointers and, if you forget to check for NULL, getting a runtime error (segfault, NullPointerException, whatever), instead you would fail to compile since the "null-like" pointer would be a Maybe type, not the concrete value. You can't use it without unwrapping it. Concretely, the code:

    int foo(int *p) {
        return *p + 17; //well, probably something more complicated.
    }
if p is NULL, this code doesn't work. In a language with a more expressive type system, we would write:

    foo :: Maybe Int -> Maybe Int
    foo p = case p of
              Just x  -> Just (x + 17)
              Nothing -> Nothing
(Note: there are more succinct ways to write this example in Haskell, but I'm trying to illustrate the code.)

In this case, we have demonstrably covered every case. That's what an expressive type system gets you: you can completely preclude certain classes of bugs like null pointer dereferences by having a sufficiently expressive type system. It's the same in more relevant PL research: people are attempting to formalize systems so that whole classes of bugs can be removed at compile time. It's not about user case studies or anything like that: those can come later, when features look like they'd be useful to integrate into languages.

It looks like the featured article gives a case study about a pretty bad type system. A sufficiently expressive type system doesn't get in the way--it aids the programmer, not hinders her. Heck, in Haskell and ML, you don't even have write down types--the compiler will infer them for you. (It is Haskell practice to type-annotate toplevel functions anyway).

[0] When I say type system, I mean a static type system. For the purposes of this discussion, dynamically typed programs are statically typed, just with not-very-useful types.

Re: Study of 49 programmers: static type system had no effect on development time

#156

The study may or may not be flawed, but what's really interesting to me is the reaction. We need more science in our computer science, which means more experiments and more results like this. We should also be open to the truth that we use the tools we like because we like them rather than because they're technically superior, even though we pimp them ad nauseum as though they are. I once read an article about a tech…

[deleted]

Re: Study of 49 programmers: static type system had no effect on development time

#157
post #73

Studying individuals is the wrong experiment. Static typing benefits tooling most when you have larger groups of programmers who much collaborate, often asynchronously. It's easy to hold a mental model of the code you write in your head and minimize mistakes, it's harder to hold a mental model of a larger program consisting of code written by many programmers. I'd like to see them hand a pre-written codebase of say,…

You are hitting exactly the main point. Dynamic languages are very good for prototyping or small scale projects. But they fail to address the context of programming large scale applications with teams distributed across multiple sites.

How does static typing help that?

Re: Study of 49 programmers: static type system had no effect on development time

#158
post #122

I think there are several flaws in this study, but alas, its subject is quite inflammatory and it is easy for people to gloss over the details and start drawing conclusions. Here are a few things to keep in mind, IMO: - Good/capable/flexible static languages are much much harder to design than dynamic ones. Case in point is Haskell, where hundreds (thousands?) of researches have been working for years to widen the ar…

Real world tasks or math tasks?

Well, definitely real-world tasks with focus on usefulness and other practical concerns. Ideas would be:

- Implement a parser for some protocol/data with testing, etc. - Implement a communication protocol/framework/driver/API - Implement a sophisticated-enough simulation for a real-world question you're trying to address certainly with some calculations inside. - Implement a game AI as defined by some spec - ...

Re: Study of 49 programmers: static type system had no effect on development time

#159
post #128

The static versus dynamic typing "battle" is kind of from the kindergarten. You need both, similarly as to how both boys need their fathers even though both of them get declared the strongest in the world in turns. With dynamic typing it's much more difficult to create large, reliable codebases. There's too much implicitness among the interactions of different actors, modules, and programmers. With static typing it's…

If you want to reduce implicit interactions between components, using FP over OOP will probably give you larger gains that static typing over dynamic typing.

Re: Study of 49 programmers: static type system had no effect on development time

#160
post #84
post #51

Earlier quoted context omitted.

No, he puts typing in the interface, and that's indeed typing in a sense, called duck-typing.

I think we are talking about different things. Duck-typing doesn't help in depicting what the return type of a function is when looking at the function signature only. You need to look at the function implementation (the actual duck) to tell what the return type is.

My point I guess was that with proper abstractions and duck typing you really don't have to care about the type. I only notice something isn't a duck when I try to use it like a duck and it fails - which is surprisingly infrequent.
Post reply on HN