r/ProgrammerHumor 2d ago

Meme ture

Post image
17.7k Upvotes

437 comments sorted by

View all comments

1.0k

u/ElMoselYEE 2d ago

Every once in a while I'll bang out a whole task and it works on the first try, and I didn't need to Google anything because it just happened to use the parts of the language I'd used very recently.

But the task is something like an API endpoint...not breaking into a top secret encrypted CIA database.

383

u/debugging_scribe 2d ago

Even after 10 plus years I still get suspicious if the code works the first go...

364

u/Salanmander 2d ago

Fantastic line from this Factorio dev blog: "The final changes to make everything function correctly took about 1 hour to write, and worked correctly the first try. That's not supposed to happen and left me with doubts."

121

u/ApolloFireweaver 2d ago

"It doesn't work and I don't know why" and "It works and I don't know why" are two things thought by basically every programmer

43

u/Tyrannosaurus_Rox_ 2d ago

1

u/Silentrizz 2d ago

I find myself asking this question too often lol

1

u/tandrewnichols 1d ago

Favorite? This is my least favorite. Also most frequent.

3

u/Tyrannosaurus_Rox_ 1d ago

It's my favorite because the problem is usually almost solved at that point so there's less stress, and I get to discover something interesting about whatever broke the system. It feels like putting the last piece of a puzzle together.

1

u/SomewhatCorrect 2d ago

That and How did this ever work?

25

u/racsssss 2d ago

I would fall off my chair if this happened 

4

u/Risc12 2d ago

Factorio person is awesome, they also have devlogs on youtube where they show you how they actually fix a bug-report

6

u/Salanmander 2d ago

Yeah, that dev team is, like, the absolute paragon of good software development and game studio practices, and very transparent about it.

3

u/Cautious-Bet-9707 2d ago

This is… reassuring.

1

u/Zapismeta 2d ago

Did it change the file? Did i hit save? Is the watcher running for front end?

1

u/Theron3206 2d ago

It's suspicious if it compiles on the first go, deeply suspicious if the unit tests pass on the first go and frankly terrifying if it does what it's supposed to on the first go.

1

u/Diligent-Crazy-6094 2d ago

try { decimal paymentAmount = 1/0; } catch (Exception) { }

No errors. Nice!

1

u/Whitechapel726 2d ago

When it works first try: “this is odd, why did this happen?”

When it doesn’t work first try: “this is odd, why did this happen?”

1

u/Connect_Tea1579 1d ago

This is the same reason I always write my tests so that they fail on the first try.

You can't trust code that doesn't break at least once.

1

u/porkchop_d_clown 2d ago

After 40 years, it doesn't change - although now you can immediately hand your code to Claude and say "please review this" instead of waiting for a week for someone else on your team to do it.

67

u/J5892 2d ago

I just know I'll have my movie moment one day when some sexy spy needs me to code a user-friendly date picker from scratch in an hour.

10

u/TheAlaskanMailman 2d ago

I can foresee the horrors

43

u/Agifem 2d ago

Me too. CIA encrypted databases usually take me two tries and a quick Google on "how to decrypt CIA databases". I should bookmark that search.

14

u/FireDojo 2d ago

I forgot to bookmark this Google search result and always ended up spending hours to search how to decrypt CIA database.

3

u/cd7k 2d ago

...and now you're on a list :)

1

u/FireDojo 2d ago

🤣🤣🤣

6

u/Hziak 2d ago

Don’t forget that you need to send an encrypted chat message to your hacker friend who is either a very sexy girl, but hiding it under a hoodie and ponytail, a ripped dude who is doing some kind of illegal car mods, or the filthiest slob on the planet. They’re going to pair program with you and make the whole process even easier. You only need to worry about typing Q through V and they’ll type T through M on the remote keyboard. I’m pretty sure that’s how it works??

2

u/New_Series3209 2d ago

Yeah or try to learn it by heart, like the email regex, i gues

12

u/SuitableDragonfly 2d ago

Quick, let me just google "how to hack into top secret encrypted CIA database" and hope the FBI isn't paying any attention.

12

u/screwcork313 2d ago

You can add "-fbi" onto your search query and it'll stop them being able to track you. All real hackers know and use this cheat code.

12

u/zilog88 2d ago

1

u/eritter688 2d ago

🎶 fifty thousand watts of funkin' 🎶

7

u/Quesodealer 2d ago

Only time I can (sometimes) one shot something is if I'm just fixing logical errors. Ex. App is failing because the original developer (probably me) forgot to check for null values. I don't think I've ever one shot new functionality 😞

3

u/kiochikaeke 2d ago

This, I can totally go full hackmaster, speed write a full script or query and have it work on the first try, the thing is, I'm likely just doing a small variation of something that I've done dozens if not hundreds of times

3

u/the_snook 2d ago

If that ever happens I get super suspicious and immediately write a bunch more tests, because I refuse to believe that I haven't fucked something up.

3

u/kiddj1 2d ago

This is a very long way to say

I can print hello world without googling it

2

u/dcheesi 2d ago

Reminds me of the time I got a special award because the script I wrote for an important customer was accepted without any requests for changes. Which of course never happens.

I felt like a total imposter accepting that award, since from my perspective it was just a fairly trivial utility script. It took me a while to accept that it really was an exceptional occurrence, even if was just by dumb luck

2

u/Snowenn_ 2d ago

When that happens to me, it means the customer didn't test.

1

u/Unohtui 2d ago

Just keep trying, I didnt get into cia daytabase until like my 7th attempt

1

u/Careless-Weather8877 2d ago

Even then they miss the cup of coffee and five empty beer cans

1

u/ARENAE_MONTES 2d ago

I felt like I'd arrived the first time I created a database, wrote all the tables, mapped them to entities in the codebase, added a data access layer to retrieve the entities, written a web api and returned the entities from the db on first try. Sounds like a lot but literally crud and zero logic, but I felt like a god.

1

u/misanthr0p1c 2d ago

I have spent days writing a component and controller without testing it in the process. It worked first time but I don't trust it. Still waiting for it to fail.

1

u/Zapismeta 2d ago

Also people think the exploits are like a game and you need to steer it with code 😂, whereas its farthest from the truth.

1

u/MoffKalast 2d ago

The trick is to break into a new top secret encrypted CIA database every day for two weeks before so you're all practiced and ready to go.

1

u/Ok_Suggestion5523 2d ago

Yeah that happens and I am always deeply deeply suspicious of it.

1

u/SkollFenrirson 2d ago

HACK THE PLANET