There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

programmer_humor

This magazine is from a federated server and may be incomplete. Browse more on the original instance.

ClassifiedPancake , in How programmers comment their code

At work we let Typescript and descriptive naming document our code. Only when something is a workaround or otherwise weird will we add comments. So far it has worked great for us.

marcos , in Average CSS

Well, that’s what you get for using classes like “white” and “lime”.

dajoho ,

Exactly this. Bootstrap killed the css star.

ClassifiedPancake , in Site: "I don't feel so good...."

Rotate <body> veeeeeeery slowly

bricklove , in How programmers comment their code

I got a media failed to load error at first and thought that was the joke

ArchRecord ,

Both jokes can be true 😅

snaggen , in How programmers comment their code
@snaggen@programming.dev avatar

Comment about image

Fargeol ,

answer: the answer

const ,
@const@sh.itjust.works avatar

Reply about comment about image

fnmain , in How programmers comment their code
bjoern_tantau , in Average CSS
@bjoern_tantau@swg-empire.de avatar

People learning CSS through shitty frameworks:

mundane , in How programmers comment their code

Comments should explain “why”, the code already explains “what”.

smeg ,

The allowable exception is when the what is a what the fuck, as in you had to use a hack so horrible that it requires an apology comment

mundane ,

Absolutely, although I see that as part of why

Why is there a horrible hack here? Because stupid reason…

bleistift2 ,

Describing the what also helps when you dabble in a new technology or little-used technology. It helps to explain to yourself what you’re doing and it helps in onboarding. “Hey, newbie, there’s a function in XYZ module that’s extensively documented. Look there for guidance.”

sukhmel ,

Or if the what is so cryptic and esoteric that it would require the reader a couple hours of research to understand it.

Also, I find it useful to summarise the what before code blocks if that can’t be summarised in a function name

azdle ,
@azdle@news.idlestate.org avatar

Unless you’re working with people who are too smart, then sometimes the code only explains the how. Why did the log processor have thousands of lines about Hilbert Curves? I never could figure it out even after talking with the person that wrote it.

ripcord ,
@ripcord@lemmy.world avatar

“Smart”

mundane ,

If you know how the code does something, you also know what it does.

calcopiritus ,

Inline comments yes.

Function/Class/Module doc comments should absolutely explain “what”.

mundane ,

You are absolutely right. It was inline comments I had in mind.

MystikIncarnate ,

I don’t code, at best I script. I’m a sysadmin, not a dev, so I play around in PowerShell mostly.

I just started to naturally do all of this. Not because I was taught to, but because I’ve written too many scripts that I later looked at, and thought, WTF is going on here… Who tf wrote this? (Of course it was me)…

So instead of confusing my future self, I started putting in comments. One at the beginning to describe what the file name can’t, and inline comments to step me through what’s happening, and more importantly why I did what I did.

The sheer number of comments can sometimes double the number of lines in my script, but later when I’m staring into the abyss of what I wrote, I appreciate me.

myplacedk ,

I agree.

I usually think of that as documentation, not comments.

But even so, the code should say what it does, with a good name. The documentation adds details.

independantiste , in Average CSS
@independantiste@sh.itjust.works avatar

At first I only noticed the indent. Wtf

Clbull , in Mcafee accidentally made users call the devs of SQLite and complain.

John McAfee would be spinning like a rotisserie chicken in his grave. Or at least he would be if McAfee Software hadn’t already turned to shit long before his death.

So the temp files are still identified, but anybody smart enough to figure out the code is also likely smart enough to know that calling the developer will not help get rid of the file.

Don’t underestimate the stupidity of your average person.

ruk_n_rul ,

Was gonna say, this wouldn’t happen on John’s watch. /S

cupcakezealot , in How programmers comment their code
@cupcakezealot@lemmy.blahaj.zone avatar

//@TODO document this function later

15 years later

Shoe ,

Have reviewed 16 year old code for a very well known company in the last week with this exact comment peppered throughout, alongside delightfully helpful comments like:

// do not delete or change this it just works

// TODO temporary fix added 12/09/11 to fix incident must be removed ASAP

// CAUTION this returns false here instead of true like it normally does, not sure why

// if true then matched to valid account not is true

aeronmelon , in Average CSS

“Some coders just want to watch the word burn get colored white and/or lime.”

And if you delete one or the other, or condense the code into a single command, the whole site breaks.

starman , in Mcafee accidentally made users call the devs of SQLite and complain.
@starman@programming.dev avatar

There’s a solution for this McAfee problem:

m.youtube.com/watch?v=bKgf5PaBzyg

Thcdenton , in Mcafee accidentally made users call the devs of SQLite and complain.
yetAnotherUser , in Mcafee accidentally made users call the devs of SQLite and complain.
  • All
  • Subscribed
  • Moderated
  • Favorites
  • [email protected]
  • random
  • lifeLocal
  • goranko
  • All magazines