Haskell as a first language.

A place to discuss the implementation and style of computer programs.

Moderators: phlip, Moderators General, Prelates

LakatosIstvan
Posts: 87
Joined: Tue Jun 03, 2008 5:54 pm UTC
Location: Sector ZZ9 Plural Z Alpha
Contact:

Haskell as a first language.

Postby LakatosIstvan » Wed Sep 01, 2010 9:41 am UTC

There's a young friend of mine, really intelligent chap with a thing for science and math and stuff, and who came up to me yesterday and asked me about programming in general, computer science related topics, him being interested on learning how to program on his own, and asked me what I think a good starting language would be (His school doesn't offer CS classes).

At first I was thinking of recommending Python, seeing how "convenient" it is for the beginner programmer, but then I thought of recommending Haskell, which I started to learn not so long ago. Being familiar mostly with imperative style programming, Haskell was a bit "exotic" and hard to comprehend for me, but seeing that his mind is "untainted", I guess Haskell would be a good starting language for him, amiright?

Any thoughts, guys?
Sir_Elderberry wrote:Cords are not just bendy cylinders. They are flexible, animate beings possessed by spirits whose intentions are beyond our ken. They are Cthulu's tentacles intruding on our reality.

keeperofdakeys
Posts: 658
Joined: Wed Oct 01, 2008 6:04 am UTC

Re: Haskell as a first language.

Postby keeperofdakeys » Wed Sep 01, 2010 10:47 am UTC

I would say that imperative would actually make more sense in general, as in the concepts of 'do one thing, then this thing'. If he is gonna do any coding soon (as in university or high school), then it might be better to go with python so he can learn imperative programming concepts earlier; but if he has plenty of time then haskell might be a fun experiment (but you might want to make him aware of the existence of python, and show him the differences so he understands.)

Personally I started in python, and am trying to get into haskell. One thing that I learned when I was learning python, is that it is really fulfilling if you can make a program that does 'something', where 'something' is something that had seemed totally impossible earlier. Good luck.

User avatar
headprogrammingczar
Posts: 3072
Joined: Mon Oct 22, 2007 5:28 pm UTC
Location: Beaming you up

Re: Haskell as a first language.

Postby headprogrammingczar » Wed Sep 01, 2010 11:53 am UTC

How about both? Teaching two ways of thinking will be a bit slower, but worth it later on, when he can clearly see similarities and differences between the two approaches.
<quintopia> You're not crazy. you're the goddamn headprogrammingspock!
<Weeks> You're the goddamn headprogrammingspock!
<Cheese> I love you

Killamus
Posts: 163
Joined: Sun Jan 24, 2010 3:26 am UTC

Re: Haskell as a first language.

Postby Killamus » Wed Sep 01, 2010 2:00 pm UTC

Why does everyone recommend python? Hardly the best starting language. If you teach someone python, then they're probably not going to learn the underlying things that it does for you. You'll learn to code, and that's it, but you'll only be able to code in Python, you won't get any of the cross-language principals that you're forced to learn if you do a lower-level language, like C/C++ first. I can attest to this first hand, too. My first language was C#, and I really, really regret it. Once I learned C, I started understanding what I was doing, not just doing it because it worked (This was furthered when I learned assembly, but I'm not mean enough to actually recommend it). As for teaching Haskell, I honestly don't know if it'd be a good idea. Teaching a functional language instead of an imperative one when they're first learning a language actually seems like a good idea, but then again, most of the market today is imperative languages* (C/C++, Java, Python, etc).
*Disclamer: I'm not saying that there isn't a market for functional languages, quite the opposite. Just considerably less then that of the imperative market size.

cogman
Posts: 112
Joined: Sun May 18, 2008 2:17 pm UTC

Re: Haskell as a first language.

Postby cogman » Wed Sep 01, 2010 2:15 pm UTC

Killamus wrote:Why does everyone recommend python? Hardly the best starting language. If you teach someone python, then they're probably not going to learn the underlying things that it does for you. You'll learn to code, and that's it, but you'll only be able to code in Python, you won't get any of the cross-language principals that you're forced to learn if you do a lower-level language, like C/C++ first. I can attest to this first hand, too. My first language was C#, and I really, really regret it. Once I learned C, I started understanding what I was doing, not just doing it because it worked (This was furthered when I learned assembly, but I'm not mean enough to actually recommend it). As for teaching Haskell, I honestly don't know if it'd be a good idea. Teaching a functional language instead of an imperative one when they're first learning a language actually seems like a good idea, but then again, most of the market today is imperative languages* (C/C++, Java, Python, etc).
*Disclamer: I'm not saying that there isn't a market for functional languages, quite the opposite. Just considerably less then that of the imperative market size.


Amen.. I personally hate python as a programming language. I really can't think of one thing that it does well. Its easy? So is VB, Its interpreted? so is perl, php, ect. It has diverse libraries? So does every other language on the planet (C++, C, Java, any .Net language, ect). The only reason I can think of starting with python is that it will later teach you how the syntax of different languages is different.

