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
-
Hazarth95034yTo be fair, just because you *can* write unreadable BS in a language it doesn't mean the language is bad or unreadable itself.
That being said, I've seen enough python projects.. they definitely do comment code... At least everyone does function and class level comments! -
Fuck uncle bob. Comments are always good. If you don’t want to see, download a plugin to hide them. I won’t lose any sleep because of some obsolete guy’s opinions.
-
eptsousa3734yI may be biased because I only use python for scripts. But if it’s longer than 200 lines, ciao python for me.
-
Can lambdas span over multiple lines now or are we still actively preventing people from writing readable code in the name of saving a total of 1 closing curly? (because you still need a colon to start a block)
-
jaylord4544yWhat would this look like (in an unreadable example)? Curious now I've heard all the stories 🤔
-
@jkommeren
randomPasswordGenerator = \
(lambda random, string: # level 1
(lambda characters: # level 2
lambda length: ''.join(random.choice(characters) for i in xrange(length)) # level 3
)(string.digits + string.letters) # level 2 args
)(
__import__('random'), # level 1 args
__import__('string')
)
Found in the wild and compiled in https://gist.github.com/e000/... -
@InvisibleMe oh the comments below the code and the comments in the code. lol
"It looks like lisp :O" -
@InvisibleMe
I didn't realize, that modules are actually first class citizen.
So we can write OCaml-style functors in Python... Nice. -
@Oktokolo
With great power comes great code reviewing discussions over "should I let this Python functor code in my database or is this a slippery slope to LISP?" -
@InvisibleMe
Well, a functor could easily be implemented as a pretty human-readable class taking a module on construction.
No need to do it the lisp-lambda way. -
So far everyone claiming they have the best [insert anything] (or in this case they [unlike other languages] write readable code [which reads as pythonists have the most readable code]) always proved they have the shittiest [thing they claimed to be the best at]
This rule works from pasta carbonara to sick dance moves to code.
Corollary 1: if you are good at something you don't need to claim it, you can show it. -
kurast3364yMost of code comments I see in the wild are about the how something is being done, but not about the why, which in general is what needs being explained.
Related Rants
-
ddash1237The best motivation to quit Image Classification... x_x
-
NoMad8Assembly... Do I really need to say more? Okay, it's low level so there is no abstraction. All you deal with ...
-
bittersweet15In PHP (yes, it's a language I... don't hate) I've always hated exceptions. They're like GOTO, in an OOP world...
"Pythonists don't comment, they write readable code."
Yea, tell that to the list comprehension with three lambdas
rant
wk239