3 ms·
Python class syntax sucks. Other syntax is mostly nice. List comprehensions etc are great, I really wish I had those in c++. Plus, I wish I had a similarly usef
by ant6n 4y ago
Python class syntax sucks. Other syntax is mostly nice. List comprehensions etc are great, I really wish I had those in c++. Plus, I wish I had a similarly useful standard library, repl, and package manager in c++.
- agumonkey 4y agoyou want `self` less class methods ?
- ant6n 4y agoYeah. And I don’t want confusing initialisers or constructors or whatchamacallit, and weird calls to super, and underscore methods. Maybe the language should just be minimally aware of classes and how they work, and build that into the semantics of the language using keywords, rather than giving me building blocks that make it feel like I’m rebuilding class semantics from scratch. It’s like when it comes to classes, Java is cleaner and simpler than python. Which is weird, cuz python is simpler and more fun to work with on all other fronts (well, almost, concurrency and threading is also kind of easier in Java). …I really like python, but man it’s warts are annoying.
- agumonkey 4y agoWhen I first started using python (somewhere before the 2to3 migration) I was extremely pissed at the object layer. I hate redundancy and the dunder and explicit self parameters completely stupid. With time I just got used to them .. (thanks partly to editor templates). The private field shenaningans weren't sexy either.. Other than that I agree.. it would be worth a python4 class Foo(Bar): new(*a, **kw): "keyword: new" super(*a, **kw) print('v4') bar(a,b,adjust=1): "no self, shorthand super.parent_method()" return super.bar(a, b) + adjust come on guido ;)
- ant6n 4y agoI'd wish there to be simply keywords that define public/private class/instance methods and variables.