Java vs Python
Tags: javascript, python, computerscience, beginners
Published: 2021-04-12 18:30:24

Hello Guys, Welcome back to another post of **Sai Ansul's Blog**.
In this blog we are gonna find which programming language is better.

So let's start,

Firstly let us know what is programming? <br>
Programming is the way we can make the computer perform various tasks.

What is programming language? <br>
It is a formal language to perform various tasks, there are several protocols and algorithms to be followed.

Let us know the types of programming languages:


- Procedural Programming Language. 
- Functional Programming Language. 
- Object-oriented Programming Language. 
- Scripting Programming Language. 
- Logic Programming Language.

Some names of programming language are:
 
- C++ Language. 
- C Language. 
- Pascal Language.
- Python Language.
- Java Language.
- Perl Language
- Lisp Language

## The Comparison Factors are <br>
- Speed<br>
- Legacy<br>
- Code<br>
- Practical Agility<br>
- Trends<br>

## 1. Speed

![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1614613345245/zTg0kFpcL.png)
In the terms of speed Java is faster than Python as it is a compiled language, so it takes less time to carry out the program as compared Python is an interpreter language and it takes more time than Java language to carry out the program.

## 2. Legacy
![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1614613782923/7cbAl7gJf.png)
 
Java's legacy problems are typically larger and more numerous than python’s .
Python has less legacy problem so world finds difficulty for the script to copy and paste codes and gives it a slight edge over the other languages.

The other confusion that arises when we say that the two languages that is which one is easier between Java & python. So let’s have a look at the number of lines required while writing a code in both the languages.

## 3. Code
![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1614614056196/VedCUfUbD.png)
Java is very talkative as compared to Python. It takes 10 lines of code to read from a file in Java.
Python only takes 2 lines of code in Python. This makes Python a more preferable language.

## 4. Practical Agility

![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1614616253879/zbH93Al2K.png)
Java enjoys more support than python thanks to its static type system and universality of IDE’s in development. It is more popular for mobile and web apps.
Python has an existence in the talent space and is considered to be the most favorable language for Machine Learning, Artificial Intelligence, Internet of Things and a lot more.

## 5. Trends

![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1614616478560/PkqM5SUSL.png)
While not as trendy as Java was, it is still the most popular programming language by virtually any measure. On the other hand, Python’s growth has been astronomical, especially in developed, high-income countries. The reasons for this amazing growth include developer productivity, language flexibility, library support, community support, and ease of learning.

Now with this, we come to an end of this comparison on Java vs Python. Python has a slight edge over Java and wins the battle in most of the factors. So, if you have read this, you might have a clear idea about which programming language is better and which one you should use.

If you liked this blog and want to support my efforts, do share it with as many friends as possible. And feel free to drop in suggestions for improvements.