Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
snake case sucks ass really hard, I agree.
Private properties and methods, in many opinions, is an anti-pattern. Why do that? To hide stuff from naughty developers? You ARE the developer, and if you want, you can still call private methods in Java. It only makes things harder.
Why is it an anti-pattern? Because you can't test them.
As for funky typing - Python is one of the more "tame" languages. Seriously, try JS or PHP. There, everything can become literally everything else.
In Python there are at least some restrictions to operations not allowing you to slip away into unknowingly dealing with different types.
Why is it good?
A couple of reasons:
1. It's easy to prototype in. Simply write "python" in the command line and away you go testing something. Try that with any other language.
2. It's relatively non-verbose. Code that matters
3. Has a ton of easily installable packages for everything, that, unlike on Node.JS, are fast. -
And why it sucks:
1. It's slow compared to compiled languages, yet when you make a larger project, it still shares all the bad stuff with compiled languages
2. VERY shitty documentation. One of the shittiest in existence. Different versions mixed up together and none work as documented sometimes.
3. GIL.
4. Including local files is a mess. -
-vim-31257yThe funky type structure is actually called dynamic type, which is useful in scripting language, ans Python offers a way to regulate types
@AndSoWeCode I actually like snake_case, even if I prefer 🤬_F🤬CKING_SCREAMING_SNAKE_CASE -
@AndSoWeCode i wanna hear more about your problems with the docs. I actually find them quite nice and the built in docs help from when doing stuff on the repl. I seldom find docs that I don't like tho so I am clearly biased (plus I love python)
-
@irene everywhere. It's a mess compared to other platforms (not taking into account .NET Core).
Examples include the unittest.mock documentation which is just nauseatingly bad. To see why - try mocking anything that works with "with".
with stuff.do_something() as x:
It's horrific. -
@vortexman100 after doing some Node.JS, Python seems quite decent in that regard.
-
Python hast a typing system in function heads so you can specify what exactly (even a dictionary of lists of sets can be specified) you're working with.
Apart from that, yeah, if you're not careful you'll end up with spaghetti really quickly. -
@irene yes, It is unfortunate/annoying but at least it supports it, making dynamic typing less annoying. You could also have a function that checks the type and throws an error if it's not equal, but that's just another hack
-
Yes, but not just for the standard types (list, dict, Str etc.) but also for types which are generated by modules. For example opening a xlsx with openpyxl and grabbing a range of cells would become a List[List[tuple(openpyxl.cell, str)]]
God that would be soooooo nice! -
-vim-31257y@irene @polaroidkidd The philosophy behind not enforcing type is the same as not having private functions: “We’re all adults here”
-
@-vim- yeah I get that. What really bothers me about it is the missing auto-complete functions when pycharm isn't sure which type it is.
-
aritzh7527y@irene @-vim- if after assigning to a variable you do something like this, it autocpletes like a charm (pun intended)
myvar = whatever() # type: str
Of course, you can change str for any type, and there are special ones for tuples, lists, dicts, etc.
It is very useful when using types you don't know what they have inside
Related Rants
2018 dev goal #1: ✔️
This week I learned Python 3, as in most of the syntax. Not yet any development, but that will come tomorrow onwards.
Oh, and I hate the funky type system, which is almost non existent and so flexible that I don't know if it's just bad or I simply don't see why I should want it this way.
Please enlighten me why you think Python is great or just plain snake crap.
Did I mention snake case being common practice? And that Python doesn't know real private properties, methods, etc.? How does that work?
rant
python