464
submitted 1 week ago* (last edited 4 days ago) by danhab99@programming.dev to c/programmer_humor@programming.dev

"What's your go-to tool as a programmer these days?"

My brain, same as it always has been!

top 34 comments
sorted by: hot top controversial new old
[-] killeronthecorner@lemmy.world 107 points 1 week ago

I'm a big fan of my keyboard

[-] Zorsith@lemmy.blahaj.zone 57 points 1 week ago

The Universal Serial Bus is pretty good shit. Plug n Play is a great feature.

[-] int32@lemmy.dbzer0.com 30 points 1 week ago

microsoft: THERE STILL IS SOMETHING THAT JUST WORKS! WE NEED TO ADD AI SO YOUR KEYSTROKES WILL BE WRONGLY INTERPRETED!

[-] SeductiveTortoise@piefed.social 18 points 1 week ago

Not only wrongly, but really slow as well. That'll be $5.99 a month, please.

[-] int32@lemmy.dbzer0.com 4 points 1 week ago

and with an internet connection required(good luck entering your wifi password without a keyboard)

[-] fckreddit@lemmy.ml 7 points 1 week ago

Although not really useful, I simply love RGB lighting in the keyboard.

[-] Zorsith@lemmy.blahaj.zone 5 points 1 week ago

Same, i don't like south-facing RGB though; at the right angle they peak out behind keycaps and just drill me right in the damn eye (photosensitivity sucks...). That and the lack of dedicated indicator LEDs for caps/num lock are the only things i don't like about my current keychron keyboard.

[-] omgboom@lemmy.dbzer0.com 42 points 1 week ago
[-] mushroommunk@lemmy.today 24 points 1 week ago

Or even better, libraries of functions you've built up over time from visiting stack overflow

[-] marcos@lemmy.world 16 points 1 week ago* (last edited 1 week ago)

A really good way to evaluate an ecosystem is looking if people look into documentation or stack overflow first.

When it's stack overflow, the ecosystem always suck.

[-] Witchfire@lemmy.world 12 points 1 week ago

Agreed, I 100% prefer to parse through documentation than stack overflow

[-] Genius@lemmy.zip 4 points 1 week ago

I prefer good documentation over stack overflow, but I prefer stack overflow over bad documentation. If other programmers are mostly using stack overflow, it means the documentation sucks

[-] Dumhuvud@programming.dev 3 points 1 week ago

May I suggest avoiding recursive functions where possible? They are usually the ones overflowing your stack, duh.

[-] zarkanian@sh.itjust.works 3 points 1 week ago

The trick to avoiding recursive functions is to avoid recursive functions.

[-] bisby@lemmy.world 34 points 1 week ago

I'm going to count vim, or any other IDE as a tool. You don't just will your thoughts into the computer (at least most people don't, that I know).

[-] Wizard_Pope@lemmy.world 11 points 1 week ago

I astrally project my thoughts into the PC.

[-] kbobabob@lemmy.dbzer0.com 4 points 1 week ago

You could count the fucking chair as a tool. This post is dumb, lol.

[-] Honytawk@feddit.nl 2 points 1 week ago

I really enjoy the air that I'm breading.

Couldn't code without it.

[-] dan1101@lemmy.world 11 points 1 week ago

Global variables

[-] joyjoy@lemmy.zip 10 points 1 week ago
[-] lunarul@lemmy.world 6 points 1 week ago

Unless you're programming in assembly

[-] Dumhuvud@programming.dev 2 points 1 week ago

I mean, in C too.

I used it when I wrote some throwaway C++ code working with SQLite. Since it had no RAII (and I had no intention of writing my own wrapper), I had to manually cleanup multiple resources somehow. If at least one resource failed to initialize, I had to deinitialize the ones that didn't fail. It was either goto or a bunch of flags to track what is initialized. goto looked more elegant.

[-] Dumhuvud@programming.dev 1 points 1 week ago* (last edited 1 week ago)

I misremembered the whole thing. It was still related to cleaning up after a failure, but there was only one resource I had to deal with. That's how it looks like:

    sqlite3 *db;
    int r;

    r = sqlite3_open("./data.db", &db);
    if (r) {
        std::cerr << "Can't open the database: " << sqlite3_errmsg(db) << std::endl;
        return r;
    }

    r = sqlite3_exec(db, "CREATE TABLE IF NOT EXISTS foo(...);", nullptr, nullptr, nullptr);
    if (r != SQLITE_OK) {
        std::cerr << "Can't create a table called foo: " << sqlite3_errmsg(db) << std::endl;
        goto out;
    }

    // a few more sqlite3_exec calls;
    // some sqlite3_prepare_v2 calls combined with sqlite3_bind_* and sqlite3_step calls
    // for repeated queries.

out:
    sqlite3_close(db);
    return r;
[-] jwmgregory@lemmy.dbzer0.com 1 points 1 week ago

even if the flags look less elegant you really want to avoid using goto’s in pretty much every context in modern C. it basically only exists for backwards compatibility purposes, so all our shit from 1999 doesn’t go up in flames. it is considered bad practice to use it now because it really complicates the control flow logic and it is much less modular/portable.

i don’t understand thinking using flags would be less elegant, either. wouldn’t you rather have a neat list of everything for garbage collection purposes than having to search through goto statements thrown all around the code?

either way, if you’re in this situation in the first place, you’re writing bad C code. memory management should never manifest in implementation like this.

[-] librekitty@lemmy.today 1 points 1 week ago
[-] lunarul@lemmy.world 2 points 1 week ago

Yeah, it's not called goto, but it's functionally the same.

[-] lime@feddit.nu 1 points 1 week ago

but very useful!

[-] Gladaed@feddit.org 7 points 1 week ago

Guess they truely are a tool.

[-] grrgyle@slrpnk.net 5 points 1 week ago

I am the tool 😎 wait

[-] maxwells_daemon@lemmy.world 5 points 1 week ago

I was gonna say gcc, but you do you, bro...

[-] NigelFrobisher@aussie.zone 3 points 1 week ago

Leatherman.

Brand new sentence

this post was submitted on 01 Sep 2025
464 points (98.9% liked)

Programmer Humor

26265 readers
2023 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 2 years ago
MODERATORS