programmer_humor

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

SpeakinTelnet, in 10 months later bill revisits his spaghetti code. forgets absolutely everything and refuses to elaborate. this wouldn't have happened if Bill forgot to comment on his code

I don’t care how much you think your code is readable, plain text comments are readable by everyone no matter the proficiency in the programming language used. That alone can make a huge difference when you’re just trying to understand how someone handled a situation.

Fal,
@Fal@yiffit.net avatar

There’s nothing keeping the comments up to date with the code. Comments should be sparse and only on sections that aren’t obvious why they’re being done

Zagorath,
@Zagorath@aussie.zone avatar

Comments explain why, not what. Any comments that explain what a section of code is doing would probably be better off as separated methods.

Apart from basic documentation comments, like JavaDoc or C#'s XML documentation comments.

SpeakinTelnet,

There’s nothing limiting what a comment should be as far as I know.

As an example of what I mean, I’ve seen in a 10k+ lines python code a few lines of bit manipulation. There was a comment explaining what those lines did and why. They didn’t expect everyone to be proficient in bit manipulation but it made it so that anyone could understand anyway.

Zagorath,
@Zagorath@aussie.zone avatar

There’s nothing limiting what a comment should be as far as I know.

Nothing technical, sure. Just good coding practices.

lorty,
@lorty@lemmygrad.ml avatar

Then someone needs to change something about the code and doesn’t bother updating the comment. Now you still have uncommented code but with a comment that confuses instead of helping.

SpeakinTelnet,

IMHO the issue in this situation is not the comment but that the person updating the code didn’t do his job properly which shouldn’t be an excuse not to do it from the start.

xx3rawr, in Works on my machine

The AI is taking over us

somegeek, in We've come a long way baby

I’m really hoping google goes to shit like facebook.

technom,

Facebook for all its nastiness was very much incompetent in influencing the direction of the web. Look at their failed attempts like free basics.

Google on the other hand has the web tightly in its dirty grip. At this point, they aren’t even pretending to be nice. Even those plans that cause them reputational damage are brought back in some other name.

The only way to stop Google is for the regulatory agencies to put their foot down hard. They should be divided into at least a couple dozen companies that are not allowed to do business with each other.

wolo, in Yes

my website’s backend is made with bash, it calls make for every request and it probably has hundreds of remote arbitrary code execution bugs that will get me pwned someday, it’s great

edit: to clarify, it uses a rust program i made to expose the bash scripts as http endpoints, i’m not crazy enough to implement http in bash

it behaves like a static file server, but if a file has the others-execute permission bit set it executes the file instead of reading it

it’s surprisingly nice for prototyping since you can just write a cli program and it’s automatically available over http too

gandalf_der_12te,

you do realize that you can just use Apache instead of writing your own rust program for this, as this is more or less the CGI standard?

wolo,

I know about the CGI standard, but mine does things a little differently (executable files don’t just render pages but also handle logging, access control, etc. when put in special positions within a directory), so I still think it was worth the afternoon i spent making it.

PupBiru,
@PupBiru@kbin.social avatar

who hurt you?

wolo,

i thought it was neat how php lets you write your website’s logic with the same directory tree pattern that clients consume it from, but i didn’t want to learn php so i made my own, worse version

bdonvr,

I designed a chip architecture that runs bash code on silicon.

I reimplemented x86 assembly in purely bash script.

floofloof, in Programming: The Horror Game

Makes a change from Visual Studio turning white because it has hung yet again.

ryannathans, in DO NOT MERGE

There are a LOT of these in lineage repos. There must be a reason

xia,

Maybe they dont use squash merges, so all the intermediate commits remain on-chain?

Samsy, in Every goddamn time

Hackers Porn-Actors

victorz, in Fitbit Clock Face

It’s perfect 🥹

starkzarn, in My coding skill V/S My GitHub Repositories

I don’t know how you got a picture of me, but I demand it is removed!

hypnotic_nerd,
@hypnotic_nerd@programming.dev avatar

Nailed it 😜

Anticorp, in Always

This is the most true story I’ve ever read.

MurdoMaclachlan, in This is what being a Redditor does to your life
@MurdoMaclachlan@lemmy.world avatar

Image Transcription: Screenshot


[The screenshot is from a GitHub commit summary. It is zoomed in to show just the tab headers for the “Checks” tab and the “Files changed” tab. The “Checks” tab has a number 1 next to it, and the “Files changed” tab has an infinity sign next to it.]


I am a human who transcribes posts to improve accessibility on Lemmy. Transcriptions help people who use screen readers or other assistive technology to use the site. For more information, see here.

mexicancartel, in 4 billion if statements

Well i hate this:

PS > .\program.exe 0

THIS:

.\

TootSweet, in Good luck web devs

What has science done?

MystikIncarnate,

There’s no science here.

istoff, in no.. just no

Is that select * ?

I expect it looks more cumbersome with joins and multiple columns from different tables.

adamth0,

That’s what I was wondering. It’s doing a SELECT, but not saying exactly which columns it wants to retrieve.

kherge, in Multifactor auth done right

That last one reads like C’thulhufactor.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • programmer_humor@programming.dev
  • localhost
  • All magazines
  • Loading…
    Loading the web debug toolbar…
    Attempt #