Python is better than Javascript!
Tags: beginners, python, javascript, programming
Published: 2024-07-03 20:40:59

Now that I've caught your attention, let's discuss the real topic of this article. My name is Maya Ramkishun, and I believe this statement is true for many reasons. As someone who started with programming in Python 8 years ago and is relearning it now, it's still as simple as I remembered. Here's what you need to know about Python and why you need to know it:

## Why Python?
Python is the most versatile and robust coding language in Software Engineering. Python provides developers with various libraries and uses easy-to-read syntax to promote readability and organization, making it suitable for both beginners and professional programmers to use. Due to its flexibility and high demand in the tech industry, Python is used in a multitude of areas such as:

* **Web Development**
* **Data Science/Analytics**
* **Machine Learning and AI**
* **Automation and Scripting**
* **Software Development**
* **Scientific Computing and Research**
* **Cybersecurity**
* **Education**
* **Internet of Things (IoT)**
* **Finance and FinTech**
* **and much more!**

Because of its wide range of usage, Python was ranked the #1 programming language in various programming language popularity indices such as the [TIOBE Index](https://www.tiobe.com/tiobe-index/), [PYPL](https://pypl.github.io/PYPL.html), and [Stack Overflow Developer Survey](https://survey.stackoverflow.co/). This proves how large and active the Python community is, contributing to its rich ecosystem of libraries, frameworks, tools, and versatility in the Software Engineering world.

## How to Professionally Python!

Python, like all the programming languages, has its upsides and downsides. Let's take a look at why programmers might and might not consider adding Python to their skill set:

![Maya's Python Syntax Sampler](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sw2idre3ph7nqj13qnak.png)

In my code snippet, I provided some lines of code you'd commonly see in Python. For those of you who know JavaScript, you can already see drastic differences, differences which demonstrate why Python is better for beginners versus JavaScript. For those of you who aren't familiar with JaveScript syntax, let's talk about them:

### Outputting to the Console

In JavaScript, we use `console.log` to display responses in the console, like this:

![JavaScript console.log](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wezftpg57kh12lbjx77r.png)

In Python, we use `print`, like this:

![Python print](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cyool9b9n7p10xfz8wsw.png)

Both statements have the same functionality, just different syntax. Not much of a major difference here, but what about the others?

### Variables

Here's how we would initialize and use JavaScript variables:

![JavaScript Variables](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/50dfx63bn0q6ayq8bwjc.png)

However in Python:

![Python Variables](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lhk9zpxdyevro47oyxso.png)

Ah ha! Here, we notice that JavaScript variables are required to be initialized with a keyword, and those keywords determine whether the variable can be reassigned, while Python does not have any keywords.

### Data Types

JavaScript and Python have very similar data types but with different names. Here are some JavaScript data types:

![JavaScript Data Types](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bprr8hlav9n9bhmwgj7q.png)

Along with some Python ones:

![Python Data Types](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/knpetb0qmeogmpr1sedb.png)

See what I'm talking about now?

### Functions

As for functions, they look drastically different in both languages. You can define functions in two ways in JavaScript:

![JavaScript Functions](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vh2brjl2o171i3iakqso.png)

And with parameters:

![JavaScript Function Parameters](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/snwl2ranb9umzsjf3r98.png)

In Python, there's only one way to define a function:

![Python Function](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gpm5wctysmha2f8d6dsx.png)

And with arguments:

![Python Function Arguments](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w3xdsoeg86wbxqn7btej.png)

## Conclusion

In conclusion, there are many things you can accomplish with both languages, however, we can see which of the two is largely preferred among the majority of software engineers. It seems like I was right after all, but every engineer has their preferences. The programming world is our oyster, and we can choose any language or tool to create and discover new possibilities.