News for hackers. Stuff that matters.

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

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 | 2 points | on HN )
Re:Ask HN: C or Haskell, which to learn next? by cperciva on Monday September 14, 2009 @02:34AM (#821211)
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.

Re:Ask HN: C or Haskell, which to learn next? by andrewvc on Monday September 14, 2009 @10:06AM (#821657)
Thanks for the advice, I'm taking it.
Re:Ask HN: C or Haskell, which to learn next? by cousin_it on Monday September 14, 2009 @10:57AM (#821758)
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.
Re:Ask HN: C or Haskell, which to learn next? by mTh on Monday September 14, 2009 @05:31AM (#821380)
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.

Re:Ask HN: C or Haskell, which to learn next? by zv on Monday September 14, 2009 @04:55AM (#821349)
Go for C. C is here to stay.
Re:Ask HN: C or Haskell, which to learn next? by icey on Monday September 14, 2009 @02:16AM (#821198)
They are different enough that you could just do both simultaneously.
Re:Ask HN: C or Haskell, which to learn next? by Hipponax on Monday September 14, 2009 @06:13AM (#821412)
You should use javascript to learn functional programming.