4 ms·
> Their lack of preconceptions regarding programming might make Haskell much easier for them to pick up, than it would for a student with experience in another
by seanmcdirmid 12y ago
> Their lack of preconceptions regarding programming might make Haskell much easier for them to pick up, than it would for a student with experience in another language.
Or traumatize them forever away from the field of programming.
> Would they think Python was stupid or would they be grateful that all of a sudden they could use a for loop?
I would love to know the answer to this, regardless of my own biases. But Haskell really does require discipline to use, and the kids would probably appreciate the more lax nature of Python.
- MarcScott 12y agoIt's an experiment that I'll never run. CS exam requirements are geared towards OO languages. Students have to analyse and write pseudocode using traditional programming constructs.
- seanmcdirmid 12y agoWhat are CS exam requirements? Are they standardized? I went through the American system, and never had any of my tests biased to OOP (except of course, a Smalltalk chapter in one PL zoo class). Object thinking is easier to wrap one's head around than mathematical formal thinking, but that's just because the former uses the brain's innate linguistic hardware (we learn to talk without much effort) while the latter requires training and practice.
- gamegoblin 12y agoPerhaps the commenter is referring to the AP computer science class, which I think is pretty OO based? In my experience at least.
- MarcScott 12y agoI teach in the UK. Here's the spec for one of our GCSE courses. http://www.aqa.org.uk/subjects/ict-and-computer-science/gcse/computer-science-4512 http://www.aqa.org.uk/subjects/ict-and-computer-science/gcse...
- ucarion 12y agoThe current AP standards focus a lot on OOP. Here's the latest course description: http://media.collegeboard.com/digitalServices/pdf/ap/ap-computer-science-a-course-description-2014.pdf http://media.collegeboard.com/digitalServices/pdf/ap/ap-comp...
- pjmlp 12y agoIn which countries? Just had a look at the curriculum of the Portuguese university I graduated from, a couple of decades ago and they still teach OOP, FP, LP across multiple languages.
- mpweiher 12y agoAt the TU-Berlin, our intro courses were held in FP languages, and we were indoctrinated as to the incomparable superiority of the approach...and could see for ourselves how the reality diverged from the hype. That was a good 20 years ago, but I just ran into a current student who told me that's still the case, and they still hate it as much as we did.
- 59nadir 12y agoSeems like your university is doing it wrong. While I do believe that the principles used in FP languages are vastly superior I don't think this is really a matter of debate. The advantages are obvious and if you didn't realize it you probably weren't taught well enough. On topic: I sometimes wonder if the wins from FP languages are lost on the people not already scarred by the pitfalls of imperative programming. I wonder the same about someone starting with Python instead of something more wordy and cumbersome. I don't think you really can appreciate the ease of use if you haven't already written tons of boilerplate or type information because the compiler is stupid. At the same time you don't know the price of the ease you're getting, so there is a warped perspective on both the ease of programming and the performance of languages. Haskell, I think, exists in a sort of middle ground where it's actually really fast but extremely expressive. Maybe someone uninitiated in programming won't have as many problems formulating functional solutions to problems in Haskell too.
- mpweiher 12y agoThat's exactly the kind of hair-raising and mindless (in the truest sense of the word) nonsense we were presented with: "the superiority of FP is not a matter for debate". The reality was that the tools were slower and buggier than others, the programs different (and slower) but no simpler and the bugs different but stilly just as buggy. When presented so mindlessly and categorically, any claims of superiority instantly lose credibility. When reality is taken into account, even more so.
- 59nadir 12y agoThe principles used in FP are actual principles you could employ in imperative languages... and people do, because they are obviously good. It's a matter of there actually being principles instead of the alternative; nothing. This aside, you seem to be talking about the languages themselves, so let's go ahead: > the tools were slower Which tools are these? I don't see this as a systematic failure of FP languages. Which language were you presented with? Did they explain what you're trading your speed of execution for? I'm asking these questions because it doesn't really seem like you got it and this supposedly being 20 years later it seems like you're purposefully not getting it. In these discussions I find that a lot of people believe FP proponents to be very unpragmatic, but I find that in most cases, such as this one, there is little to no concession made on the "other side". Most FP languages are not suitable for performance sensitive tasks and most people will admit this. For most other tasks, though, they're just going to allow you to work faster and get to where you're going with less hassle. I would like to point out that I'm not saying FP languages are just better overall or that an FP language is always the best choice, but I am saying that the principles they employ and teach undeniably are the best. The alternative isn't as much a principle as it is a lack of principle. Flipping individual switches and modifying memory is just not caring.
- fractallyte 12y agoHere's a relevant comment I made just yesterday: https://news.ycombinator.com/item?id=7956162 https://news.ycombinator.com/item?id=7956162 In short, Scheme (Racket) is regarded as a superior beginner's language because of its simplicity, together with the ability to explore various paradigms (including OO). Beginners in Scheme subsequently did better with Java than those who started solely with Java. I think there's a deep lesson in that...
- seanmcdirmid 12y agoBut scheme/racket is really not that far off from java compared to Haskell. I've never had a hard time working with it, even though I've never learned it formally (ok, two weeks of LISP a long time ago). Racket never felt weird, and many of its API are OO in everything but name, it's like C# with the same amount of FP abstractions (list comprehensions), and maybe some macros and continuations if you want to do something advanced. But Haskell really is functional programming, there is no way to accidentally create an easy to use OO-style library. And then there are the monads....
- steveklabnik 12y agoMonads are pretty simple if you aren't pre-emptively primed with "monads are really hard." I remember the day I sat down, worked through some examples, and grokked monads. I said, "That's it?" That's not to say that they can't be hard to learn. I just don't think that they're _inherently_ hard to learn, and I think that they're sufficiently different enough from 'more traditional' CS concepts that said other concepts can hamper your ability to learn them. I suggest http://homepages.inf.ed.ac.uk/wadler/papers/marktoberdorf/baastad.pdf http://homepages.inf.ed.ac.uk/wadler/papers/marktoberdorf/ba... if you're still trying to figure them out. Fun story: one time I had to suddenly explain monads to an English professor, because she overheard me say the word and said, "wait, Leibnitz?"
- klrr 12y agoI'm a teen I guess. Haskell as a first language worked great for me, and I happened to write a game and a few scripts in Python two months ago so I think I can answer your question. So, what made learning Haskell a good experience I think was mainly the strong type system. You could basically even early on use functions you barely knew what its name meant solely based on its type signature. It also made the progress of writing a program very nice, you write it and then it fails, you go back and try fix it, and when it compiles it usually worked. There are some things to keep in mind though. Wild recursion is really the GOTO of functional languages, it's important to teach how to use the generalized folds and traversals early on. Secondly it is important to have simple analogies to concepts such as functors, monoids and monads etc. If you make sure to not care about these strange names then you can go pretty far by just trying to make the type signatures stick together, and it's not important for a beginner to grasp these directly either. Python was quite smooth to learn coming from Haskell, the syntax is similar and it simply felt like programming in Haskell's do-blocks. It was very easy to get quickly going, I managed to write a little script talking to a JSON API almost directly after reading the official tutorial. I also digged a little bit into the realm of OOP, I wrote a simple game using Kivy. It felt quite nice actually, I could get some code re-use, although it was harder to get that (as newbie) than in Haskell. EDIT: Something like typed Racket might been even better when I think about it, since Racket got a lot of resources for complete beginners. Then you get the benefit of easy to use syntax too, although syntax is probably not the biggest problem when starting out. For the record I usually recommend Python or Racket when people ask me where to start, because in the end I don't think it matter much what language you go with first, just make sure not to limit the paradigm of languages you learn afterwards.
- codygman 12y agoThanks for sharing your experiences! I've always been curious about this.
- Dewie 12y ago> Or traumatize them forever away from the field of programming. The same can be said about using Python et al as the first programming language. How many people quit an introductory course to programming because they didn't like (say) the style of programming in Python, but could get an interest in it if the language being taught was some FP one (or maybe a logic programming language, etc.)? It's kind of hard to tell, because students who get turned away from an introductory course on programming probably aren't going to look up (or even know about) "programming paradigms" and see whether there are alternatives. Granted, how long would these people survive in the job market if they were able to be "traumatized" by some imperative language? There are certainly more imperative language jobs (or, they tend more to imperative style than FP style) in the job market, it seems. But even if they wouldn't like working as a programmer, they can still use it as a hobby if they like.
- seanmcdirmid 12y agoNon-math will always be more accessible than math. Unless you are teaching a bunch of mathematicians, then perhaps they would prefer the formal FP approach. Python is nice because you don't need to know about category Rory to get started.