159
submitted 1 week ago* (last edited 1 week ago) by akunohana@piefed.blahaj.zone to c/programmer_humor@programming.dev
top 22 comments
sorted by: hot top new old
[-] one_old_coder@piefed.social 32 points 1 week ago

In C++, main MUST return int, but it can be omitted, like int main() { }

If the Pico is a microcontroller without an OS, it's not supposed to "return," it makes no sense. It's like saying "what will you do after you are dead?" You're supposed to loop forever or something.

But I may be wrong...

[-] akunohana@piefed.blahaj.zone 17 points 1 week ago

No, you're right, a single program runs at a time.

[-] db2@lemmy.world 15 points 1 week ago

So you might say the return code is void

[-] SwooshBakery624@programming.dev 12 points 1 week ago

You might even say the OS itself is void. VoidOS if you will.

[-] akunohana@piefed.blahaj.zone 4 points 1 week ago

Void of life.

[-] marcos@lemmy.world 3 points 1 week ago

Yes, but the standard mandates that you are able to declare it int.

The thing is, it doesn't stop being void just because it's declared as int. What is a WTF that needs to be documented. But also, there's no reason for anybody to want it to be int...

[-] MadhuGururajan@programming.dev 12 points 1 week ago

lowkey wanted to suggest writing a program to call other programs.. Then I realized I am just suggesting writing a scheduler/init process.

[-] jaybone@lemmy.zip 10 points 1 week ago

Doesn’t RPi just run a Debian based distribution (though there are others it can run.) So why is the C/C++ SDK different than any other Linux distro?

[-] unexposedhazard@discuss.tchncs.de 22 points 1 week ago

As OP said, much smaller baby chip. The entire thing uses like 100-200mW while running. Its more like an arduino and you can also program and flash it with the arduino IDE.

[-] akunohana@piefed.blahaj.zone 20 points 1 week ago* (last edited 1 week ago)

This SDK is meant (?) for the Pico, which uses an ARM microprocessor, which in turn needs other libraries than x64 C.

[-] dracc@discuss.tchncs.de 6 points 1 week ago

Oh, you mean the Pico SDK? Yeah, good stuff. 🤩

[-] akunohana@piefed.blahaj.zone 9 points 1 week ago

After having done C in an x64 Linux environment using only clang, I was... Flabbergasted? At the myriad of components required to compile for this little piece of shi... I mean piece of wonderful hardware called ARM. 🥰🤣😱

[-] dracc@discuss.tchncs.de 9 points 1 week ago

I mean, you're compiling for a different architecture and bare metal. Yeah, it'll require quite a few different packages from what you typically use. 😊

[-] akunohana@piefed.blahaj.zone 4 points 1 week ago

Tell that to me two days ago 🤣

[-] one_old_coder@piefed.social 4 points 1 week ago* (last edited 1 week ago)

At the myriad of components required to compile for this little piece of shi…

The toolchains used to compile code for embedded systems have always been very hard to use. They don't do that on purpose, but I guess it's because they are mostly into the hardware side of things, and they don't follow good practices for the software, like writing useful scripts or functions.

Most of the time it's a bunch of scripts that you have to run in a mystical order to create an environment that can build something. I don't blame them, but they don't care about polishing stuff because "it works on their machine."

[-] dracc@discuss.tchncs.de 5 points 1 week ago

I'd argue it's very polished in the Pico SDK. Install a few well defined packages needed for compilation, add three lines to your CMakeLists.txt and a provided script to your repository and it'll sort out the rest.

[-] pupbiru@aussie.zone 2 points 1 week ago* (last edited 1 week ago)

i mean, compiling for linux you’re skipping a lot of shared things because you’ve got the kernel.. compiling for a microcontroller your binary is everything there is. if you had to compile the linux kernel and shared libs every time you compiled a single app you’d be amazed at how fast microcontrollers compile :p

[-] akunohana@piefed.blahaj.zone 1 points 1 week ago

Haha, yeah, it just hit me that the program I'm compiling doesn't have any environmental support whatsoever once it's shoved on to the microprocessor, so I guess it's natural having to "bake in" a lot of other stuff at compilation. Thanks! ˆˆ

[-] LH0ezVT@sh.itjust.works 2 points 1 week ago

I'm pretty sure you can just write valid ARM/RISC machine code at the right flash address by hand and it will just work. Might be a bit inconvenient, of course. But I've done a bit of that on other ARM chips. Even in the 21st century, sometimes the quickest way to get results is typing in the hex codes for "write 42069 into r0 and jump to that function, then see if the function spits out the funny number".

[-] palordrolap@fedia.io 4 points 1 week ago

Weird question: Is the pictured guy Turkish?

In my life I've known exactly two people from Turkey, completely unrelated to each other as far as I know, and this guy reminds me of both of them.

Don't get me wrong, I've seen footage and images of people from Turkey where there's been nothing to remind me of my acquaintances other than the implicit ethnicity. This guy looks like he might be related to both of them without their knowledge.

this post was submitted on 18 Nov 2026
159 points (98.8% liked)

Programmer Humor

34316 readers
1656 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 3 years ago
MODERATORS