TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Why Learning Haskell/Python Makes You a Worse Programmer

66 pointsby antiformover 16 years ago

16 comments

brentbover 16 years ago
The author's C# example predated the release of LINQ, which makes the C# syntax much more like the Python's. The author's code:<p>string.Join("\n", mylist.ConvertAll&#60;string&#62;( delegate(Foo foo) { return foo.Description(); }).FindAll( delegate(string x) { return x != ""; }).ToArray());<p>can be rewritten as:<p>string.Join("\n", (from f in myList where f.Description() != "" select f.Description()).ToArray());<p>which is super-easy to read and understand. Maybe not as concise or pretty as Python or Haskell, but definitely a step in the right direction.<p>Others' comments that the author should consider F# are well founded, as it integrates seamlessly with other .NET-based code (such as C#) and is a pretty great language. However, it's worth noting that the post was written in 2006, well before F# was widely known about or distributed.
评论 #408030 未加载
评论 #408121 未加载
silentbicycleover 16 years ago
"The fact is that functional idioms work badly in languages that don't have syntactic support for them."<p>Then <i>don't use those idioms</i>. Work <i>with</i> your language, not against it. Learning Haskell taught the author to be more conscientious with state. Good. But nobody wants to debug imperative/OO code written by somebody newly infatuated with Haskell* -- it's like when people study a foreign language in high school and start dropping little fragments of Spanish/French/Japanese/etc. into casual conversation all the time, oblivious to whether the people around them understand it.<p>One of the comments (by "tom") nails it:<p><i>One of the more potent reasons for learning other modus operandi in programming to keep you from building tolerance to the same assumptions.</i><p>Learning several unrelated languages will almost certainly make you a better programmer, but code that assumes everybody else you're working with has the same background as you will be difficult to maintain. The language you're working in is the foundation for your shared culture, so do your best to write idiomatically in that.<p>* I have been guilty of this.
评论 #408476 未加载
评论 #408447 未加载
nirmalover 16 years ago
<i>Update: I probably should have made it more obvious for some people that the title of the post is not entirely serious, and mainly I'm just griping.</i><p>I think this explains the whole article and why there is no serious discussion here.
chwolfeover 16 years ago
Comparing C# 2.0's functional capabilities to Haskell/Python is terribly misleading. You can perform functional tasks easily in 3.5 using lambda expressions and built in functional operators such as:<p>listOfTestObjects.ForEach(x =&#62; sOutputDescriptions += "\n" + x.Description());<p><a href="http://weblogs.asp.net/scottgu/archive/2007/04/08/new-orcas-language-feature-lambda-expressions.aspx" rel="nofollow">http://weblogs.asp.net/scottgu/archive/2007/04/08/new-orcas-...</a>
评论 #407931 未加载
russellover 16 years ago
The obvious answer is to switch to Brainfuck, the any at-work language, even Cobol, will be a pleasure to work in.
RiderOfGiraffesover 16 years ago
Actually, there are some serious points here. Consider this:<p><a href="http://www.postmodernprogramming.org/stories/fixed_point_madness" rel="nofollow">http://www.postmodernprogramming.org/stories/fixed_point_mad...</a>
jganetskover 16 years ago
The title is "Why X makes you a worse progarmmer"<p>Then his conclusion: "I have no doubt that in general I am a better programmer for learning these languages..."<p>Um, hello?
评论 #408374 未加载
评论 #408504 未加载
diviaover 16 years ago
...when programming in less powerful languages, because they start to seem inadequate.<p><i>I constantly find myself wanting to use idioms from these languages, or noticing how much less code I'd be able to write if I was using one of these languages.</i>
DaniFongover 16 years ago
C# was, to me, the best available language in TopCoder competitions. Once I had more than a passing acquaintance with Python, Lisp, Ruby and Haskell, it was annoying to compete in it. I spent a bunch of time trying to imagine a way to write in a language of my choice using code generation. Eventually I just gave up, and stopped playing (though this was one of many contributing factors)
评论 #408703 未加载
thomasmallenover 16 years ago
Enthusiasts always put their language of choice on a pedestal. Python is a very good language, but I often find it to be too restrictive and will use Ruby/Perl for elegant metaprogramming and Erlang for functional programming.
评论 #407994 未加载
zmimonover 16 years ago
As others have said, stop fighting the language and embrace it. For the Java haters, here's a Java one-liner that is not much longer (though I'll admit, uglier) than all the rest:<p>result = join(new ArrayList&#60;String&#62;(){{ addAll(list); while(remove("")); }},"\n");<p>And as a bonus - for the extra few characters you typed, this will fail at compile time instead of runtime when the list turns out to contain FooBars instead of strings.
评论 #408704 未加载
gaiusover 16 years ago
So why not use IronPython or F#?
评论 #407878 未加载
shadytreesover 16 years ago
That's an extremely rash claim: I'm struggling to adapt to a different language, and so will you.
评论 #408127 未加载
评论 #408126 未加载
ryanwaggonerover 16 years ago
Alternate title: Another article demonstrating that trolling works.
villageidiotover 16 years ago
The title is catchy but imprecise. After discovering the concision of python and haskell, the author has less tolerance for the verbosity of c#, the language with which he earns his living. Perhaps the solution is to earn a living with a more concise language.
评论 #407860 未加载
评论 #407972 未加载
time_managementover 16 years ago
Reminds me of a time I screwed up a Java project (well, not really; just took a long time to write code most Java devs wouldn't understand) by using attempting to use generics and Java's static typing system to build-up an ML-esque ADT system.<p>4-ply parameterized types (e.g. string array list option) do not attractive siblings in Java-land.