this post was submitted on 16 Jun 2023
120 points (98.4% liked)

Programmer Humor

19187 readers
1128 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS
 
top 12 comments
sorted by: hot top controversial new old
[–] JustinFTL@kbin.social 6 points 1 year ago* (last edited 1 year ago) (1 children)

@odama626 when my brain goes in auto-mode, mine ends up like:

`// opens dialog window
openDialogWindow(){

// set dialog config
const config = new DialogWindowConfig({...});

// open window
dialogWindow.Open(config);
}`

[–] tortoise@tortoisewrath.com 1 points 1 year ago* (last edited 1 year ago)

mrw the style guide requires documentation for every function

[–] bloubz@lemmygrad.ml 6 points 1 year ago (2 children)

Comments should almost always be reserved to "why" and not "what" or "how". Give extra context that can not be brought in another way. The rest should be clear from the code

[–] olekskon@lemmy.mywire.org 7 points 1 year ago

My "why" comments:

// This is here because if I remove it, the whole server panics, no idea why. So don't delete it.
[–] Deebster@lemmyrs.org 1 points 1 year ago (1 children)

I upvoted this, but actually I hardly ever see this style of commenting. Maybe it's because I never got very far into corporate coding.

[–] Darorad@lemmy.world 2 points 1 year ago

At least in my experience it's more people just stop leaving comments. Best place I worked had comment review as a part of code review, that was nice

[–] tiny_fingers@programming.dev 3 points 1 year ago (1 children)

Heheh. Sometimes if it's getting close to going home time, but I just had an epiphany, I'll add comments to my code so I can remember my train of thought for the next day. Then I promptly forget to remove the comment after I add the code because I get pulled into some other 'emergency'.

[–] odama626@lemmy.world 1 points 1 year ago

I do this too, will have a list of todos. There is an atlassian vscode extension that lets you create tickets from todos though so that can be pretty helpful

[–] gkd@lemmy.ml 2 points 1 year ago

Comments? What are comments?

[–] snowseth@startrek.website 1 points 1 year ago

It's self-documenting.

[–] freopen@lemmy.world 1 points 1 year ago

Yet another useless use of cat...

[–] dylanTheDeveloper@lemmy.world -1 points 1 year ago* (last edited 1 year ago)

I read peoples code submit descriptions and a bunch are extremely detailed, then the ones after from the same user same day are usually "oh this doesn't work, should work now" or more regularly "iwqrjtqwiuht"

load more comments
view more: next ›