this post was submitted on 23 Aug 2023
144 points (90.4% liked)

Programmer Humor

32472 readers
577 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
 
top 15 comments
sorted by: hot top controversial new old
[ā€“] graphite@lemmy.world 39 points 1 year ago (1 children)

wym just

def piss(): pass

substitute accordingly šŸ¤™

[ā€“] egeres@lemmy.world 22 points 1 year ago* (last edited 1 year ago) (1 children)

Now that I think about it, you can just write piss and it counts as writing a variable but not assigning it šŸ™ƒ (after having assigned piss at the beginning of the code!)

[ā€“] GitProphet@lemmy.sdfeu.org 19 points 1 year ago (1 children)

So you're saying we just have to piss at the very beginning of the code?

[ā€“] egeres@lemmy.world 10 points 1 year ago

I bet this was in the original draft of the PEP-8 hahah

[ā€“] Asudox@lemmy.world 19 points 1 year ago* (last edited 1 year ago) (1 children)

def piss(): pass; piss = piss()

Here you go.

[ā€“] egeres@lemmy.world 8 points 1 year ago (1 children)

But actually, You can just replace that line with piss = None, assigning piss = piss() does not invoke the former method when writing the new variable "standalone"

[ā€“] Asudox@lemmy.world 1 points 1 year ago
[ā€“] rikudou@lemmings.world 17 points 1 year ago (1 children)

You can use the C preprocessor on any source code.

[ā€“] marcos@lemmy.world 4 points 1 year ago (1 children)

Or m4 if you are into it.

M4 + python would make for a great combo.

[ā€“] muzzle@lemmy.world 4 points 1 year ago (1 children)
[ā€“] marcos@lemmy.world 1 points 1 year ago (1 children)

But...

What is more pythonic than semantic whitespace?

[ā€“] muzzle@lemmy.world 1 points 1 year ago (1 children)

Preprocessing source code is an awful idea and I wish it never became widespread.

I used to hate semantic whitespace, but I came around when I was using it anyway.

[ā€“] marcos@lemmy.world 3 points 1 year ago (1 children)

Oh bummer... I was so glad believing somebody understood the m4 joke.

Text preprocessors for code are awful. But the m4 + python combo is so full of landmines that I'm wondering if I should try it.

[ā€“] muzzle@lemmy.world 2 points 1 year ago (1 children)

I can only defend myself with the good old "it is impossible to write a YĢ¶oĢ¶uĢ¶TĢ¶uĢ¶bĢ¶eĢ¶ Lemmy comment stupid enough that everyone will realise it is ment to be sarcastic"

[ā€“] marcos@lemmy.world 2 points 1 year ago

I would say that one should expect a high probability of comments on "Programmer Humor" being sarcastic. But deep down I know you are right.