Hacker News new | past | comments | ask | show | jobs | submit login

"Writing the initial code is likely to be if anything slower in a functional language; the real advantage comes in maintenance."

Definitely disagree with this. As with anything, with practice, you get very fast at writing Haskell code. the expressive/strong type system and type inference means you'll catch errors early while writing code at a higher/denser level than even today's popular dynamic languages, resulting in a net increase in programming speed (for me).




As a python guy (still the densest language on the programming language shootout AFAIK), I find I can run a unit test before most languages would compile. More to the point, I don't make type errors when writing the first version of a piece of code; it's when changing it that the type system becomes invaluable. Of course, this is different for different people.


Completely agree about the changing code part. I program in Ruby and I often wonder what I have broken whenever I change some code. (I know I am supposed to write a lot of tests, but it becomes a big chore to write tests for all the test conditions.)

By the way, I would not call Python one of the densest language by any means. It is one of the nice and straightforward languages to learn which is expressive as well.


What do you mean by "densest"?

Please give us a URL to the benchmarks game web page that you think shows Python is the densest language.

>>I don't make type errors when writing the first version of a piece of code<<

Maybe you just don't test the first version well enough :-)


I was going by http://shootout.alioth.debian.org/u64q/which-language-is-bes... . (the most naive/obvious approach - all benchmarks have weight 1, code size has weight 1, other factors have weight 0). I know it measures gzipped code size; I think that's a reasonable measure for "density".

Looks like I'm out of date, ruby 1.9 has overtaken python. Guess it's time to learn ruby.


Caveat lector -- http://shootout.alioth.debian.org/help.php#comparecodeused

"This paper [pdf The Effect of Language Choice on Revision Control Systems] compares one scripting language, Python, with C in the domain of revision control systems, as large working implementations exist for both languages. It finds no clear evidence that scripting languages produce smaller systems…"

http://plg.uwaterloo.ca/~migod/846/2011-Winter/projects/Simo...


That chart doesn't show what you think it shows.

> Remember - these measurements are just of the fastest programs for each of these programming language implementations

If you add in speed, even at a size:speed weight of 5:1, Python's advantage disappears.

So, the fastest python code is smaller and slower than the fastest haskell code, ignoring any slower code that may be denser.

Also, "gzipped code size" is a horrible measure of density: what everyone hates about Java is how redundant programs are (access modifiers, type declarations), which gzip would compress nicely, but doesn't help programmers (except where Eclipse auto-completes, I guess).


>> a horrible measure of density <<

Now we know you find it unpleasant, please name your preferred measure and explain why you think it would be better for comparing programs written in very different languages, with widely different source code styles and conventions.

Incidentally, do you think much Java or C# gets written with Notepad? :-)


I generally agree that I rarely make type errors when first writing code in Java or C#. I must say though, it really isn't the same with Haskell because of how much more expressive the type system actually is. Of course with practice one improves there too.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: