News for hackers. Stuff that matters.
Re:Why learning Haskell/Python makes you a worse programmer ... by ColinWright on Monday April 22, 2013 @06:08PM (#5592044)
Probably none of you care, and some of you will hate me for pointing this out, but look, here are a few previous submissions:

https://news.ycombinator.com/item?id=407796 <- Lots of comments

https://news.ycombinator.com/item?id=946258

https://news.ycombinator.com/item?id=1883663 <- A few comments

https://news.ycombinator.com/item?id=2410202

https://news.ycombinator.com/item?id=2489298 <- A few comments

https://news.ycombinator.com/item?id=3171630

https://news.ycombinator.com/item?id=4828284 <- Lots of comments

It will be interesting to see if this discussion raises any points not in the earlier one. Or the earlier one. Or the earlier one.

And to the inevitable downvoters, I don't care. No, I'm not baiting you. I just wanted to help people see that this has been discussed before, and if you have any respect for the HN community, and if you think the HN community is smart in any way, then you may want to see what this smart community has said about this in the past, rather than re-hashing the same old arguments.

Or not. Go to it.

Re:Why learning Haskell/Python makes you a worse programmer ... by kens on Monday April 22, 2013 @07:08PM (#5592290)
My crazy theory is that there are three different ways people treat online discussions: the "cocktail party" where people have interesting conversations, the "scientific conference" where the idea is to increase knowledge, and the "debate team" where you argue your position.

Posting links to previous threads is perfectly reasonable in the "scientific conference" model, but rather rude in the "cocktail party" model. So any downvotes on your links are sort of proxy votes on "what HN is".

Re:Why learning Haskell/Python makes you a worse programmer ... by merlincorey on Monday April 22, 2013 @07:05PM (#5592279)
Thank you for your fine service. Whenever someone posts something old to hackernews, I am extremely thankful to those divers who link us to the old posts, which are almost always very useful.
Re:Why learning Haskell/Python makes you a worse programmer ... by jpollock on Monday April 22, 2013 @07:50PM (#5592435)
Perhaps there should be a feature on resubmissions to preload the discussion with high-rated comments from the previous discussions?
Re:Why learning Haskell/Python makes you a worse programmer ... by vacri on Monday April 22, 2013 @07:19PM (#5592330)
It's interesting that HN has no URL matching to prevent simple straight-forward (multi)reposts like this.
Re:Why learning Haskell/Python makes you a worse programmer ... by jat850 on Monday April 22, 2013 @07:23PM (#5592346)
It in fact does but I think there may be some manner of "expiry", and it is also trivially easy to get around from what I have read. This submission appears to have a /? at the end of it which may be enough to get past a dupe check.
Re:Why learning Haskell/Python makes you a worse programmer ... by yen223 on Monday April 22, 2013 @10:52PM (#5593046)
It does actually. It's set to expire after a certain period because HN explicitly does not disallow reposts.
Re:Why learning Haskell/Python makes you a worse programmer ... by munificent on Monday April 22, 2013 @06:07PM (#5592040)
It's interesting to see how far C# progressed since this was written. Just a couple of years later, C# 3.0 came out and his example becomes:

    mylist.Select(foo => foo.Description())
          .Where(x => x != "")
          .Aggregate((a, b) => a + "\n" + b);
Which is, I think, pretty nice.
Re:Why learning Haskell/Python makes you a worse programmer ... by benhoyt on Monday April 22, 2013 @07:17PM (#5592322)
It gets better, though. C# 3.0 also has query expressions, which are even closer to Python's list comprehensions. Also, I think String.Join(sep, enumerable) would be more efficient than repeated string concatenation with + (given that C# strings are immutable, it'd have to reallocate and copy bytes each time, just like in Python).

So we'd have:

   String.Join("\n", from x in mylist where x.Description() != ""
                     select x.Description());
Hardly looks like a statically typed language anymore, does it?
Re:Why learning Haskell/Python makes you a worse programmer ... by danbruc on Monday April 22, 2013 @07:06PM (#5592281)
There is String.Join also used in the article but now there is a overload accepting IEnumerable<String>.

  String.Join("\n", mylist.Select(foo => foo.Description()).Where(x => x != ""));
Using a method group yields an even more readable code. Okay, it depends - if you are not used to method groups, it looks a bit strange but I like it.

  String.Join("\n", mylist.Select(x => x.Description()).Where(String.IsNullOrEmpty));
Note that I slightly changed and inverted the predicate because there is no build-in String.IsNotNullOrEmpty but you could of course write it yourself. I have a small extension method in my tool library that wraps String.Join and takes care of filtering out null references and empty and white space-only strings.

  mylist.Select(item => item.Description()).JoinExcludingNullOrWhitespace("\n");
Re:Why learning Haskell/Python makes you a worse programmer ... by famousactress on Monday April 22, 2013 @06:34PM (#5592146)
Wow, that's interesting. Is 'x' just a magic var for whatever Select() yields in each iteration?
Re:Why learning Haskell/Python makes you a worse programmer ... by adambard on Monday April 22, 2013 @06:51PM (#5592219)
x is the variable in the anonymous function 'x => x != ""'. I don't know C# but I presume that everything before '=>' is the argument list and the rest is the function body (with implicit return).

You can see it again in '(a, b) => a + "\n" + b'.

As a side note, I find it a bit funny how C# chooses method names in Linq for the benefit of programmers who know SQL, despite `Select`, `Where`, and `Aggregate` acting exactly like what other functional languages would call `map`, `filter`, and `reduce`. Not wrong, just sort of quirky.

Re:Why learning Haskell/Python makes you a worse programmer ... by cpeterso on Monday April 22, 2013 @07:20PM (#5592335)
JavaScript will use the same "fat arrow" syntax for anonymous functions in ES6:

http://css.dzone.com/articles/javascript-fat-city

Re:Why learning Haskell/Python makes you a worse programmer ... by adambard on Monday April 22, 2013 @07:22PM (#5592338)
Coffeescript uses it already.
Re:Why learning Haskell/Python makes you a worse programmer ... by vorg on Monday April 22, 2013 @07:37PM (#5592396)
> `Select`, `Where`, and `Aggregate` acting exactly like what other functional languages would call `map`, `filter`, and `reduce`. Not wrong, just sort of quirky.

Or `collect`, `findAll`, and `inject`.

Re:Why learning Haskell/Python makes you a worse programmer ... by adambard on Monday April 22, 2013 @09:11PM (#5592728)
Yeah, I don't know what the precedent is for Ruby's versions. I'm glad map, filter and reduce are also present.
Re:Why learning Haskell/Python makes you a worse programmer ... by archivator on Monday April 22, 2013 @06:39PM (#5592170)
The argument to Where() is a Func<TSource, Boolean>, and that "x => x .. " business is C#'s lambda syntax. x is just a variable name, no magic there.
Re:Why learning Haskell/Python makes you a worse programmer ... by daeken on Monday April 22, 2013 @06:39PM (#5592176)
It's a lambda. Saying x => foo(x) is the same as lambda x: foo(x) from Python.
Re:Why learning Haskell/Python makes you a worse programmer ... by Fishkins on Monday April 22, 2013 @06:39PM (#5592169)
x is the input variable to that anonymous function.

Instead of the named syntax e.g. doSomething(x) { return x * x; } the syntax for C# anonymous functions is x => x * x

Re:Why learning Haskell/Python makes you a worse programmer ... by kalterstern on Monday April 22, 2013 @05:38PM (#5591922)
This is quite silly, of course. A solid developer has no problems switching idioms (not just syntax) when hopping languages.

There's really not much sense in an argument that says you "lose" something by learning newer things -- provided, that is, you're really making an effort to wrap your head around the newer things that you're studying, and not just cramming selected phrases and reflexes into your head in order to finish some current task at hand.

If anything he's become a better C# programmer, not a worse one, precisely because of his "bad" experience, because he now sees that overuse of certain habits can lead to bizarre or otherwise undesirable results (just like with any language).

So really he should be thinking positively about the whole experience, rather than negatively.

Re:Why learning Haskell/Python makes you a worse programmer ... by zwegner on Monday April 22, 2013 @06:07PM (#5592039)
I personally agree with TFA. Being able to change your environment is really key--I write Java in my job and it's just awful for me. I definitely lose motivation from knowing there are better alternatives.

He's not saying you lose anything, more that it's harder to use those things when you're constantly thinking about how wrong they are. Similarly, the overuse of certain habits is not always avoidable.

Re:Why learning Haskell/Python makes you a worse programmer ... by michaelochurch on Monday April 22, 2013 @06:10PM (#5592047)
You should consider secretly using Scala or Clojure in order to see how long it takes for someone to say something.
Re:Why learning Haskell/Python makes you a worse programmer ... by zwegner on Monday April 22, 2013 @06:23PM (#5592098)
I've thought about it--it's a rather small company, with generally smart people on the team. It might happen, but the problem is mostly political. I also need to learn more Clojure... (I've learned enough Scala to convince myself that I don't really want to learn it)
Re:Why learning Haskell/Python makes you a worse programmer ... by michaelochurch on Monday April 22, 2013 @06:34PM (#5592147)
Scala is good if you have good programmers. Otherwise, it's painful, because they tend to write Java-in-Scala code. Also, it has a compile-speed problem that is tolerable in general but catastrophic if you have bad engineering practices (specifically, cyclical dependencies).

I just got back into Clojure after leaving my last job and the language (which was already very good) has gotten a whole lot better in the past 2 years. I recommend it highly.

Where do you live? What's the tech scene like in <X>? My wife and I are both ready to leave New York. We'll stay if I find something great, but I don't want to work in social media and my "job hopper" story (too many startups and consulting projects, NYC finance firms tending to perceive the latter as similar to short-term jobs even though they're not) is making finance annoying. (I can still get hedge-fund jobs, that's easy as crap, but there are few good ones and, besides, I like technology a lot better than finance.) Our short list is SF, Austin, Boston, but not limited to those 3 places by any means.

Re:Why learning Haskell/Python makes you a worse programmer ... by Schwolop on Monday April 22, 2013 @07:26PM (#5592360)
Send an email to Yanis Varoufakis @ Valve. He's the economics guy doing analysis of in-game economies and applying various machine learning techniques to determine pricing strategies, etc. I suspect even if that doesn't appeal, there'd be a bunch of interesting work that could use someone with your background.
Re:Why learning Haskell/Python makes you a worse programmer ... by dpritchett on Tuesday April 23, 2013 @10:12AM (#5595203)
Wow, that's a great suggestion. Valve + finance + ML. I can't imagine a better fit off the top of my head.
Re:Why learning Haskell/Python makes you a worse programmer ... by zwegner on Monday April 22, 2013 @06:52PM (#5592223)
WRT Scala, of course I don't know much about it, but it just seems way too complicated for its own good. It's like the C++ of functional programming. I don't really want to invest that much time in it just to become somewhat fluent, and then trying to convince others to do so is pretty much a non-starter.

I'm in Austin, and it's pretty nice. I imagine you know enough about the tech scene already (perhaps more than me?). There are lots of opportunities, but the "good" software jobs are rather elusive (especially for a college dropout like myself).

Re:Why learning Haskell/Python makes you a worse programmer ... by pnathan on Monday April 22, 2013 @06:54PM (#5592232)
FYI, Seattle, and too a small extent, Portland have a tech scene. But you probably have to like the PNW.
Re:Why learning Haskell/Python makes you a worse programmer ... by rdouble on Monday April 22, 2013 @06:57PM (#5592242)
Portland has Galois, which may be up his alley.
Re:Why learning Haskell/Python makes you a worse programmer ... by willismichael on Monday April 22, 2013 @06:31PM (#5592131)
That's an interesting approach! I tried more or less the opposite: wrote a patch replacing hundreds of lines of Java with dozens of lines of Clojure, then showed it to the team. It didn't work out so well. Here's an allegory that more or less parallels my experience: http://hack-tastic.blogspot.com/2013/04/most-people-who-grad...
Re:Why learning Haskell/Python makes you a worse programmer ... by michaelochurch on Monday April 22, 2013 @06:43PM (#5592189)
Overperformance is dangerous in the workplace.That's a real risk of using high-productivity tools (e.g. functional programming languages). You're introducing gunpowder to horse-riding swordsmen. Usually, they'll lynch you for witchcraft.

"Clojure doesn't have the latest despondency infarction frameworks! Burn it! It's a witch!"

I think the trick is to fail up into a better company (or team, if your firm isn't one of those where a bad start renders you immobile) when that happens. Hard to tell how good a company is before you join, though.

Re:Why learning Haskell/Python makes you a worse programmer ... by vinceguidry on Monday April 22, 2013 @06:04PM (#5592021)
For anyone thinking "WTF, what about LINQ?", note LINQ was part of .NET framework 3.5 and wasn't released for another year after he wrote this post.

LINQ makes coding in C# a whole lot more pleasant.

Re:Why learning Haskell/Python makes you a worse programmer ... by guiomie on Monday April 22, 2013 @06:29PM (#5592121)
Indeed, it does a lot. If it weren't for LINQ i'd hate c#.
Re:Why learning Haskell/Python makes you a worse programmer ... by yen223 on Monday April 22, 2013 @11:18PM (#5593120)
I'm using .Net 1.1 for my day job. God how I hate C#.
Re:Why learning Haskell/Python makes you a worse programmer ... by Kapura on Monday April 22, 2013 @06:39PM (#5592174)
I do most of my current work in Python, and I have no problem switching between paradigms within the language. Whatever makes it easier to read is how I look at it.

There are times when a functional solution makes the most sense, and if it makes the most sense, it should be clear and easy to read and understand. But then there times when a functional solution looks like a symbolic mess, and it's easier just to throw a couple of for loops into the code so it's easier to see that i'm, say, iterating through some list.

Re:Why learning Haskell/Python makes you a worse programmer ... by cpdean on Monday April 22, 2013 @06:48PM (#5592213)
I think that having higher standards for solutions doesn't make you a worse problem solver.
Re:Why learning Haskell/Python makes you a worse programmer ... by Siecje on Monday April 22, 2013 @06:38PM (#5592168)
I program in Python everyday but I still think in C/Java and have to google things like enumerate for for loops. Though this is happening less often now.

I also try to do Python thinks when I switch back to C.

input = scanf();

Re:Why learning Haskell/Python makes you a worse programmer ... by mwhooker on Monday April 22, 2013 @06:05PM (#5592024)
If learning anything makes us worse at something we should just stop learning
Re:Why learning Haskell/Python makes you a worse programmer ... by Houshalter on Monday April 22, 2013 @07:19PM (#5592333)
Or just stop learning the things that make you worse?
Re:Why learning Haskell/Python makes you a worse programmer ... by GhotiFish on Monday April 22, 2013 @06:47PM (#5592201)
Tell that to pandora, cthulhu and heroin.
Re:Why learning Haskell/Python makes you a worse programmer ... by michaelochurch on Monday April 22, 2013 @06:05PM (#5592025)
This is going to be fun!

I know he's joking, but I agree-- to a point.

First, if you write Haskell-in-Java code, you're going to do a horrible job unless you have so much autonomy that you end up reinventing Scala... in which case you should just use Scala. (See: Greenspun's Tenth Rule.)

Second, I think you learn a lot by studying other languages, but most of the superiority of Lispers or Haskellers comes from the fact that good programmers in general tend to be a curious set. Learning Lisp will make you a better Python programmer, and possibly a better C++ system architect. Will it make you better as a subordinate grunt on a gigantic C++ codeball? No, absolutely not. It will make you a morale problem and get you fired.

Third, you learn a lot more in expressive languages that makes you a better programmer but the languages itself don't get all the credit. When you use a Lisp, you can get a lot done quickly if you know what you're doing and cover a wide swath of computer science. When you use a true fringe language, you end up implementing a lot of libraries you'd just assume work in Java. These experiences are highly valuable but not rooted in the languages per se. It's just that a lot of the work you have to do to make a non-mainstream language usable in primetime contributes to your long-term awesomeness growth.

Fourth, if you want to be a Corporate Programmer (TM) and not be challenged too much, then maybe get tapped for management in your mid-30s, then Haskell and Python will poison you. I've written a lot about the progress of developer competence (see this, just today: http://michaelochurch.wordpress.com/2013/04/22/gervais-macle... ). Once you cross the 1.4 rubicon, there really is no going back, and you'll be in conflict with managerial authority forever. Well, at least until you become so good that it's eminently obvious and you can escape the CrapFactory (or is it CrapVisitorSingletonFactory?) Corporate Programming world.

However, if what you want is to be a great programmer (not an easily employable one) then Haskell and Python will do you favors, and learning a few more languages (also C, because the low-level will always be important for some domains) is probably necessary.

This was written in 2006; I wonder what he'd think of JVM languages, especially Clojure.

Re:Why learning Haskell/Python makes you a worse programmer ... by MostAwesomeDude on Monday April 22, 2013 @06:31PM (#5592130)
I know you're joking, but I agree -- to a point.

First, if you write FORTH-in-Java code, you're gonna do a horrible job unless you get to reinvent Factor, at which point you should just use Factor. Also, you get to use Factor, which is awesome.

Second, I think you learn a lot by studying other languages, but most of the superiority of FORTH hackers come from the fact that good programmers, in general, tend to be parsimonious. Learning FORTH will make you a better programmer. It will also make you better at C++. In fact, it will make you better at everything, including being a morale problem, getting fired, being a hero to your co-workers, and being promoted.

Third, you type less in concatenative languages. When you use a Forth, you can get a lot done quickly because you don't type as much.

Forth, if you want to be a Corporate Programmer (R) and not be challenged too much, then just use FORTH, because, like COBOL before it, FORTH lets you hold down the Shift key constantly.

However, if what you want is to be a great programmer, then FORTH is still the answer! Why? Because it says so:

: ANSWER ." FORTH is pretty much the best way to be a great programmer. " ;

Re:Why learning Haskell/Python makes you a worse programmer ... by rdouble on Monday April 22, 2013 @06:34PM (#5592144)
...good programmers, in general, tend to be parsimonious

Good programmers are frugal to the point of stinginess?

Re:Why learning Haskell/Python makes you a worse programmer ... by MostAwesomeDude on Monday April 22, 2013 @06:36PM (#5592155)
Good programmers are terse.
Re:Why learning Haskell/Python makes you a worse programmer ... by michaelochurch on Monday April 22, 2013 @06:36PM (#5592156)
I joke don't fully get.
Re:Why learning Haskell/Python makes you a worse programmer ... by MostAwesomeDude on Monday April 22, 2013 @06:42PM (#5592185)
There is no joke. FORTH is a serious language. You can tell because it's fully capitalized.
Re:Why learning Haskell/Python makes you a worse programmer ... by platz on Monday April 22, 2013 @07:03PM (#5592265)
I wonder if the same argument applies to using Reactive Extensions (Rx), ReactiveCocoa, etc..
Re:Why learning Haskell/Python makes you a worse programmer ... by macca321 on Tuesday April 23, 2013 @02:10PM (#5596884)
Resubmitting this article when it's so out of date seems like anti-C# FUD spreading.