Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which will serve a budding programmer better: A classic book in scheme or a modern language like python?

Tags:

scheme

I'm really interested in becoming a serious programmer, the type that people admire for hacker chops, as opposed to a corporate drone who can't even complete FizzBuzz.

Currently I've dabbled in a few languages, most of my experience is in Perl and Shell, and I've dabbled slightly in Ruby.

However, I can't help but feel that although I know bits and pieces of languages, I don't know how to program.

I'm really in no huge rush to immediately learn a language that can land me a job (though I'd like to do it soon), and I'm considering using PLT Scheme (now called Racket) to work through How to Design Programs or Structure and Interpretation of Computer Programs, essentially, one of the Scheme classics, because I have always heard that they teach people how to write high-quality, usable, readable code.

However, even MIT changed its introductory course from using SICP and Scheme to one in Python.

So, I ask for the sage advice of the many experienced programmers here regarding the following:

  • Does Scheme (and do those books) really teach one how to program well? If so, which of the two books do you recommend?
  • Is this approach to learning still relevant and applicable? Am I on the right track?
  • Am I better off spending my time learning a more practical/common language like Python?
  • Is Scheme (or lisp in general) really a language that one learns, only to never use? Or do those of you who know a lisp code in it often?

Thanks, and sorry for the rambling.

like image 388
Gnats Avatar asked Jul 28 '10 15:07

Gnats


3 Answers

If you want to learn to really program, start doing it. Quit dabbling and write code. Pick a language and write code. Solve problems and release applications. Work with experienced programmers on open source projects, but get doing. A lot.

like image 84
Adam Crossland Avatar answered Oct 22 '22 10:10

Adam Crossland


  • Does Scheme (and do those books) really teach one how to program well? If so, which of the two books do you recommend?

Probably. Probably better than any of the Learn X in Y Timespan books.

  • Is this approach to learning still relevant and applicable? Am I on the right track?

Yes.

  • Am I better off spending my time learning a more practical/common language like Python?

Only if you plan to get a job in it. Scheme will give you a better foundation though.

  • Is Scheme (or lisp in general) really a language that one learns, only to never use? Or do those of you who know a lisp code in it often?

I do emacs elisp fiddling to adjust my emacs. I also work with functional languages on the side to try to keep my mind flexible.

My personal opinion is that there are essentially two tracks that need to be walked before the student can claim to know something about programming. Track one is the machine itself, the computer. You should start with assembly here and learn how the computer works. After some work and understanding there - don't skimp - you should learn C and then C++; really getting the understanding of resource management and what really happens. Track two is the very high level language track - Scheme, Prolog, Haskell, Perl, Python, C#, Java, and others that execute on a VM or interpreter lie in this area. These, too, need to be studied to learn how problems can be abstracted and thought about in different ways that do not involve the fiddly bits of a real computer.

However, what will not work is being a language dilettante when learning to program. You will need to find a language - Scheme is acceptable, although I'd recommend starting at the low level first - and then stick with that language for a good year at least.

like image 34
Paul Nathan Avatar answered Oct 22 '22 11:10

Paul Nathan


The most important parts of Scheme are the programming-language concepts you can pick up that modern languages are now just adopting or adding support for.

Lisp and Scheme have supported, before most other languages, features that were often revolutionary for the time: closures and first-order functions, continuations, hygienic macros, and others. C has none of these.

But they're appearing more and more often in programming languages that Get Stuff Done today. Why can you just declare functions seemingly anywhere in JavaScript? What happens to outside variables you reference from within a function? What are these new "closures" that PHP 5.3 is just now getting? What are "side effects" and why can they be bad for parallel computing? What are "continuations" in Ruby? How do LINQ functions work? What's a "lambda" in Python? What's the big deal with F#?

These are all questions that learning Scheme will answer but C won't.

like image 38
erjiang Avatar answered Oct 22 '22 10:10

erjiang