Why this comparison ? Is it really Java vs Python ?
Some people say, “this comparison is between Apartment vs Flat”. Some people say this comparison is “Mango vs Orange” and some other say this comparison should not be done at all. Then what this post is about ? To answer question Java vs Python which one to choose first ?
To find the Myth and what is truth
Few popular sentences in comparison of Java Vs Python in 2020
Most common one “Python is easier than Java”.
Another popular sentence “Start learning programming from Python “.
Another here ” Freshers should not start from Python”.
Few also say ” There is no job in Java for freshers “.
Some never afraid to say “Some survey says Python is the future of IT “.
And a million dollar sentence ” Java is going to die “.
And ” Python is the first choice for hackers “.
Blah Blah……
Whom should we believe ?
Python is easier than Java !
Both Java and Python are Object Oriented high level programming language. Both languages have wide range of use.
Python : Loosely typed Programming language. Means , we do not need to declare variables during writing the Python program. The data type of variable gets decided during execution time or run time.
Example of variable use in Python
height=10 # height is of type int height="10feet" # height is of type str height=10.5 # height is of type float
Example of variable use in Java
int height=10; // height is of type int and it remains int height="10feet"; // ERROR- Can not assign String to int type height=10.5;// Error-not possible double value to int type
Sometime it become advantage for few cases and few other cases it becomes disadvantage.
Java is a compiled language and Python is interpreted. Java Compiler gives error while writing above type of code. We do not get any error while such code even it is a mistake while writing code.
Let us have a look at writing “Hello World” program in Java and Python
Minimum lines of code to write “Hello World” program In Java
Demo.java
public class Demo { public static void main(String[] args) { System.out.println("Hello World"); } }
Output
Hello World
Minimum lines of code to write “Hello World” program In Python
Demo.py
print("Hello World")
Output
Hello World
Conclusion : In Java vs Python comparison, python programs are easier to write as compared to Java.
Should newbie Start learning programming from Python ?
Algorithm for solving a problem through a program is the main aim of a programmer. It does not matter which programming language you use as far as performance is not compromised. Sometime, newbie programmers run away from programming by looking at initial toughness of writing program. Python needs less number of lines of code as compared Java, so the programmers feel easy to write the program and mostly never scare of programming.
Conclusion : Given a choice between Java vs Python to start learning programming, python should be the first choice for its easy learning curve . This could one answer for- Java vs Python which one to choose
Freshers should not start from Python ?
This is completely a myth, a programmer can start programming career from any programming language. In above sections we have already seen it. It is very much possible to start from Python .
There is no job in Java for freshers !
Java is there in the industry for more than 2.5 decades. Java is everywhere is the punch line for long long time. Lot of applications have been created and lot are in the pipeline.
Java can be used for :
- Graphical User Interface (GUI) development.
- Web application with wide variety of framework ecosystem.
- Mobile or Android application which has occupied 85% of mobile app market.
- Most of the enterprise application development.
One of the Most popular Job portal’s like Naukri search results says for freshers’ requirement in Java as follows
10,7,988 Java Fresher Jobs In India
See the below screen shot on 17th Aug 2020 from Naukri.com
Another Most popular Job portal’s like TimesJob search results says for freshers’ requirement in Java as follows.
2990 Job Found on Java Freshers in India only even in Corona period.
See the below screen shot on 17th Aug 2020 from Timesjobs.com
Conclusion: There is no shortage of freshers’ job in Java.
Some survey says Python is the future of IT !
Python is a programming language which is not new. It is older than Java. Python’s first version came long back in 1990. Where as Java’s first version came in 1996. In recent past python become more popular as compared to any other language. Python has very high amount of API or library function for AI/ML/Data science.
Python can be used for
- Graphical User Interface development
- Web Application development with support of popular framework like Django.
- For Machine Learning application
- For Data Science algorithm
Lets have the same search in same portals for Python
One of the Most popular Job portal’s like Naukri search results says for freshers’ requirement in Python as follows
46,636 Python Fresher Jobs In India
See the below screen shot on 17th Aug 2020.
Another Most popular Job portal’s like TimesJob search results says for freshers’ requirement in Python as follows.
1711 Job Found on Java Freshers in India only even in Corona period.
See the below screen shot on 17th Aug 2020 from Timesjobs.com
Final Conclusion to find – Java vs Python which one to choose
Both Java and Python are having good demand for freshers and as well as experienced people. As far as Indian Job in freshers’ world is concern, Java has little higher side. But, Python has a promising future as the AI/ML/Data Science use increases.
In our team of developers/technicians point of view, a developers should learn both of these.