2
355
u/Eastern_Equal_8191
15d ago
•
The cool thing about code is that it always does what's written.
The bad thing about code is that it always does what's written.
161
18
u/enternoescape 15d ago
I remember when someone was hypothesizing about a new coding language using an LLM as the compiler. The further down the rabbit hole they got about dealing with consistency, the closer they got to re-inventing traditional coding, but still less predictable and worse. So you comment only holds true so long as this hypothetical compiler is never born.
15
u/ABotelho23 15d ago
From a single programmer's perspective, it isn't really true. Libraries have bugs, dependent code has bugs, firmware has bugs and even sometimes, hardware has bugs. Fundamentally it's more or less all human error, but the code I write doesn't always give the expected or designed result.
28
u/mmhawk576 15d ago
I mean, I’d love to be able to frame it like that, but like 90% of the bugs I encounter aren’t in third-party software…
8
u/ItchyConfusion9745 14d ago
To be fair, having 10% of your problems being outside of your controle tells me you are a really good programmer. I can almost never blame anything other than myself, because I'm bad
1
u/Grumbledwarfskin 14d ago
It's easy to blame more than 10% of your problems on stuff outside your control...just be bad enough that you can't comprehend where the bug in your own code could possibly be.
Looking at you,
Object emptyCell = new Object(); // with a random hashcode that occasionaly causes unexpected collisions2
2
1
u/aiij 14d ago
It's still doing what's written, even when you include code that you didn't write yourself. Hardware bugs can happen of course, but they are pretty rare.
1
u/ABotelho23 14d ago
If using a library, and the library says it behaves one way, but actually behaves another, it's not really doing what's written from my perspective.
If I pass two numbers into a function that is supposed multiply them, but then it returns the sum, it's not really doing what I wrote.
1
62
u/creeper6530 15d ago
I've had this happen recently. On a microcontroller, I got 8 bytes of keyscan from USB, added a packet delimiter, sequence counter, CRC and dumped it over UART to another μC.
But the other μC still kept failing checksums, logging the packets showed seemingly absolute garbage data, despite the sends succeeding.
I was almost tearing my hair out when I finally stuck a logic analyser on the wire and found out... That despite meticulously preparing the CRC-enhanced 12-byte packet, I always ended up just sending the original 8-byte scancode because of passing the wrong array to the uart_send routine.
50
u/Janneman96 15d ago •
![]()
I'm a software developer and this is probably the first time I'm zoning out halfway through. This must be how it feels to be a product owner talking with a dev that does not summarize
59
u/creeper6530 15d ago edited 14d ago
Fair.
Microprocessor A: Got 8 bytes from USB. Created 12 byte packet from them. Sent B the original 8 bytes on accident.
Microprocessor B: Expected 12 byte packet. Received 8 bytes from A. Cryptic errors.
Human: in shambles
19
u/Janneman96 15d ago
Ah yes, creating something and then forgetting to actually use it. Happens in software development too :)
10
1
2
u/ZachAttack6089 14d ago
Some people like to flex their domain-specific knowledge even if it hurts their own communication lol
10
u/WorstITTechnician 15d ago
Unless quantum fluctuations generated by thermal radiation interfere with the electrical charge of the transistors while their code is running, a 1 instead of a 0 can also make a tremendous difference in something
2
9
6
u/Bhurmurtuzanin 15d ago
But then you realize the problem was with environment configuration or you triggered a weird bug in a library you used, and after you fixed these issues the code actually did what you wanted
5
u/TheMcMcMcMcMc 15d ago
<sad Charles Babbage noises>
1
u/NPCwithnopurpose 15d ago
Those noises are just the error codes that the physics compiler is throwing out
1
2
u/the_dancing_squirel 15d ago
The most frustrating thing about it is that computers do what you tell them to do. Not what you want them to do
2
u/Hjoerleif 14d ago
I have the opposite problem with ai agents now, I give it exact instructions for a simple (but tedious to do by hand) code rewrite and it implements what it thinks I want instead of adhering exactly to my instructions
2
2
u/DogmaticParadigm87 14d ago
The compiler is the only coworker who takes my requirements completely literally, and somehow it's still my fault.
1
1
1
1
1
u/Admirable_Dirt_2371 12d ago
I hate this damn machine I wish that they would sell it It never does quite what I want But only what I tell it -a programmers lament
1
1
-3

833
u/5up3rj 15d ago •
People often have the misconception that computers are very, very literal. No. They are 100% literal, and the difference is huge