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
-
@atheist thank you.
Comments over docstrings have always just been a preference of mine.
Why prefer 'if x is None' over equality testing?
"you're slicing twice."
Fuck, you're right. Can't believe I didn't catch that. Thanks. -
@atheist I was shocked by the python string literal thing and looked it up. You should have mentioned that it‘s a comment (prefixed with #), not an actual string literal 😂
-
@atheist linters are workless since black. Does black also sort imports? Not sure
-
@atheist My god… so it IS as retarded as you said originally. This is mind boggling!
-
@atheist imo, comments and doc are not code, so they should be… comments.
What if my function is supposed to simply return a string literal?
Would this string also count as a documentation for the function?
This seems insane. The doc and the returned value are completely different things.
What’s the problem with comments? If it’s about multiline, then there should be syntax for multiline comments.
Abusing string literals for that just because they support multiline is insane.
And even if there is no multiline support for comments, I’d still prefer multiple lines prefixed with #.
I also don’t get the point about retrospection. Why is it relevant for the runtime to be able to extract the docs for a function? -
@atheist oh, thats cool and useful. Can't believe I didn't fucking know this before now.
Thank you, thank you, thank you. -
@atheist yes, I get it. It’s an unused string literal. I also get that there is no ambiguity.
That doesn’t mean that I agree that it’s a good thing.
It’s still arbitrary to use the first unused string expression or literal as the doc.
And you haven’t given me an explanation yet for why this is better than a normal comment and why it’s good for the runtime to be able to have access to it.
It’s not like there is a use case where I run the code and somehow want to get the docs for the functions that are executed. I want the docs when I write the code, not when I run it.
> You are not a very good programmer, are you?
Where does this suddenly come from? -
@atheist you can stop your insults, your point about the repl has convinced me. That’s the kind of argument I was looking for.
Related Rants
I wasn't gone, I was just working.
Anyway, I had some fun and wrote a simple 10 minute little precursor to an ngram implementation:
(when your comments are as long as the code, lol)
https://pastebin.com/bZVh8YSP
It obviously doesn't do type checking, or valid value checking, or any of that, and there may be an old comment or two adding cruft but whatever
random
puthon
ngrams