Why learning Haskell/Python makes you a worse programmer (2006)
lukeplant.me.uk
lukeplant.me.uk
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.
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".
mylist.Select(foo => foo.Description())
.Where(x => x != "")
.Aggregate((a, b) => a + "\n" + b);
Which is, I think, pretty nice.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? 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");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.
Or `collect`, `findAll`, and `inject`.
Instead of the named syntax e.g. doSomething(x) { return x * x; } the syntax for C# anonymous functions is x => x * x
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.
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.
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.
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).
"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.
LINQ makes coding in C# a whole lot more pleasant.
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.
I also try to do Python thinks when I switch back to C.
input = scanf();
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.
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. " ;
Good programmers are frugal to the point of stinginess?