Live data from Hacker News

Ask HN: Programming language power and 10 years to mastery

news.ycombinator.com

31–40 of 44 posts

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

#31
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've been meaning to read that book, one question, do you really need to know Scheme to be able to read this book? Please enlighten me. Thanks!

No, the little schemer will teach you scheme, or rather a subset of scheme.

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

#32
To answer in sort of a roundabout way, I think the problem domain matters a lot for how much you relatively learn when switching languages.

With web app backends, for example, most of the problems somehow relate to difficulty maintaining state over widespread, always-on networked systems - things like authentication, sessions, concurrency, large-scale, flexible datastores. So the systems architected gradually get more and more tuned towards serving this particular goal with little programmer effort. And because those problems are a good match to functional programming - because it eliminates state - functional has become popular.

But if you were building an embedded system, statefulness is less of a problem: there's usually only one thread, and all memory can be mapped in an orderly way. Your performance constraints are reliant on a single fixed platform, so the methods of inspecting and debugging code change.

So to get back to the original question, think about reframing your familiar problems in a way that would simplify the solution with a functional technique. Preferably, look for simplifications that are really big changes and throw out traditional assumptions - the use of relational databases in webapps is one common target for this. Even if you get it wrong you'll get a better understanding of where the functional solution can and can't work.

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

#33

>the 10 year (or 10,000 hours) road to expertise Why is this figure being bandied about as though it were an actual scientific fact?

Because its a useful ball park.

>a useful ball park

Why do you think so? What actual evidence is there for it?

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

#34

Earlier quoted context omitted.

Python's lead designer is actively hostile to this, actually. (And Rails isn't a language, goshdarnit...) Lua is very Scheme-y, though, much the way Javascript is. While I don't use Ruby much (Python and Lua fit that niche for me), it seems more Lisp-y than Python.

Yes, I did read his post about his basing Python more on C and Algol than functional languages. But then he goes on to explain how and why Python got more functional programming features. Also, I based my assumption that Python is "lisp-like" on a statement I remembered from one of PG's essays: "Each one is progressively more like Lisp. Python copies even features that many Lisp hackers consider to be mistakes. You c…

It's "Lisp-like" in the sense that it's garbage-collected and has an interpreter for incremental development, rather than only being batch-compiled. If PG were a Smalltalk fan, though, he would probably be talking about how every language is getting more Smalltalk-like (the above, plus class-based OO in the core language). It says at least as much about him as it does language design.

Python's lambdas are quite a bit less powerful than any Lisp's, and it doesn't have any tail call optimization. It's like, you can kinda sorta do functional programming in C, you just need to recast function pointers and do manual memory allocation.

Python is carefully designed to encourage programming in a certain relatively straightforward style, and while you can force some FP techniques into it, it doesn't sit well with the rest of the language, and it's kind of unfair to anybody else who will have to deal with the code down the road.

While I don't have much experience working with web frameworks (not my thing at the moment), Python is a very good all-purpose language.

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

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

"Also consider learning a dynamic 'scripting' language like Ruby or Python"

He mentioned he knows Perl, which is arguably the lispiest of the lot (not in syntax, but in sheer number of lisp-inspired features). But perhaps he "knows" Perl in the way that one who knows how to whip up a one to twenty line script to do something simple but repetitive, and then throw it away.

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

#36

Earlier quoted context omitted.

Yes, I did read his post about his basing Python more on C and Algol than functional languages. But then he goes on to explain how and why Python got more functional programming features. Also, I based my assumption that Python is "lisp-like" on a statement I remembered from one of PG's essays: "Each one is progressively more like Lisp. Python copies even features that many Lisp hackers consider to be mistakes. You c…

It's "Lisp-like" in the sense that it's garbage-collected and has an interpreter for incremental development, rather than only being batch-compiled. If PG were a Smalltalk fan, though, he would probably be talking about how every language is getting more Smalltalk-like (the above, plus class-based OO in the core language). It says at least as much about him as it does language design. Python's lambdas are quite a bit…

I gotcha.

Well, I picked up PG's book and was starting on the language, when I came up with a project I wanted to get up and running quickly. So, I figured Django would help me get something going (it was either that or Ruby/Rails).

What I failed to ask, I guess is...is there an equivalent web framework for Lisp? I guess I might have gone in that direction if I knew of one.

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

#37

Earlier quoted context omitted.

Because its a useful ball park.

>a useful ball park Why do you think so? What actual evidence is there for it?

I think the correct question is what actual evidence is there against it?

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

#38

>the 10 year (or 10,000 hours) road to expertise Why is this figure being bandied about as though it were an actual scientific fact?

Because for many folks, myself included, the opinion of a genius such as Norvig is solid enough to be treated as scientific fact.

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

#39

I got into Lisp through Emacs, but more recently I've been understanding it using Clojure. For me, I need to be able to create something tangible. Having access to all the Java libraries gives me a lot of cool things to import, then play around with in functional ways.

I'll second that, especially since you mentioned you already work with java. If you like SQL you might want to look at the recent clojure implementation of datalog:

http://code.google.com/p/clojure-contrib/wiki/DatalogOvervie...

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

#40

Earlier quoted context omitted.

>a useful ball park Why do you think so? What actual evidence is there for it?

I think the correct question is what actual evidence is there against it?

The fact that Gladwell pulled the figure out of thin air?
Post reply on HN