
Java vs. Scheme in Education - Garbage
http://www.innoq.com/blog/st/2011/03/java_vs_scheme_in_education_1.html
======
Apocryphon
Asking as a CS major who first learned C, then C++, and didn't touch LISP and
Prolog until the upper divs, how difficult is it to learn a functional
language as your first programming one? Wouldn't it be trippy? When I first
learned that Berkeley students had to learn Scheme first, it made me think of
them as hardcore... though I may be overestimating its difficulty.

~~~
masklinn
> how difficult is it to learn a functional language as your first programming
> one? Wouldn't it be trippy?

As easy as learning a dysfunctional one if not easier.

Now scheme may not be the best example of this as its syntax is entirely alien
(then again all syntax is, when you've never developed), but the canonical is
the following statement:

    
    
        x = x + 1
    

If you've never developed before, the only place where you've seen something
like this is maths, and in maths _this is completely nonsensical_.

So learning imperative programming does require lots of deprogramming and
reprogramming of your brain. Which make up _most_ of the hurdles of learning
an FP (or logic, or dataflow, ...) language later on: your brain (or its
section that has to do with development) has been baked in imperative idioms
and methods, FP languages not only don't use these but use completely
different techniques to solve the same problems, so you have to "unlearn" the
old ones and "relearn" the new ones.

~~~
scott_s
I can corroborate that for people with no prior programming experience, but a
significant math background (engineers, stat and math majors), the statement
"x = x + 1" is befuddling to them. They have no concept of _time_ in a
sequence of imperative statements. That is, they don't intuitively understand
that statements get executed, and that the state of the program changes
(potentially) after each statement. It takes real effort on their part to
internalize this idea.

Now, I'm sympathetic to your final paragraph, but having never taught
functional programming to anyone, I can't corroborate it. Personally, I went
through something similar when first learning how to think functionally.

------
CyberFonic
"As I see it, a software engineer who hasn't worked through SICP with Scheme,
a basic editor and command line, is like a surgeon who has never dissected a
frog and faints at the sight of blood." -- Priceless !!! Great comment,
Stephen.

~~~
bulte-rs
I'd better get my mint copy of SICP off the bookshelf then. Being a SE able to
dissect frogs and not faint at the sight of blood apparently doesn't mean
anything these days ;-)

------
impendia
I do remember playing with Scheme in freshman CS. It was fun as hell. You type
in (+ 2 7) and it spits out 9. No

void main(String args[]) { ...

~~~
araneae
That's not an insurmountable advantage. In the freshman CS class I took they
started us out with a GUI that had an interactive prompt.

(DrJava)

------
kirbman89
What is Scheme? Sounds cake. We used Putty, Pico, and javac. I take it that
this school is not an engineering school?

------
bugsy
So scheme is better because there is no tool support and with no tools there
is less to be confused by. Hm.

~~~
magicofpi
I think the point is that, with Scheme, the tool you use is less important
than the thinking you do. With Java, you have to worry about your environment
before you can worry about programming.

~~~
Sandman
_With Java, you have to worry about your environment before you can worry
about programming._

You have to download the jdk and set an environment variable. Then open a text
editor. That's about all the 'worrying about the environment' that you have to
do before you can start programming in Java.

~~~
masklinn
No, you also have to think about various command-line tools invocation (java
and javac for starters) and all the boilerplate that goes around what you want
to _write_ (create a file, name it correctly, put the same name inside with a
`class` statement whatever that means, then put braces everywhere and a `main`
and a `String[]` which you don't know jack about) and then you have the joy of
wondering why you don't see anything when you run your program (assuming you
got it to compile and run) and learn about `System.out.*`.

With scheme, you download Racket or whatever (equivalent to downloading the
JDK), you open it, and you start typing and getting instant feedback in your
window.

~~~
Sandman
I'm not sure I understand you. You can't just start typing and getting instant
feedback in Java simply because Java is not interpreted (well, actually, it
is, but you have to compile to bytecode first). So, what you're saying about
Java goes for just about any compiled language.

 _No, you also have to think about various command-line tools invocation (java
and javac for starters)_

Use "javac" to compile to byte code. Use "java" to run your compiled program.
This is all you need to know about these tools to start programming. There are
various options for using java and javac, of course, but it's not like you
can't compile and run a simple program without these options.

As for this part of your comment:

 _create a file, name it correctly, put the same name inside with a `class`
statement whatever that means, then put braces everywhere and a `main` and a
`String[]` which you don't know jack about_

Yeah. You have to know a bit of Java before you actually start programming in
it. If that's one of Java's shortcomings, well then, there are _a lot_ of
languages with the same shortcoming.

~~~
Dn_Ab
_> I'm not sure I understand you. You can't just start typing and getting
instant feedback in Java simply because Java is not interpreted (well,
actually, it is, but you have to compile to bytecode first). So, what you're
saying about Java goes for just about any compiled language.<_

This is not true. There are statitically typed languages, usally functional,
with a read-eval-print-loop. Haskell, Ocaml, SML, F#, Scala are the main ones
I can tink of. There are many more. I will also note that your parenthetical
is slightly inaccurate in that jvms usually JIT bytecode and don't just
inteprete it straight.

~~~
Sandman
After googling for a while, I found this great answer on SO:

[http://stackoverflow.com/questions/3265357/compiled-vs-
inter...](http://stackoverflow.com/questions/3265357/compiled-vs-interpreted-
languages/3265680#3265680)

Lunaryom is correct. There are no 'interpreted' and 'compiled' languages, just
different implementations. So, I was wrong in my original post. It would
appear that you _can_ just type and get instant feedback in Java (if you use
Beanshell, for example).

~~~
Dn_Ab
I noticed the possibility of that semantic ambiguity, that is why I switched
to noting static/dynamic typing instead of retaining your distinction on
compiled/intepretated.