As for haskell as a first language.. Meh. Depends on what he wants to do. If he is looking at the math behind computer science, then sure. But if he is looking to do SERIOUS programming, then teach him an imperative language. There just isn't a big job market for functional programming.

User avatar
phlip
Restorer of Worlds
Posts: 7569
Joined: Sat Sep 23, 2006 3:56 am UTC
Location: Australia
Contact:

Re: Haskell as a first language.

Postby phlip » Wed Sep 01, 2010 2:19 pm UTC

Guys, leave the arguing to Religious Wars, and get back on topic.

Code: Select all

enum ಠ_ಠ {°□°╰=1, °Д°╰, ಠ益ಠ╰};
void ┻━┻︵​╰(ಠ_ಠ ⚠) {exit((int)⚠);}
[he/him/his]

User avatar
Berengal
Superabacus Mystic of the First Rank
Posts: 2707
Joined: Thu May 24, 2007 5:51 am UTC
Location: Bergen, Norway
Contact:

Re: Haskell as a first language.

Postby Berengal » Wed Sep 01, 2010 3:07 pm UTC

Familiar with math, but no programming experience you say? Haskell should be very easy to teach in that context. Much of his math knowledge and experience can be replicated in Haskell easily, introducing the basics of programming (syntax, running the interpreter, types, lexical closures) in a familiar context. Thanks to the functional model being close to mathematics, "hard" concepts like assignment, looping and arrays can be left out without rendering the language useless, using already familiar concepts like recursion and inductively defined structures (e.g. sequences) to achieve the same effect. Imperative programming is also fully possible in Haskell, so when it's time to introduce that you already have a familiar environment where everything except the important new concepts are already known. Imperativeness can also be explained functionally through e.g. the State monad, extending the state to the RealWorld "type" to explain the IO monad.

You won't neccessarily get any instant awesomecool programs this way, but that's certainly not a given with any other language either. I personally also don't think they're neccessarily a good way to teach programming, other than making sure the student stays interested for long enough to become proficient. Another issue with teaching Haskell is that most texts, blogs and tutorials are targeted at people who already know how to program in imperative languages, or they're more formal university-level texts. I can't off the top of my head think of any texts particularly suitable for teaching it as a first language to teenagers. This means you might have to do some extra work yourself (or he could be smart enough to grasp the more formal texts despite the unfamiliar format).

tl;dr: Haskell benefits from being close to mathematics, a framework he's already familiar with.
It is practically impossible to teach good programming to students who are motivated by money: As potential programmers they are mentally mutilated beyond hope of regeneration.

User avatar
headprogrammingczar
Posts: 3072
Joined: Mon Oct 22, 2007 5:28 pm UTC
Location: Beaming you up

Re: Haskell as a first language.

Postby headprogrammingczar » Wed Sep 01, 2010 3:52 pm UTC

Learn You a Haskell is probably the best beginner's tutorial. It isn't entirely complete, and is technically aimed at experienced programmers, but it goes into detail, repeats important stuff, and introduces concepts in the right order.
<quintopia> You're not crazy. you're the goddamn headprogrammingspock!
<Weeks> You're the goddamn headprogrammingspock!
<Cheese> I love you

User avatar
Berengal
Superabacus Mystic of the First Rank
Posts: 2707
Joined: Thu May 24, 2007 5:51 am UTC
Location: Bergen, Norway
Contact:

Re: Haskell as a first language.

Postby Berengal » Wed Sep 01, 2010 4:12 pm UTC

LYAH is pretty good, but it doesn't cover the very basic concepts of programming very well; the things you learn in the first two weeks, only to spend at most one more week conciously thinking about before "forgetting" them. It also lacks goods excercises for newbies.
It is practically impossible to teach good programming to students who are motivated by money: As potential programmers they are mentally mutilated beyond hope of regeneration.

Pepve
Posts: 57
Joined: Wed Jul 28, 2010 9:47 am UTC

Re: Haskell as a first language.

Postby Pepve » Wed Sep 01, 2010 5:33 pm UTC

This thought may be a bit radical, but why not ask him? Don't underestimate his ability to choose what suits him best. Maybe the thought of calculating prime numbers exhilarates him, maybe he's imagining the worlds best audio player. I'm sure you can explain what these languages (and a couple more) do for the programmer, and probably give better examples than mine of what they enable a programmer to do.

Btw, i started with mIRC scripting. It never held me back when i wanted to learn more/achieve something else. I've now a become a respectable (and paid) Java programmer.

mouseposture
Posts: 42
Joined: Tue Sep 15, 2009 2:42 am UTC

Re: Haskell as a first language.

Postby mouseposture » Fri Sep 03, 2010 1:05 am UTC

Pepve wrote:This thought may be a bit radical, but why not ask him?

The only really practical answer. I hope your friend chooses Haskell.


Return to “Coding”

Who is online

Users browsing this forum: No registered users and 12 guests