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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Hello Haskell, Goodbye Scala

100 点作者 nullobject超过 12 年前

16 条评论

amm超过 12 年前
For personal projects or for learning the principles of FP, there is nothing wrong with using Haskell.<p>From personal experience however, I will not be using Haskell again for a larger professional project, because our team ran into too many time consuming issues and problems that have been solved successfully in other languages/environments (especially the JVM) like dependency management or reasoning over runtime characteristics before deploying the application on production systems. Especially memory consumption is very hard to predict.<p>Of course, the language also has its benefits and even after some years it tickles your brain just the right way.<p>I like programming in Haskell very much, but in real world projects (you know - when you work in a team not only consisting of PhDs) I prefer Scala or Java, because getting a war file deployed or profiling an application is just so much easier.<p>YMMV, of course.
评论 #5096948 未加载
评论 #5097098 未加载
评论 #5096992 未加载
评论 #5098477 未加载
werpon超过 12 年前
I've invested a lot of time in trying to learn Haskell properly.<p>On one hand, it's incredibly rewarding when a completely new and strange concept finally 'clicks', then you write a few lines to test your understanding and it just works.<p>On the other hand, it's frustrating to realize that there are still a lot of concepts you don't fully grasp, several libs that are still out of your reach, yet another completely new way of structuring your code that you are yet to unravel. Essentially, that you are (I am) still a newbie.<p>All in all, I find Scala better suited to learning FP and applying your newly-acquired knowledge to develop mildly useful apps, as quick results usually lead to more motivation. Just IMHO.<p>(Not to mention there are many libs that aren't yet up to par with their JVM counterparts, but that's another can of worms.)
评论 #5097026 未加载
评论 #5096960 未加载
cduser超过 12 年前
I learned F# as this guy learned Scala. I too dived into Haskell after a while and learnt a lot of new things.<p>Having learned some great functional tips, I came back to my regular C#/Ruby and applying LINQ and Ruby's blocks seemed more natural to me. However, monads, monoids, functors still don't matter when you switch over.<p>I've used Yesod to write a small app. A typical form in Yesod (for model binding) has this signature:<p>newPostForm :: Html -&#62; MForm Blog Blog (FormResult (Text,Text,Text), Widget)<p>Even after learning Yesod for a while, I wasn't able to completely reason with that signature. Why bother with all the name of the application, sub site, formresult, widget when all you want is just three simple form fields? Rails gives it to you in params[:form]. It's just too easy in Rails with a lot of gems lying around for every task you decide to do. And when you're stuck, you're just a google away from getting your answer.<p>So my question is: after learning Haskell, do you intend to stick to it? Did I make a wise decision in ditching Haskell?
评论 #5097034 未加载
评论 #5096968 未加载
评论 #5098343 未加载
评论 #5098625 未加载
dkhenry超过 12 年前
I can respect and applaud the man for wanting to learn, When I picked up scala I had the same experience he did. When I went to solve a problem I immediately fell back to the imperative style of programming since that's how my brain has worked for a decade. It has taken real time and effort to _try_ and solve problems in a functional manner. Turns out that's a really good and elegant solution for some problems and a skill that's worth developing. If another language makes that training easier then by all means use it. One of the real benefits of scala is you can be useful in it ( just solving the problem ) while you have all the tooling necessary to make those elegant solutions when you have the requisite skill set to implement them. It would be handy if scalac has a setting like -Werror in C land where non-functional constructs would be flagged in the codebase.
rauljara超过 12 年前
If anyone wants an introduction to functional programming using Scala, I really recommend Martin Odersky's coursera course (<a href="https://class.coursera.org/progfun-2012-001/class" rel="nofollow">https://class.coursera.org/progfun-2012-001/class</a>). He restricts you to functional Scala; there isn't a mutated variable in the whole course. It isn't officially a course right now. You won't get a certificate for taking it, and I don't think the grader is turned on, but the other materials are still there.<p>In my mind, the really mind altering thing was seeing not just that Object Oriented and Functional programming styles could be compatible, but that they were in many ways complementary. Good OO design, particularly the idea of small single responsibility classes, is kind of enforced by functional style. If you need to pass around fifty variables just to increment a counter, you'd go crazy. So writing functionally forces you to figure out ways to split things up. Similarly, its easy to convert well small, single responsibility OO objects into functional ones, and just a nightmare otherwise.<p>I was just blown away at how much a course on functional programming helped me to understand OO design.
评论 #5098809 未加载
评论 #5097579 未加载
评论 #5097513 未加载
评论 #5097220 未加载
pohl超过 12 年前
My own approach to learning FP has been "Hello Haskell", "Hello Scala", "Hello ML", "Hello Clojure", "Hello Rust",...<p>I don't know why you say goodbye, I say hello.
评论 #5098152 未加载
评论 #5098567 未加载
richo超过 12 年前
I enjoyed the read, but I borked at your suggestion that not being purely functional, and the language barking at you if you break that convention stops you learning functional programming.<p>Take most Lisps (I'll assume scheme, because it's what I'm most familiar with), which give you more than enough side-effecty rope to hang yourself with should you so desire- but you won't get far unless you're coding functionally.
评论 #5096957 未加载
评论 #5097580 未加载
评论 #5096801 未加载
happywolf超过 12 年前
Anybody here has developed and deployed a Scala-based or/and Haskell-based project for production? I mean systems for business purpose where rubber meets the road with timeline to hit and budget to meet. Far too often the stories are shared by people who learned a new language for 3 months and implemented a pet system where only a few real users. Definitely I respect their zeal and curiosity, but I am more interested to know what the veterans are thinking
评论 #5097211 未加载
评论 #5098704 未加载
评论 #5097557 未加载
评论 #5097853 未加载
评论 #5097343 未加载
评论 #5098654 未加载
digitalzombie超过 12 年前
Yeah I've tried learning Scala for a year.<p>It was painful, real painful and I felt like I didn't learn much from it.<p>Now I'm learning Erlang and I'm applying what I've learned from Scala to Erlang and wow. I'm glad I took at stab at Scala. Erlang is wonderful btw, it's so simple there are some minor drawback like no string primitive... I also love the fact that there is no loop, it forces me to think recursively. I guess because it's so simple I can just focus on learning the functional part instead of other stuff such as new objects paradigm (traits, etc..), design pattern ("pimp my whatever"), and type. I'm guess once I'm done with this I'll focus on type, thinking Haskell...
aangjie超过 12 年前
While i liked his gumption, I personally thought god i don't want to do that.. I have been playing around haskell on and off, in my free time, and have come to a conclusion that while it's a fun and cool language to play around, it may not be useful(as in career) hobby. It might be categorized as pure fun language learning.
owenjones超过 12 年前
Haskel/Scala has Learn You a Haskell/Scala for Great Good! and Lisp has The Land of Lisp.<p>Are there any _why-esque guides to Clojure and FP in general like these other languages have? I'm unaware of any and consider it surprising given the Clojure communities passion.
willvarfar超过 12 年前
I find it unconvincing. That Haskell deemed is better for learning functional programming for the sake of learning functional programming does not really say much about general usefulness.
评论 #5096824 未加载
评论 #5098673 未加载
deltasquared超过 12 年前
Nice choice! Learn You a Haskell for great good is an excellent book, I learned a lot reading it.
SkyMarshal超过 12 年前
<i>&#62;For christmas I bought myself a copy of Learn You A Haskell For Great Good by Miran Lipovača. Apart from being a great Haskell learning resource, it’s one of the best programming books I have ever read.</i><p>I second that. Miran is a superb technical writer. He also annotates the book with little excerpts from all my favorite movies.
vorg超过 12 年前
Perhaps Scala was built for introducing functional programming gently to Java programmers, with the intention to make them switch to Haskell.
gesman超过 12 年前
Obsessive, compulsive, pure functional disorder. Now drop it all and go and build something.