Java Programming language
public class Hello {
public static void main(String[] args) {
System.out.println("Hello, world!");
}
}
Scheme Programming language
(display "Hello World")
As you can see both are quite different. For example scheme uses prefix notation with parenthesis while Java uses a C like syntax. Also Java forces a object oriented system down your throat. The advantage to a prefix notation is that it is easly understood what does what. Display acts upon the argument "Hello World" and displays it. Java on the other hand makes you use the object system integrated in the language. That is one of the reasons that the Java program is much larger. This doesn't mean that Scheme can't have an object system but it could possibly have.
No comments:
Post a Comment