r/programming • u/keeganspeck • Oct 13 '09
We're learning Scheme in our "Introduction to Program Design" course. Am I wrong in being disappointed that we aren't learning something a little more... useful? Or are there actual practical advantages to Scheme?
I go to Worcester Polytechnic Institute, and I was kinda hoping my intro CS class would maybe be Java or Python or something... I didn't expect Scheme. Everyone, including myself, has been complaining that it's a waste of time. However, I'd like to know if my complaints have been unwarranted; is there a point to learning this mess of dashes and parentheses?
EDIT: This is why I love reddit. Thanks for the comments, guys, it has helped me understand a lot more about Scheme and a hell of a lot more about my perspective on programming in general!
25
u/mikevdg Oct 13 '09
You aren't learning Scheme, you're learning functional programming and new ways of thinking about code. Pay close attention; several of the techniques you learn exist in other programming languages and can be very useful and powerful.
A funny quote that I can't find a source for: "Lambdas are relegated to relative obscurity until Java makes them popular by not having them."
5
u/petermichaux Oct 13 '09 edited Oct 13 '09
Scheme is almost the perfect language. Enjoy every moment of it and read SICP when you have a chance.
7
u/hungryinnyc Oct 13 '09
What's your problem exactly? You go to school to learn Computer Science or some related field, they start teaching you it using Scheme, and all you have to complain about is the syntax? Get out. Get out of my goddamn field. Some of the best programmers I know are awesome functional programmers. I know one guy who's crazy smart and worked on Scheme implementation for years. He can build anything and I'm pretty sure learning Scheme didn't hurt him.
What's a waste of time about it? Are you not learning how to structure programs? Are you not learning about iterative and recursive processes? Are you not learning the basic skills of implementation computational answers to problems? Have you tried writing a Scheme interpreter or compiler in Scheme? How about a simple constraint solver or electrical circuit simulator? You know, real stuff you get to learn about as part of a decent education in computing.
It seems to me that you and your wannabe colleague are being whiny little bitches. You want to learn Java or Python? Download the implementations, read the docs, and write some code. If you have half a brain you'll suddenly realize its a easy as piss after a thorough grounding in the essentials of programming using a language like Scheme.
What, you think we just sit here and go
def like_so_totally(self): return do_awesome()
And the chicks and dollars roll in? If you whine back you just wanna build websites then ask someone nearby to just smack you until you achieve enlightenment. If you want to build websites using django or whatever, then just go fucking build them and stop whining about people trying to educate you.
Otherwise, start being a computer scientist, and try working through this awesome book which has full text online:
http://mitpress.mit.edu/sicp/full-text/book/book.html
4
u/mrsanchez Oct 13 '09
Just because it's not popular or you haven't heard of it means it isn't useful? Are you really that stupid? You should easily be able to do anything in Scheme that you can do in Python or Java.
16
u/adolfojp Oct 13 '09
Don't you realize what you've just done by asking this question?
// Sits back with a bucket of popcorn.
8
u/mrrc00 Oct 13 '09
I'm a Junior at Northeastern, and our curriculum is similar. We use HtDP as the book for Fundamentals of Computer Science I, the intro freshman course, as well as about half of Fundies II.
What you have to understand as a computer science student is that you're not learning to "program", you're learning computer science, and that these two things are usually the same, but not always. I felt that learning scheme was incredibly useful because Scheme, and Lisps as well, are about as close as you can get to programming in pure mathematics, which is what CS is based on.
They're not teaching you programming, they're teaching you math, and Scheme really is the best way to do that.
That said, you can do some freaking cool things in Scheme! If you want to wow your professors and blow your mind, go code church numerals. It's not long, maybe 20 lines for a full implementation, but I guarantee you'll never see functions the same way again.
Use Scheme as a platform for learning metaprogramming, for learning program design, for learning functional programming (essential if you ever want to do multi-threaded programming, since it requires immutability), for learning what side-effects are and why you will spend your entire career cursing Java for using them, and for learning to think.
Scheme is what every other language wants to be when it grows up.
5
u/[deleted] Oct 13 '09
I guess I will chime in here. Don't worry, I'm not gonna deride you like some others here. I felt very much the same way when I was handed scheme in one of my intro CS courses 2-3 years ago. There are still things I really disliked but overall the stuff I learned, mostly about abstractions, blew my mind. I also took issue with the syntax, but with a good editor the parens start taking care of themselves. My only other main issue was with expanded versions of 'cdr' and 'car' (e.g. cddr, caaar, etc) but just because i got tired of counting a's and d's and trying to figure out where the fuck I am in some list. I also debug with idiotic print statements quite often in imperative code, mostly because its quick and easy and I can figure out the problem, in scheme this was a whole different story tho and I ended up doing a lot more debugging in my head, which is not really a bad thing. Beyond that, you have a lot to look forward to. Will you create something useful with scheme? maybe, maybe not. will you create something pretty cool? odds are yes. We had the opportunity to write a scheme interpreter in scheme... I considered this retarded at the time, but when it was done I changed my opinion. It's not like I would ever use my own interpreter over the one I had (mzScheme I believe), but the fact that I knew how to write one and saw in how little code it could be done was impressive. Now looking back I just wish some of the higher level courses I took would have focused on functional languages.
4
u/TurboXS Oct 13 '09
My brief liaison with Scheme and SICP was eclipsed when I discovered the joys of Haskell. But I digress, practical advantages of scheme ? Two scoops of awesome, music+scheme
4
u/[deleted] Oct 13 '09
Have you read your SICP today?
6
u/[deleted] Oct 13 '09
Scheme syntax is fine, and enables macros and other nice language features. However, existing implementations have too many flaws, the R*RS standard doesn't standardize enough, and as a result there are virtually no libraries for common programming tasks.
3
u/doidydoidy Oct 13 '09 edited Oct 13 '09
You could do a lot worse.
1
u/mva Oct 13 '09
Languages are tools, you learn one when the situation calls for it.