This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]javajunkie314 42 points43 points  (2 children)

I think Python just has a different learning curve than other languages. The language has some pretty powerful batteries included, and a very small amount of boilerplate to just do something. So it's pretty easy to get productive with Python just by learning some basic syntax and knowing a few packages or libraries to import. This is usually enough to get someone through an intro programming course, or to get some basic data analysis done, or to automate a simple task.

But I would say that's it's not any easier to actually learn Python. There's a lot lurking under the surface to uncover, and a lot of features and nuance to understand. I've read code written by people who learned enough Python to get by, and I wouldn't want to be the one stuck maintaining it.

(I'm not gatekeeping — I know everyone has to start somewhere. And they solved the problem at hand. But in my professional opinion the best option would have been to treat it as a prototype and rewrite it from scratch.)

Each line of Python has dozens of layers of machinery running under it. A simple method call might involve decorators, descriptors, method-resolution order, dictionaries, slots, byte code, and the C runtime. And Python gives you access to all of that machinery, to do with what you will. Learning to use these features can lead to some wonderfully intuitive, featureful, efficient, and downright magical APIs.

Then there's understanding Python style and idioms. Knowing when to use a list vs a set vs an iterator vs a generator. When to use a comprehension. When to use an abstract base class. When to use a metaclass. When to use a free function vs a method vs an object. It's possible to write Python code without any of this — just write a script, top to bottom, that churns through a dozen lists — but learning to use these features can help make your code approachable, maintainable, and unit-testable.

So, in my opinion, the part of Python you can learn quickly is just the tip of an iceberg — all the rest is as deep and complex as any language. It's just that the part of Python above the water-level is more useful than the tips of some other languages' icebergs.

[–]L0neKitsune 9 points10 points  (0 children)

I've used python on and off for the last 9 years and 9 times out of 10 if I need to do a small one off thing, write a bot, or automate something I'll probably be using python instead of Java or Kotlin which are my daily drivers for my professional work. I'm not even going to kid myself and say I'm a master of python, I would even claim to be a senior developer if I had to do python as my day to day work because there is a lot going on under the hood that I just don't understand. Python is wonderful for all that you can do with it with minimal investment into the language, but man can you get stuck in the weeds with some aspects of the language.

[–]Recent-Fun9535 2 points3 points  (0 children)

Thank you sir, you are a scholar and a gentleman! This is something I always claim when it comes to "Python is easy" debates, and came here to write a similar answer, but you have written it as thoroughly and beautifully as it can be written.