Live data from Hacker News

Ask HN: Programming language power and 10 years to mastery

news.ycombinator.com

11–20 of 44 posts

Re: Ask HN: Programming language power and 10 years to mastery

#11
post #6

I can't comment on Lisp, but I've been working with Haskell for about a year or so now, so I'll cover that instead. My personal history goes something like QBasic -> Visual Basic -> PHP -> Java -> C# -> Haskell. Since Haskell is a purely functional language there's no cheating like you could in, say, OCaml. This forces you to learn how to work with immutability, which I have become a big fan of. When working with C#…

If you're doing FP in C#, why not use F#? It's not Haskell, but it's a step closer.

Re: Ask HN: Programming language power and 10 years to mastery

#12
post #6

I can't comment on Lisp, but I've been working with Haskell for about a year or so now, so I'll cover that instead. My personal history goes something like QBasic -> Visual Basic -> PHP -> Java -> C# -> Haskell. Since Haskell is a purely functional language there's no cheating like you could in, say, OCaml. This forces you to learn how to work with immutability, which I have become a big fan of. When working with C#…

Is your Haskell.cs file published somewhere?

Re: Ask HN: Programming language power and 10 years to mastery

#13
post #5
post #3

Check out the book 'The Little Schemer'. Good way to ease your mind into functional programming. Also consider learning a dynamic 'scripting' language like Ruby or Python. They have some functional aspects, and will teach you programming style and idioms that you probably haven't picked up from Java and C.

Oh and if you plan on doing anything web-related, learn Javascript (properly!) - this will also expose you to functional programming technique. http://javascript.crockford.com/little.html

Crockford's videos up over here: http://developer.yahoo.com/yui/theater/ are extremely useful, too. A little bit dry, but he knows his stuff.

It's interesting to point out that, while not optimized for it, Javascript (don't think ruby can do this, since you can't pass blocks to blocks) can perform tail recursion: http://warfangled.com/js_examples/fib.js

Re: Ask HN: Programming language power and 10 years to mastery

#14
post #6

I can't comment on Lisp, but I've been working with Haskell for about a year or so now, so I'll cover that instead. My personal history goes something like QBasic -> Visual Basic -> PHP -> Java -> C# -> Haskell. Since Haskell is a purely functional language there's no cheating like you could in, say, OCaml. This forces you to learn how to work with immutability, which I have become a big fan of. When working with C#…

Is your Haskell.cs file published somewhere?

No, I mostly make a new one per project. All the functions are pretty much one-liners anyway, so it's not too much work to make. It's more of a documentation thing; anything in Haskell.cs can be assumed to work exactly the same as its Haskell equivalent.

Re: Ask HN: Programming language power and 10 years to mastery

#16
post #11
post #6

I can't comment on Lisp, but I've been working with Haskell for about a year or so now, so I'll cover that instead. My personal history goes something like QBasic -> Visual Basic -> PHP -> Java -> C# -> Haskell. Since Haskell is a purely functional language there's no cheating like you could in, say, OCaml. This forces you to learn how to work with immutability, which I have become a big fan of. When working with C#…

If you're doing FP in C#, why not use F#? It's not Haskell, but it's a step closer.

I've tried it a bit, but I found the syntax rather ugly compared to Haskell. I know, I'm nitpicking and it really shouldn't matter that much, but it put me off the language. Perhaps when they finally release a full-blown implementation of F# for Visual Studio I'll give it another go. My main reason for still using C# at the moment is the UI integration with WPF and Windows Forms. Ideally there'd be an actively maintained Haskell.NET, but perhaps F# can serve as a compromise when Visual Studio 2010 comes out.

Re: Ask HN: Programming language power and 10 years to mastery

#17
I also recommend "Javascript: The Good Parts". It and the jQuery library can teach you a lot about how Javascript is really a functional language with more in common with Lisp than with C++ or Java.

A second excellent book is "Higher Order Perl", which shows how Perl, also, shares a lot more in common with Lisp than most developers realize. I'm on my 13th year as a professional developer and 27th as a hacker, and I still find some of the concepts in HoP challenging.

I would also recommend learning XSLT. It's pure declarative, side-effect-free programming. If you're used to procedural code (including OOP), or even functional code, you'll still have to reattach your head sideways to learn to use XSLT effectively. It's well worth the challenge; there are problems that would be very difficult to handle in other languages which XSLT handles with ease; it's a powerful tool for your toolchest.

Re: Ask HN: Programming language power and 10 years to mastery

#18
I found SICP was better for learning to "think functionally". PCL and On Lisp were both great in their own right, but idiomatic CL isn't as strictly functional as idiomatic Scheme tends to be (and neither enforces it like Haskell and Erlang do).

As for improving my skills, that's an unequivocal yes. I think the biggest eureka moment came when I understood the idea of first class functions. That opened many doors to better code.

Before, I used functions primarily like a writer uses paragraphs: to break up the narrative into chunks. After SICP, I saw functions more like (for lack of a better term) filters. They transform their input into output. The transformation is well defined, and the natural boundaries between functions become clear rather than arbitrary.

Re: Ask HN: Programming language power and 10 years to mastery

#20
post #3

Check out the book 'The Little Schemer'. Good way to ease your mind into functional programming. Also consider learning a dynamic 'scripting' language like Ruby or Python. They have some functional aspects, and will teach you programming style and idioms that you probably haven't picked up from Java and C.

I concur. The big advantage to picking up one of these Lisp-like languages (rather than Lisp itself) is that with their corresponding web-frameworks (Rails and Django), you will be able to put up some pretty cool apps pretty quickly. This helps your motivation as well as your bottom line personal ROI (they're both pretty marketable skillsets). I don't think you lose all that much, as far as the experience of picking…

I wouldn't call Rails and Python "Lisp-like languages."
Post reply on HN