Home Login Create account Contact Help
Close

Login to your account

Other Options

Tags: Code Compare Computer Java Program Programming Python Versus

Python VS. Java

Which introductory programming language is better?
Java or Python?



Log in to post an argument Subscribe to feed
Rank order
Python
Very easy to use, easily packaged into an .exe
Rob Cakebread argues...
Thu, 27 Mar 2008 by cakebread
Rank 1. Average +1.0 ( 2 votes )
This simple example shows that you can start learning Python immediately without concepts such as classes.
Since this topic is specifically about which is better as an introductory language, I'll simply show the first example code everyone learns. Here's how you print "Hello world!" to the screen in both Python and Java:

Python
print "Hello world!"

print "Hello world!"


Java
public class HelloWorld
{
    public static void main (String[] args)
    {
        System.out.println("Hello, world!");
    }
}

public class HelloWorld
{
public static void main (String[] args)
{
System.out.println("Hello, world!");
}
}


This simple example shows that you can start learning Python immediately without concepts such as classes.

Any site that where people are posting source code will have some sort of 'code' tag to keep your formatting. When I pasted the Java code above without the CODE tags, it looked terrible. Not like anything you'd show to someone learning a language, so the argument about Java being "easily posted on websites" is rather silly.

Anyone teaching Java is going to have their students indent properly, so please, lets just leave Python's meaningful whitespace out of this one.

[ Edited code tags for syntax highlighting - admin ]
Java
Easily posted on a web site, more widely used
Steven Dieckmann argues...
Fri, 28 Mar 2008 by wiseguy149
Rank 1. Average 0.0 ( 0 votes )
Sorry, I meant that an applet can be easily added to a web page, not the source code.