3 ms·
Old man yelling at cloud. I don't like python, so take this with a grain of salt. Or don't read it. I never understood the beginner friendliness much. For me
by iforgotpassword 4y ago
Old man yelling at cloud. I don't like python, so take this with a grain of salt. Or don't read it.
I never understood the beginner friendliness much.
For me it already starts with the concept of significant whitespace. It's stupid I hate it. Read a more involved function that might have a depth of 3 or 4 nested loops and ifs and suddenly you can't tell if it's closing 2 or three levels if the start of the last block is a little further away. "Use an ide" - ok you first told me it's a simple and beginner friendly language and then I already need a fancy ide to be able to read the code.
"It helps beginners to format the code properly by preventing them from messing up the indentation wrt logic" - ok fair.... You want to make the user write clean code from the beginning by giving them no chance but to do it right. But then we get to classes. There are no visibility modifiers! All methods are public. Suddenly all good intentions to guide the apprentice to do the right thing are out the window. You never learn to think about internal state, helpers and public methods that change the object's state in a consistent manner. You can reach into the object and fumble with internal state. "Ok just make it clear through naming which methods are in-" STOP! Yes that's what an experienced programmer might do when they already understand those concepts in the first place. But again it's contrary to the whole significant whitespace argument.
Oh boy, and then the explicit self parameter. Just why? It's there in the method's definition, but you don't need to pass it when calling (unless you would call it as a static method on the class and... just why)? I don't see how this asymmetry is better than just having that implicit magical this-pointer around in other languages. Sure it's not a make it or break it, but it feels so clumsy and just bad, like "hey that makes implementing classes a bit easier so lol f- it".
- Jensson 4y agoI don't think that python classes are particularly user friendly, but python doesn't force its users to learn classes. Regular python code with just control flow, functions and dicts is very simple to get started with and more than enough to write basic programs.