I have to take a course on Scheme next semester at my college and I
know nothing about the language. My only background is intro c++, and
pascal. I was wondering if anyone could compare scheme with the
languages that i know already.
From what i've read so far I have absolutely no idea on how to
comprehend the syntax etc.. It makes no sense.
Is it math oriented? Because at schemers.org i noticed some references
to math, ie. the logo. I am not too fond nor highly skilled in math. I
know my stuff, but not advanced. Does this language use heavy math?
I just wanted to know because I have a choice of taking the next level
C++ programming course, or intro to scheme. Whichever will be easier,
because lets face it, it's not getting any easier to get accepted into
Computer Science faculties these days. Well, from where i'm from
anyways.
I just need some information from you guy with experience. Like how
difficult is SCHEME in comparison to C++? Is it easier? harder?
Any info would help me. Thanks!
They're so different that it's hard to make a direct comparison, IMHO.
>From what i've read so far I have absolutely no idea on how to
>comprehend the syntax etc.. It makes no sense.
>
>Is it math oriented? Because at schemers.org i noticed some references
>to math, ie. the logo. I am not too fond nor highly skilled in math. I
>know my stuff, but not advanced. Does this language use heavy math?
Scheme has some interesting mathematical features, such as built-in
rational numbers and unlimited precision integers, but its math functions
are pretty much the same as most other languages.
Scheme (and the entire Lisp family of languages) is more oriented towards
handling complex data structures or designing novel control structures.
>I just wanted to know because I have a choice of taking the next level
>C++ programming course, or intro to scheme. Whichever will be easier,
>because lets face it, it's not getting any easier to get accepted into
>Computer Science faculties these days. Well, from where i'm from
>anyways.
If learning new computer languages is not easy for you, do you really think
that Computer Science is the right field for you?
>I just need some information from you guy with experience. Like how
>difficult is SCHEME in comparison to C++? Is it easier? harder?
It's different. If you're familiar with languages like C++ and Pascal, it
can be difficult to get rid of some preconceptions about the relationships
between variables and their values, which are not quite the same in
Scheme. You have to try to forget much of what you already know and start
fresh in the Scheme mindset.
--
Barry Margolin, bar...@genuity.net
Genuity, Woburn, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.
Well, a few weeks ago, I started in much the same boat as you. I started
learning Scheme with experience in languages like Pascal and C.
From what I've learned in the past few weeks, the difference between
Scheme and the languages you know is not really in terms of syntax,
(though programs in Scheme DO look much different than programs in C++)
but in terms of how you *think* about the problem you want to solve.
In the procedural languages like Pascal, programming is a matter
of telling the computer:
1. Do this
2. Then do this
3. Then do THIS 10 times
And that's about it. The set of "things to do" gets bigger, the loops
get more elaborate and all hell breaks loose when you miss a semicolon,
but that's the basic idea.
With Scheme, you can learn a new way of thinking about problem solving.
Instead of thinking "what do I do?", you can learn to think "How do
I define the answer to this problem?"
And that's not the only new way of thought you'll learn. In the
three weeks I've been learning the language, here's a list of some
of the interesting concepts that I've picked up:
* The concept that a function can be passed around just as easily
as, say, an integer. You can use functions as parameters to other
functions, you can generate a function as the value of an expression,
and more.
* The idea that functions don't have to have names. Just like you don't
have to assign the number 10 the name "ten" to use it, you don't have
to give a function a name to use it. Not even when defining things
recursively.
* How the shape of the data you're working with often reflects the shape
of the program that manipulates it.
* How to *really* abstract a concept and separate it from its representation.
* I actually have learned to love recursion, formerly a source of fear
and loathing. I now see it as an amazingly useful tool to solve
certain types of problems (this is related to the point about the shape
of data reflecting the shape of the program)
* The difference between a variable and its value, and the difference
between a variable and the type of data held in it
* The relationship between iteration (those lovely for loops) and
tail recursion
* How easy it can be to write a basic interpreter for a computer language!
Before recently, I had thought of interpreter and compiler writing as
something beyond comprehension, short of a huge investment in studying.
Now I understand some of the principles and it just doesn't seem
scary anymore.
And this is just in a few weeks, in my spare time after work!
In short, learning Scheme has taught me many, many things
about programming which I never understood before. If you
take that Scheme course, which I think you should, it will teach you
new ways to think, making you a much better programmer overall.
Oh, and once you've read a good introduction to the language, the
syntax will become quite clear (see the bottom of this message for
a couple of recommended books.)
> Is it math oriented? Because at schemers.org i noticed some references
> to math, ie. the logo. I am not too fond nor highly skilled in math. I
> know my stuff, but not advanced. Does this language use heavy math?
Nah. That lambda symbol has to do with the Lambda Calculus, a
formal system for manipulating functions (as I understand it) which
Scheme is based on. It's only a math-oriented language in that
it lets you think in a very precise way about your programs.
Put aside any fears about having to deal with concepts like the
Fundamental Theorem of Calculus. :)
> I just need some information from you guy with experience. Like how
> difficult is SCHEME in comparison to C++? Is it easier? harder?
The Scheme course may be harder, but at the end, you'll be much
better off. It's kind of like exercise; It'll help build those
mental muscles, which you can then go off and use anywhere.
Incidentally, I *now* find programming in Scheme to be much
easier than in the other languages I know.
So, it's well worth the effort. You'll be able to learn all the stuff
I've mentioned above, as well as a number of other really interesting
topics. That's probably the best thing about it - it makes programming
fun and fascinating!
Oh and by the way, if you want to get a leg up on the language, I
can suggest two good books for you.
First, How To Design Programs, which you can buy, or see on the web at
http://www.htdp.org (the web version is missing a few tables/diagrams
that the print version has, but is otherwise quite good)
Second, The Schemer's Guide, which you can order from
http://schemers.com/tsg.html
This is the main book that I have been using, and can recommend it
quite highly as an introduction to both the language and the thought
processes which underlie it.
Best of luck,
--Andrew
george wrote:
>
> Hi everyone,
>
> I have to take a course on Scheme next semester at my college and I
> know nothing about the language. My only background is intro c++, and
> pascal. I was wondering if anyone could compare scheme with the
> languages that i know already.
Big question.
> From what i've read so far I have absolutely no idea on how to
> comprehend the syntax etc.. It makes no sense.
Easy grammar but hard to read. Don't worry too much, it'll come with
time.
> Is it math oriented? Because at schemers.org i noticed some references
> to math, ie. the logo. I am not too fond nor highly skilled in math. I
> know my stuff, but not advanced. Does this language use heavy math?
Just the semantics used to reason about programmes. If you haven't read
anything about operational or denotational semantics then you've managed
to write c++ without worrying about the maths.
> I just wanted to know because I have a choice of taking the next level
> C++ programming course, or intro to scheme. Whichever will be easier,
> because lets face it, it's not getting any easier to get accepted into
> Computer Science faculties these days. Well, from where i'm from
> anyways.
I can't see how you couldn't benifit as a computer scientist from
learning another way to express algorithms. Take the scheme course and
don't worry too much about it, just listen and learn. If it is a good
course then you'll end up doing stuff in scheme that you never could
imagine. It would then be hard to go back to Pascal or c++ without
trying to do stuff in a scheme way. Your eyes are probably going to be
opened.
> I just need some information from you guy with experience. Like how
> difficult is SCHEME in comparison to C++? Is it easier? harder?
There is a learning curve with all languages. Most of them start of hard
then get easier (except prolog!). Relax big man, it'll all turn out
allright.
[...]
> I just need some information from you guy with experience. Like how
> difficult is SCHEME in comparison to C++? Is it easier? harder?
Scheme is a *much* easier language to learn than C++ if you don't get
hung up on how different it is. I think the other thing that may make
Scheme seem more difficult is that Scheme lends itself to tackling hard
problems better than C++ does. So teachers tend to use it that way.
-thant
C and Pascal are almost the same language. C++ adds some
OO stuff, but otherwise it's pretty much the same. They
are what are called "imperative" languages, in that your
program is a list of instructions, or imperatives, to be
carried out in a particular order.
Scheme is much closer to being a "functional" language, in
that your program becomes a nested series of function
applications (where functions operate on both "simple"
data such as numbers and "complex" data such as vectors
(which you know from pascal as "arrays") and functions
and vectors containing functions) and you don't even have
to care what order the functions you're using in other
functions get called in.
In scheme, there is not a clear distinction between data and
program. A particular variable can be a function as easily
as it can be an integer. I often write functions that return
other functions that return other functions.... in scheme. I
often store functions in arrays or pass them as parameters to
other functions. Basically, a scheme program is a collection
of definitions linking names to values, or handling unnamed
values. Some of the values are executable and some aren't.
> From what i've read so far I have absolutely no idea on how to
> comprehend the syntax etc.. It makes no sense.
Scheme's syntax is actually quite simple. Each scheme expression
is either a simple value (a number, string, character, or whatever)
or an s-expression. Each s-expression has an opening parenthesis,
a scheme expression that evaluates to a function or special form,
zero or more other scheme expressions (arguments to the function
or special form in the first position), and a closing parenthesis.
That's it. That's all there is to it. What schemers usually mean
when they talk about syntax is the "special forms" I mentioned above.
The difference between special forms and functions, at first glance,
is that special forms can specify whether and when their arguments
are evaluated. Things like (if) and (and) are special forms, or
"syntax", whereas most of the other predefined things, such as (+)
and (-), are procedures. There is one very important special form
named (lambda), which returns a procedure. There is also a special
form named (define-syntax), which allows you to create rewrite rules.
These rewrite rules let you create your own special forms by specifying
how an expression starting with a keyword you pick will be rewritten
before it gets run. It's not nearly as important as lambda, and in fact
not needed for most programming tasks.
Lambda is very fundamental, and understanding it will give you insight
into programming in every language.
> Is it math oriented? Because at schemers.org i noticed some references
> to math, ie. the logo. I am not too fond nor highly skilled in math. I
> know my stuff, but not advanced. Does this language use heavy math?
Mathematicians like it because scheme's numbers behave the way
mathematicians expect. They also get into the whole deal with
manipulating functions as data. But if you're not into heavy
math, the scheme programs you write won't use heavy math. Nothing
about the language requires it.
> I just wanted to know because I have a choice of taking the next level
> C++ programming course, or intro to scheme. Whichever will be easier,
> because lets face it, it's not getting any easier to get accepted into
> Computer Science faculties these days. Well, from where i'm from
> anyways.
>
> I just need some information from you guy with experience. Like how
> difficult is SCHEME in comparison to C++? Is it easier? harder?
Whether it's easier or harder depends on how you think. I
didn't have a problem with recursion or functions-as-data,
so it was tons easier for me to pick up than C++ was. In
scheme, you've basically only got about four different types
of punctuation to keep track of, so I found the syntax easier.
But my buddy Tony, who's very bright and thought C++ was
easy, got seriously blocked on it, spent several weeks trapped
in his nightmares in a "lisp monastary", and wound up barely
passing. Tony and I are both very bright, and neither one of
us are slouches at computer science or computer programming.
But we think differently, and scheme was easier for me and C++
was easier for him.
Bear
Don't get me wrong - I *love* Scheme, and I believe the world would be much
better if Scheme was state of the art. I did all of my graduate school work
in Scheme. That was the fun part. Ever since I've been in business, I've
done C/C++. That's the reality.
It's just ironic; even though I love Scheme and would love to have more
people scheming in business, I would hire somebody with C++ experience
instead of somebody who knows Scheme. The reasoning is completly
schizophrenic, but throws an interesting light on business reality:
C++, at the end, is harder to learn than Scheme. "Simple" C++, i.e.
straightforward OOP on top of C, is not hard (assuming that you already know
C), can be learnt fairly quickly. However, "advanced" C++, such as using or
having to understand copy constructors, overloaded operators, multiple
inheritance etc is a pain in the butt - very prone to extremly subtle
errors, sure recipies for resource leaks, not always integrating well w/
low-level OS primitives etc. That's why my C++ work in practice leaves this
out completly. I code in C when it comes to embedded controller design.
Unfortunately, in practice, you'll need to work with third party libraries
such as XVT which (ab)use all of those weird features, and sooner or later,
any engineer who works w/ C++ professionally will need to understand these
(in comparison to Scheme) overcomplicated features. Along the way, a lot of
code will have gone down the drain.
Thus, as a hiring manager whose task is to make sure that "good" (ie
working) code is produced fast, I'd have to make up my mind: A Scheme fan
will probably approach C++ from a different angle, possibly traverse the
learning curve a little faster than somebody who comes from, say, VB, but
will nevertheless eat up more costs getting up to speed than somebody who
already knows C++ really well.
This is not to contradict what has been said before. I agree that as a
professional software developer, the question what language to learn is
rather secondary; once in business, you *have* to be able to learn a new
language on the fly (typically, your manager will put a spec on your desk on
Monday, give you a few days to play around with it, and expect you to start
using the system by Friday). For this purpose, Scheme is great; the Scheme
philosophy is more comprehensive, and once you know Scheme, it'll be easier
for you to grasp the concepts of other languages. However, keep practice and
real business requirements in mind. If you graduated today, it would
probably not make any difference what your background is; the shortage on
engineers is so severe (at least in Germany it still is) that you can get a
job anyways. However, chances are that you'll need to learn C/C++ or Java
anyway, and if the job market changes in a few years, experience my be the
factor that makes a difference. To hope that by then Scheme is the state of
the art is unfortunately a little bit unrealistic.
So what does that tell you as an answer to your question? If I were you, I'd
first learn Scheme. It's a lot of fun, and, as said before, it gives you a
good "overall" picture which is a good foundation for future learning of
programming languages. Once you are close to graduating, you should try to
get a feeling for what the market needs and steer a little bit in that
direction. If you then get a job that leaves you the freedom to do Scheme
either on the side or even for production code - FANTASTIC!
(P.S. My personal settlement: The production-level code if write is C/C++,
but all "fringe" coding, such as test suites and utilities, is done in
Scheme. This way I keep in touch with Scheme but don't fall into the dilemma
that somebody else posted here last week - having to downgrade the code for
a non-Scheme successor).
HTH,
RAc
"george" <fal...@hotmail.com> schrieb im Newsbeitrag
news:d8528e07.01110...@posting.google.com...
> Hi everyone,
>
> I have to take a course on Scheme next semester at my college and I
> know nothing about the language. My only background is intro c++, and
> pascal. I was wondering if anyone could compare scheme with the
> languages that i know already.
In many ways Scheme is very similar to Pascal, but easier to learn.
> From what i've read so far I have absolutely no idea on how to
> comprehend the syntax etc.. It makes no sense.
Syntax? What syntax?
> Is it math oriented?
No, but some texts (such as SICP) are. Same as Pascal, really.
> I just need some information from you guy with experience. Like how
> difficult is SCHEME in comparison to C++? Is it easier? harder?
Far far easier. Which means that the instructor, if he's competent,
will have plnty of time to get into some actual program design stuff,
rather than just spending the whole time getting you to put semicolons
in the right place and explaining the difference between a copy
constructor and an assignment operator, or why you can't have a virtual
constructor, or whatever.
-- Bruce