Live data from Hacker News

Java vs. Scheme in Education

innoq.com

11–20 of 41 posts

Re: Java vs. Scheme in Education

#11

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.

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

Re: Java vs. Scheme in Education

#12
post #8

Earlier quoted context omitted.

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.

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.

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.

Re: Java vs. Scheme in Education

#13

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.

You are overestimating its difficulty. It is actually the other way around: C and C++ are harder than Scheme since you have to deal with all kinds of silly syntax rules, inconsistencies (from the view of a Schemer), memory management, pointers and other diversions.

It is akin to writing a text in your favourite text editor versus writing a text in Word. The latter will distract you with mark-up, random auto-'correction' and other diversions I'm still repressing.

The best thing one can do is get The Little Schemer[1], download DrRacket[2] and go through the book.

[1] http://mitpress.mit.edu/catalog/item/default.asp?ttype=2&#38...

[1.5] http://www.ccs.neu.edu/home/matthias/BTLS/

[2] http://www.racket-lang.org/download/

Re: Java vs. Scheme in Education

#14

"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.

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 ;-)

Re: Java vs. Scheme in Education

#15
post #9

Earlier quoted context omitted.

That's really not fair. To start, beginning Java developers (or developers of any language) shouldn't be using a full IDE. Anything more than syntax highlighting (yes, even compiling for you), and you're losing important steps. That said, the amount of boiler plate code to do anything in Java can make it quite confusing... though, Scanner has made the input easier, and System.out.println() doesn't seem too much more…

I don't see the point of your argument. You say Java developers should intentionally cripple themselves, because they're losing "important steps". What does that even mean? I don't see why I'd lose rename, automatic inherited method shells, auto imports, generate constructors/getters/setters etc... When you buy a car, do you insist that it has manual windows and no power steering?

"When you buy a car, do you insist that it has manual windows and no power steering?"

But when you are learning how a car works and trying to build one, you would start off with one with manual windows and no power steering.

Re: Java vs. Scheme in Education

#16
post #8

Earlier quoted context omitted.

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.

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 an…

This is where vb6 shines. With vb6 you don't have to worry about anything! :)

Re: Java vs. Scheme in Education

#17

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.

> though I may be overestimating its difficulty.

The difficulty could be due to the brain damage C++ causes. Before I get incinerated, I have to remind you of Dijkstra quote about BASIC ("mutilates the mind beyond recovery").

Both BASIC and C++ (and Java, Smalltalk and so on) fixate several ideas about computing that make it harder to understand very different concepts. In a sense, that qualifies as mild brain damage.

I learned programming with BASIC on an Apple II+, went through FORTH (GraFORTH), C, Pascal, APL (The write-only language) and FORTRAN (in college) and later learned OOP with Smalltalk (and worked a bit with Actor). Did a lot of VB too (I had bills to pay), Perl, Java and Python. For obvious reasons, I don't completely agree with Dijkstra on the BASIC thing. I never liked C++ much, possibly because I learned OOP with Smalltalk and C++'s OOP seemed to me a misappropriation of the acronym. All things considered (it took me 8 years and a job offer to decide to learn C++) Smalltalk damaged me beyond recovery.

Re: Java vs. Scheme in Education

#18
post #13

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.

You are overestimating its difficulty. It is actually the other way around: C and C++ are harder than Scheme since you have to deal with all kinds of silly syntax rules, inconsistencies (from the view of a Schemer), memory management, pointers and other diversions. It is akin to writing a text in your favourite text editor versus writing a text in Word. The latter will distract you with mark-up, random auto-'correcti…

But after you learn C you have a ton of stuff to unlearn before you can use Scheme properly.

Re: Java vs. Scheme in Education

#19

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.

Scheme(or LISP dialects in general) is not just functional; it's multiparadigm. It sure is trippy, but gives a very solid foundation for later stages of academic and professional life.

Re: Java vs. Scheme in Education

#20

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.

My school taught Haskell as the intro language to math majors, and my basic observation was that people who had never programmed before and people who where really good at programming already got it pretty quickly. On the other hand people in the middle that had programmed a bit before and where competent, but not great, where really confused and never really got it.

In the second half of the course, where you learnt Java and OO, was totally confusing to most those who'd just learnt Haskell as their first language and many people who got great grades on the Haskell part failed the Java part.

So it would seem that whatever you learn first is easy and normal and whatever you learn after that is confusing and difficult.

Post reply on HN