DEV Community

Cover image for Why SHOULD Python be your first language?
Tom Nijhof
Tom Nijhof

Posted on

Why SHOULD Python be your first language?

While reading an article by Krishnaa on why Python shouldn't be one's first programming language, I found myself disagreeing with many of the points presented. In fact, most of the arguments seemed to suggest that Python is actually a great choice for beginners. It was an interesting read, but I couldn't help writing this response.

What makes a good first language?

In my view, a good first language should be welcoming and make it easy for beginners to learn programming without encountering numerous obstacles or feeling discouraged. A language that requires new programmers to master numerous "real" programming concepts from the start can be off-putting and may lead to frustration. Conversely, a language like Python is ideal for beginners due to its simplicity and ease of use, allowing them to learn without feeling overwhelmed. By making programming more accessible and enjoyable, we can encourage more people to take an interest in this field and foster a positive learning environment.

Data Type Declarations

In Python, we use a dynamically typed system, which means that you don't have to worry about assigning the wrong data type to a variable. For instance, you can simply add a double to an integer or divide it by a float without any issues. This is beneficial for beginners as they can postpone learning about different types of numbers until they feel more comfortable with programming. For example, let's say we have a variable x that is initially set to 4.5. We can then assign it the value of 10, which might seem strange at first. However, Python will automatically convert the value to a float without any errors. This process feels natural and intuitive, allowing beginners to focus on learning programming concepts without getting bogged down by technical details. Once you're ready to introduce types, you can add type hints to your code without having to learn an entirely new language. This makes the learning process more incremental and manageable. By gradually introducing new concepts, you can build a strong foundation in programming that will serve you well in your future endeavors.

Limited data structure

In a recent blog post, we explore Vanilla Python regarding data structures. Unlike many other programming languages, Vanilla Python only provides lists, with no arrays to be found. At first, this might seem like a limitation, but it actually works in the language's favor. By not having arrays, beginners are spared the confusion of distinguishing between lists and arrays, as there is only one type of data structure available. This streamlined approach allows learners to focus on other aspects of programming without getting bogged down in the details of multiple data structures. Once they have a solid foundation in Vanilla Python, they can then explore additional packages like NumPy, which provide array functionality. This gradual learning process makes it easier for beginners to absorb new concepts and build upon their existing knowledge.

Less Exposure to Low-Level Concepts

“Python abstracts many low-level details, making it easy for beginners to start coding without understanding some fundamental concepts such as memory management or pointers.” - Krishnaa

I could not have said it better myself. Memory optimization is not for beginners, it is what you learn to do from beginner to mid-level.

Good Built-in Functions

In Python, there are useful built-in functions that can help beginners get started with ease. For instance, the sort function is a great tool for organizing data in a logical manner. However, forcing a beginner to learn a specific sorting algorithm may hinder their enjoyment of the language. If they show interest, it's fine to explain the concept, but it's not essential knowledge for basic use cases.

Downsides of Python as a first language

I have talked a lot about why Python is great for beginners, but let's also address some of the shortcomings.

Hard to install

Getting Python set up and running can be a bit of a challenge. Many tutorials focus on creating the ideal work environment, but we're here to show you a faster way. If you're learning Python, check out Mu. It's easy to install and get started, just like Processing for Java.

Boring visuals

In our pursuit of creating engaging and interactive programs, visual feedback plays a crucial role in keeping users motivated. While programming can become challenging at times, it's essential to provide visually appealing results to keep things interesting. For Python developers, utilizing libraries like PyGame can help create more visually stimulating content, even if the language itself may not be ideal for game development. To gain further inspiration, checking out the Mu tutorials can offer valuable insights.

Conclusion

The simplification of Python is what makes it a great first language! Do not try to punish beginners because they do not know everything, help them by letting them skip the more advanced topics.

Top comments (2)

Collapse
 
krishnaa192 profile image
krishnaa192

Well we have difference of opinion then.I just shared my personal experience.I believe if you learn tough things first then it will be easy for you to switch.I saw this in my many of friends. Well,Its good to have difference of opinion.

Collapse
 
wagenrace profile image
Tom Nijhof

Let me be clear, I mean no disrespect to you. Love reading your blog even though I do not share your opinion

However, I have seen many people give up on programming because it was too overwhelming. Having to learn that not every number can be added to another number because of the amount of digits behind the decimal is something weird. I think your points work really well for why Python should not be your second language!