top | item 821194

Ask HN: C or Haskell, which to learn next?

2 points| andrewvc | 16 years ago | reply

I've been programming for about 5 years now. I started with Perl, then moved to Ruby, then Javascript, then learning some PHP. Ruby and Javascript are my main languages. I didn't go to college, so I didn't go through a formal CS curriculum, and I'd like to learn some stuff I feel I missed out on. I've narrowed down my choices to C and Haskell at the moment.

Haskell seems to be the most practical of the functional languages from what I hear, but there aren't really any web dev applications for it that are in serious use so far as I can see. That said, functional programming would be a great way for me to learn about alternate programming paradigms.

C on the other hand I can think of projects I can do in it, but it doesn't seem as much of a leap as Haskell does, which makes me wonder if it'll be as good a learning experience. What does the HN community think would be a good next step?

7 comments

order
[+] cperciva|16 years ago|reply
Learn C. So far you've done lots of high level languages, but no low level languages at all. Understanding what things look like at the machine level will make you a much better developer regardless of what language you end up using -- and there's a reason why people refer to C as "portably assembly language".

I often say that nobody ever understands when they should and shouldn't use hash tables until they've written a hash table in assembly language; you don't necessarily need to go to that extreme, but working in C at all will give you a much better understanding of fundamental algorithms and data structures than if you only ever use high level languages which hide such details away from you.

[+] andrewvc|16 years ago|reply
Thanks for the advice, I'm taking it.
[+] cousin_it|16 years ago|reply
Haskell offers a lot of brain candy, but IMO you've already gained >50% of its benefits by understanding Ruby blocks - they're actually the most useful part of functional programming, carefully distilled and packaged to be non-threatening. :-) Better go with C first to learn what your computer actually does. When you go on to play with Haskell afterwards, you'll at least ask the right questions about the implementation.
[+] mTh|16 years ago|reply
You can learn also Delphi. Is covers all the ranges from very high-level till machine language. Also, it has a much cleaner syntax vs C, you can also have a real job with it (unlike Haskell), and is has a huge community from where to learn from.

Drawbacks are: not so popular compared with C (but waaaay more popular compared with Haskell), not so functional compared with Haskell. Far better compared with both ones WRT web development (there's a very powerful library shipped OOTB for this) - especially when it comes to manage complex session states. OTOH, isn't really a web tool, it's rather a high-performance RAD environment with main focus on native (compiled) code and DB development. Other drawbacks are: - you must know that you should ask the community where to find good libraries and examples - the free edition (Turbo) is outdated. But there are trials.

[+] zv|16 years ago|reply
Go for C. C is here to stay.
[+] icey|16 years ago|reply
They are different enough that you could just do both simultaneously.
[+] Hipponax|16 years ago|reply
You should use javascript to learn functional programming.