Pages

Monday, February 15, 2021

Should I Learn Java or Python First?

If you are an absolute beginner, I would suggest that you start with Python, because the syntax is simpler and more concise. In this aspect, it makes Python a more ideal choice for beginners. It will allow you to get a good grasp of the fundamentals relatively more quickly and easily.

To give you an idea of how simpler Python syntax is, here is an example of a simple Hello World program in Python:

print('Hello, World!')

And here it is in Java:

public class HelloWorld {

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

}
Here is another example that shows you how to create what are called variables. In Python, this statement creates a variable named x with a value of 5:
x = 5
Quite simple, right? In Java:
int x = 5;
Still one line, but has a couple more elements involved.

As you can see, the Java versions are much more verbose. This would require a lot of other concepts to be explained first in order for the student to understand such simple examples. With Python, there are much less additional concepts that need to be learned so that the student can focus on getting a good grasp of the fundamentals in a way that would be easier for beginners.

But this is not to say that Python is better than Java. It's also not saying that you shouldn't be learning Java at all. But if you are a beginner looking for a language that can get you started in a relatively shorter amount of time, Python would be a very good choice. And when you start learning Java and other languages, you really won't be starting from scratch, because many of the fundamental concepts are very similar across all these different languages.

If you want to start learning Python, here is a video to help you get started:

No comments:

Post a Comment