Live data from Hacker News

Ask HN: Programming language power and 10 years to mastery

news.ycombinator.com

1–10 of 44 posts

Ask HN: Programming language power and 10 years to mastery

#1
I've been thinking about the intersection between the variability in programming language power and expressivity (as discussed by PG in http://www.paulgraham.com/avg.html) and the 10 year (or 10,000 hours) road to expertise.

I’m around year eight of hacking away professionally and bumped against the dramatic power differential in programming languages when I primarily became a database developer. I started "thinking in sets" and found that I was much more effective. SQL got more work done in fewer lines of code in a simple way than hooking up my J2EE java junk via JDBC in more traditional programming. But it took the direct use of SQL for a couple of years before the experience pushed my coding to the next level. Much of this benefit was due to the fact that the apps I worked on were really data driven and "fit" the relational data model well, coupled with the fact that I was in a role that allowed me to do architecture design and low level implementation. And tear the design and implementation apart to do it again after finding all the nuances in the app and data.

The switch from imperative programming languages to a declarative programming language to take advantage of SQL has made me curious about Lisp and functional programming. I have an idea for a web app and I’ll use it as a vehicle to test out Lisp. Worst case, I pick up a language that purports to have almost mystical powers (all hail the mighty macro). Best case, a nice startup could grow out of the project. But the real point is to get real hands-on experience with a more powerful language than the standard C, Java, Perl, and SQL stuff I’ve already done. Plus, I’d hate to miss out on some key part of a hacker’s personal growth over that 10 year march . . .

That’s a lot of background to get to two simple questions.

Do any of the HN readers have any tips or advice on speeding up the transition to "thinking in Lisp"? I’ll probably be hacking away using Practical Common Lisp and On Lisp as my guides (SICP is probably somewhere in the mix). Have any of you followed a similar path as you head towards a decade of hacking and did the Lisp (or other fp language) dance grow your skills in a big way (ie, now I’m a faster developer in general or better algorithm designer or communicator of code ideas)? It would be great to hear specifics.

Thanks.

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

#2
Common Lisp changed the way I program because the macros open your eyes to a whole lot of code duplication that you can't avoid in other languages - this encouraged me to really work at those bits of code until they actually contain the bare minimum of boilerplate code possible.

Haskell changed the way I program because laziness can allow you to express your code in much clearer and simpler ways - this encouraged me to use more memoization.

Functional programming is definitely where we want to be in theory, so if practice permits, use it!

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

#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.

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

#4
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 up a functional paradigm goes. (This last bit is not fully backed up by experience with Lisp on my part.)

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

#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

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

#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# I try to avoid mutability as much as possible (naturally this is quite a bit uglier than in Haskell, but it does avoid some problems). Most of my C# projects now acquire a Haskell.cs file fairly quickly, containing things like a Tuple class, zip, >>=, etc.

In the time I've spent learning it, Haskell has quickly become my favourite language. It's not perfect (my current main wishes are existential types and an extensible record system), but it is considerably less painful than the other languages I know.

As for speeding up the transition, I can't offer anything other than just diving in. At some point it will just click and you will wonder what all the commotion is about (another monad tutorial? why?). Granted, I still don't have the slightest idea about why I would want to use a hylomorphism or what to do with a comonad, but perhaps I will some day. Fortunately you don't need them in everyday Haskell programming :)

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

#7
in pcl ch3, the author demonstrates using cl instead of sql for database

afaik hn doesn't use sql/rdbms either, i guess it's because threaded forum is better suited using a tree-like data structure instead of simple table

i stopped using sql (after reading pcl and seeing the fact of hn) and just having a lisp process running, writing to disk every 5 mins

i'm now experimenting with nginx's proxy_pass and upstream to many lisp unix sockets (weighted round robin)

virgin territory for me, it's quite fun so far ... foolish and hungry :D

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

#8
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

or just use jquery

it's the lispiest (or fp) framework i used (i used prototype before and it felt like java)

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

#9
post #7

in pcl ch3, the author demonstrates using cl instead of sql for database afaik hn doesn't use sql/rdbms either, i guess it's because threaded forum is better suited using a tree-like data structure instead of simple table i stopped using sql (after reading pcl and seeing the fact of hn) and just having a lisp process running, writing to disk every 5 mins i'm now experimenting with nginx's proxy_pass and upstream to m…

The PCL database is a very simple in-memory database with no indexing. It's intended as an example of the power of the language, not really as something you'd want to use.There are other databases for CL, including pure-Lisp data stores and interfaces to SQL databases.

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

#10
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 "Javascript: The Good Parts" is also a nice little read.

http://www.amazon.com/JavaScript-Good-Parts-Douglas-Crockfor...

Post reply on HN