DEV Community

Cover image for Python is better than Javascript!
Maya Ramkishun
Maya Ramkishun

Posted on

Python is better than Javascript!

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, PYPL, and Stack Overflow Developer Survey. 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

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

In Python, we use print, like this:

Python print

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

However in Python:

Python Variables

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

Along with some Python ones:

Python Data Types

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

And with parameters:

JavaScript Function Parameters

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

Python Function

And with arguments:

Python Function Arguments

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.

Top comments (5)

Collapse
 
annavi11arrea1 profile image
Anna Villarreal

Learning javascript first makes everything else easier. After spending a few months with java script and then taking a look at python, oh, the rage. It's so much simpler, at least from the small amount I've learned lol.

Collapse
 
dhkamp profile image
David Hölkeskamp • Edited

This is more of a comparison of features than a determination of which language is beneficial for beginners to learn. I like the idea of these types of posts as they give someone who is starting out a direction to walk in. However, based on this comparison, I honestly don't see why Python should be considered better for beginners than JavaScript.

No example or comparison gives any pros or cons as to why one language would be better or worse in the specific examples provided.

The data types comparison is missing the dictionary type in Python, which is the "equivalent" of an object in JavaScript.
w3schools.com/python/python_dictio...

The function comparison is missing Python lambdas.
w3schools.com/python/python_lambda...

Edit:
I dont want this comment to sound harsh - writing is a very cool skill I wish I had and having the guts to post is an even greater skill. Keep it up and keep writing, don't let my answer push you down in any way!

Collapse
 
xchavez94x profile image
xchavez94x

Java is the best

Collapse
 
anitaolsen profile image
Anita Olsen

Oh yeah! Python all the way! ✨

Collapse
 
polterguy profile image
Thomas Hansen

What specific scenarios have you encountered where Python outperformed JavaScript in your projects?