Live data from Hacker News

Java vs. Scheme in Education

innoq.com

21–30 of 41 posts

Re: Java vs. Scheme in Education

#21
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…

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.

Re: Java vs. Scheme in Education

#22
post #21

Earlier quoted context omitted.

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…

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

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

Re: Java vs. Scheme in Education

#23
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?

There's a difference between professionally programming and learning to program.

You shouldn't ever find yourself in the situation where you think an IDE is magical and "javac" is a typo of the word "java".

Re: Java vs. Scheme in Education

#24
post #4

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[]) { ...

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)

Re: Java vs. Scheme in Education

#25

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.

Same point PG made in one of his essays about text editors vs IDE's. With the former you learn and master the language, with the latter you learn the editor and features like code completion substitute for mastering the language.

This is utter bull, even if PG said it. I've learned a huge amount about Java by using an editor (Intellij) that has real time static analysis of my code and points out when I'm making common mistakes with corners of the language (calling overrideable methods during object construction, for example). It's incredibly useful and informative.

Re: Java vs. Scheme in Education

#26

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

Best quote ever ;-) I'll start using it immediately.

Re: Java vs. Scheme in Education

#27
post #22
post #21

Earlier quoted context omitted.

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

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

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

http://stackoverflow.com/questions/3265357/compiled-vs-inter...

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

Re: Java vs. Scheme in Education

#28

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…

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.

Re: Java vs. Scheme in Education

#29
post #21

Earlier quoted context omitted.

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…

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

The barrier to entry is certainly higher for Java, C++ and C than it is for, say, Scheme or even Python. Of all, I think Java has the highest barrier to entry. I have taught both Java and C++ to beginners (using the C subset with C++ I/O).

Several weeks into the semester for Java, a student asked me what "public static void main" meant. I started giving him the correct answer when I stopped myself: his background did not prepare him to even understand my answer. I then told him, "I'll give you the real answer in a moment, but don't worry if you don't understand it. For now, it's the magic you have to tell the compiler to get your program to work."

I call it "magic" because it is something the student have to write without understanding what it means; for them, it is indistinguishable from a magic incantation. The less magic a student has to recite to get a working program, the lower the barrier to entry.

Post reply on HN