TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

An Apology of Sorts: Functional Languages Are (Still) Overrated

68 点作者 fogus超过 12 年前

12 条评论

tikhonj超过 12 年前
Functional languages may be overrated, but not nearly as overrated as imperative languages (especially Python and Java). At the very least, avoiding Haskell is--unfortunately--quite easy; avoiding Java or Python in most places is nigh impossible.<p>The past post he references can be summarized by its last sentence: "I seriously don't get it." It spends quite a bit of effort telling us very little about functional languages but quite a bit about the author. And, as usual, he mistakes difficultly for complexity--just because something is new and mind-bending does not mean it is <i>complex</i>; it could just be a little tricky to pick up. (This is where Rich Hickey's "Simple Made Easy" talk really shines.)<p>And, of course, in the current post he misrepresents the main case for functional programming. Which is--quite critically--not concurrency <i>or</i> parallelism! These are, in fact, just nice benefits. The main point is using a higher level of abstraction, reducing coupling, simplifying code, writing <i>less</i> code to do <i>more</i> and making it easy to reason about and verify.<p>If all you care about is concurrency, Haskell is probably not your best bet. But if you care about writing maintainable, reusable and more general code more quickly and without sacrificing too much performance, it is. I would--without thinking twice--use Haskell to write programs in a completely single-threaded world. Haskell may also be good at dealing with concurrent nonsense, but this is really just a symptom of a deeper cause: Haskell is good at dealing with complexity.<p>If that doesn't convince you, Haskell also comes with a ton of shiny toys like QuickCheck and Parsec. It might not have the <i>biggest</i> collection of libraries, but it probably does have one of the most <i>innovative</i>.
评论 #4504042 未加载
评论 #4502070 未加载
评论 #4502262 未加载
评论 #4503357 未加载
bunderbunder超过 12 年前
There is one language that stands way out at the forefront when it comes to working on enabling B grade programmers to write scalable, concurrent systems: C#.<p>I think a big part of its success is that it avoids the hype machine. It isn't a disruptive language that changes the way we do things. It can't be, or management would be justifiably wary of it. Instead, it's a language that started out as a very close clone of Java, and since then its designers have been rapidly iterating to the point that it's now a (mostly, some would say) functional language that's solidly embedded in the enterprise space.<p>It's somewhat disappointing that it's still missing algebraic data types and pattern matching. But considering I've got most of what I want without ever having had to pitch switching languages to an employer, I'm really not in a position to complain too much.
评论 #4500606 未加载
jballanc超过 12 年前
I've recently been using Clojure more and more, including introducing it for a few nascent projects at work. I haven't been this excited about a new language since Ruby in 2005.<p>Plenty has been written on its technical merits, but there is one aspect of Clojure that I don't think enough people pay attention to: the community! 4Clojure is just one example. The #clojure IRC channel is another. The Clojure community today feels like the Ruby community did back in 2005: hackers having fun and getting work done at the same time.<p>You owe it to yourself to give it a chance...
评论 #4500440 未加载
评论 #4500467 未加载
评论 #4500375 未加载
T_S_超过 12 年前
I have been using Haskell seriously for about two years now and humorously for a bit longer. For some reason I bought the old sales pitch some time ago. Now that I have a clue about the language I would like to rewrite the sales pitch for anyone considering a move.<p>Here's what happens in the middle of a big Haskell project.<p>1) Take some existing code.<p>2) Refactor (Add a feature, change a record element, etc.)<p>3) Run ghc, then fix all the errors it reports. Repeat this step as needed.<p>4) Done.<p>What would be different in python? For one, no compile errors means very little. How many test cases would you need? How would you find all the places the code must change?<p>Lesson: A tough, smart compiler can be the programmer's best friend.<p>Meta-lesson: There is little need to discuss laziness, purity or static typing to "sell" Haskell. They are enablers of ghc. What you need is a big, complicated code base and an urgent need to make changes to it. You won't have that until you get your feet wet.<p>Is Haskell perfect? No, but I'll save that for an OP that is overhyping the language.
dons超过 12 年前
Remarkably content-free.
pcote超过 12 年前
The merits of functional programming techniques are a lot more interesting than the languages that implement them, "pure" or not. Closures, first class functions, and list comprehensions are interesting topics of discussion. Java vs. Haskell not-so-much.
评论 #4501149 未加载
SeanDav超过 12 年前
I by no means want to start any kind of religious war but I feel that Scala has kind of eclipsed Clojure. I tend to notice more Scala skills required in real life projects than Clojure.<p>This is just my opinion as someone that knows neither Scala nor Clojure and without any axe to grind in this debate.
评论 #4501377 未加载
debacle超过 12 年前
Functional languages historically suffer from weak libraries. Languages built on the JVM can side-skirt that issue quite a bit.
marawuti超过 12 年前
This has been a thoroughly fascinating read. The attitudes towards development are echos from the late '70s and the '80s. The wheel of incarnation is still turning guys &#38; gals.<p>Since the economics of systems have not changed much (70% of the cost of a system is in maintenance) I find it humorous that nobody has mentioned making code clear for the poor maintenance (enhancements, refactoring) schmuck. Everyone including the hoodwinked managers are focusing on the "window of opportunity" a.k.a lost opportunity cost of getting the project done - to market. This is as wrong headed now as it was in the '80s.<p>Unless you are writing one-off systems that have a real world, crucial deadline - think new scud detection techniques during the 1st gulf war [done in Lisp BTW] - just focus on making systems that can first and foremost be comprehended quickly by someone else. You're working in a team. Right? All the rest of the hyper-fast development hoopla is self aggrandizing and for the most part a waste.<p>I must admit though that the reminiscences of the days of "feeling like an artist" contained in this thread bring back heady memories. I hear the egos of me and my prior associates sprinkled throughout this thread.<p>Bon chance.
joe_the_user超过 12 年前
Well,<p>What I would say about Functional Languages isn't that they're over-rated but they are mis-rated if they are described as means of replacing the abomination that is Object Oriented Programing (which I use every day).<p>I would free acknowledge that functional programming constructs are powerful methods to concisely specify complex, <i>well-behaved</i> systems. I use arrays of function pointers and similar things when I want to create such a subsystem in a c++ program I'm working on (obviously not using full fp but it still give power-galore).<p>The thing that FP isn't is means to tie two huge, horrible systems together (or accomplish similar tasks). And while fp might indeed be used to create a number of elegant systems, if fp is unable to beat back the forest of horrible, inelegant systems around us, it isn't going to replace OO and it isn't going to get wide adoption. Because OO may be awful but has the quality that if used judiciously, it can made ugly stuff somewhat less ugly.
评论 #4501562 未加载
评论 #4500484 未加载
zem超过 12 年前
it always surprises me when erlang is lumped in with the other functional languages. i know it technically qualifies as one, but if i had to round up the "mainstream" fp languages, i'd put ocaml, haskell, scala and clojure in one group, and erlang off to one side by itself.
评论 #4507283 未加载
nirvana超过 12 年前
I look forward to the day when Hacker News moves beyond these "my language is better than yours" articles written by third rate programmers.<p>In his first paragraph it makes it clear to me that he didn't understand the nature of any of the languages he originally discarded, and he discarded them <i>because</i> he didn't understand them in sort of a "its too hard or my brain, therefore they suck!"<p>Which sets a really poor stage to then hear that Clojure is the second coming.<p>I'm neutral on clojure- but in my experience, every time I learn a new language, for awhile it feels like the second coming, because if its a good language it has a reason for being, and in the scope of that reason for being, it really is the second coming.<p>The problem-- and what makes this guy a third rate programer-- is the latching onto that language and it becoming your blub language.<p>He decries FP as a fad and offers instead, a language specific fad.<p>Seriously, dude? When you step up to the level where language is less important, and it constrains your thinking less, then you'll step up to the next level of programming ability.