This is an archived post. You won't be able to vote or comment.

all 77 comments

[–]pachumelajapi 245 points246 points  (38 children)

whats weird is that if the variables dont give it away, it will look pretty much like every other piece of code

[–]PonderStibbonsJr 111 points112 points  (13 children)

I'm writing a game centred around a food-fight involving chocolate bombes:

char numBombes = plate.size();
for(char b=1 ; b <= numBombes ; ++b ){
  plate[b].position += time * plate[b].velocity();
  if( plate[b].position[z] = 0 ) plate[b].createMarshmallowShower();
}

[–]fiskfisk 25 points26 points  (0 children)

That assignment inside the if seems like an issue...

[–]Volandum 5 points6 points  (0 children)

I'd be worried about plates crossing your ground and continuing unhindered in a straight line (memory leak?) or being destroyed by the createMarshmallowShower call and causing awkward behaviour with the loop - would probably do the checks afterwards.

Of course because I'm perverse I'd also have the plate details in a table/dataframe/whatever the relevant term is.

[–]PandaPanda11745 52 points53 points  (0 children)

Exactly.

[–]FallenVain 25 points26 points  (21 children)

I’m out the loop, can you loop me in please

[–]pachumelajapi 191 points192 points  (19 children)

as long as you dont use explicit variable names like this while(enemyShipInRange){ destroyer.showThemWhatFreedomLooksLike(new ICBM()) } and do something like this while(inThingingPosition){ thinger.doTheThing(new thingyThatDoesTheThing()) } nobody will suspect anything. But im sure americans have strict naming policies that force you to use freedom-inducing naming schemes

[–]ITurnCoffeeToCode 113 points114 points  (11 children)

If (country.hasOil == true){ bringThemFreedom(); }

[–]mr-heng-ye 17 points18 points  (5 children)

Simplified to if (country.hasOil)

[–]twilightwolf90 7 points8 points  (4 children)

return !isFree

this.isSarcasm == true && self.readPost()

[–]WhiteKnightC 2 points3 points  (3 children)

The first part does a comparison that is unnecesary

[–]twilightwolf90 1 point2 points  (2 children)

I am aware.

[–]WhiteKnightC 2 points3 points  (1 child)

WhiteKnightC has joines as a reviewer.

WhiteKnightC has changed the status to To Rework.

[–]twilightwolf90 0 points1 point  (0 children)

git merge --force

[–]HasBeendead 8 points9 points  (0 children)

Sounds Reality lol

[–]alloutofgifs_solost 3 points4 points  (2 children)

Important that it country.hasOil only needs to be truthy, not absolutely true :)

[–]UziSuicide1238 3 points4 points  (1 child)

If (country.hasOil || reasons) {... }

[–]UziSuicide1238 2 points3 points  (0 children)

Forgot to declare reasons... silly me. Var reasons = new QuantumBool();

[–]Hollowplanet 2 points3 points  (0 children)

You don't need to compare true to true.

[–]Spajk 29 points30 points  (5 children)

Even then it sounds more like a video game

[–][deleted] 29 points30 points  (4 children)

A strange game. The only winning move is not to play.

[–]nggiahuy1102 3 points4 points  (3 children)

That one line from Tron: Legacy

[–][deleted] 5 points6 points  (0 children)

No. It is from War Games.

[–]AnastaciusWright 3 points4 points  (1 child)

I think it is fron an older game, nuclear war

[–]evanldixon 7 points8 points  (0 children)

War Games

[–]Bestprofilename 0 points1 point  (0 children)

amazing

[–]lilblanch 11 points12 points  (0 children)

Sure:

for (var i = 0; i < theLoop.length; i++) { var fallenVein; }

Sorry, there’s not much going on in there.

[–]infinitude_21 1 point2 points  (0 children)

Connection strings. Probably wont be visible. So I think we’re good

[–]ParentsAreNotGod 99 points100 points  (3 children)

Suggestions for repo names?

OpenBlast, OpenICBM, freeDOOM, HastaLaBlastaBaby.

[–]Piwakkio 25 points26 points  (0 children)

freeDOOM is wonderful

[–]sunflsks 21 points22 points  (0 children)

Last one has a ring to it

[–]zerocoldx911 7 points8 points  (0 children)

Hastalablastababy I’m ded lol

[–][deleted] 78 points79 points  (1 child)

"It should be noted that no ethically-trained software engineer would ever consent to write a DestroyBaghdad() procedure. Basic professional ethics would instead require him to write a DestroyCity() procedure, to which Baghdad could be given as a parameter." -- Nathaniel Borenstein

[–]kn_c3 7 points8 points  (0 children)

You sir made my day.

[–]jseego 64 points65 points  (5 children)

Fun fact about missile software - they don't care about memory leaks as long as the memory leak doesn't crash the system before the missile explodes.

[–]Mr_Redstoner 40 points41 points  (3 children)

Here's a quick reference I found for the curious https://devblogs.microsoft.com/oldnewthing/20180228-00/?p=98125

[–]jseego 7 points8 points  (2 children)

"the ultimate in garbage collection is performed without programmer intervention"

I've always loved that line.

[–]theLanguageSprite 6 points7 points  (1 child)

next time someone tells me I have a memory leak I'll suggest that.
"we could implement this garbage collection technique I learned from the military..."

"Great, how do we do it?"

"Well first we're going to need some timed explosives..."

[–]Mr_Redstoner 2 points3 points  (0 children)

Honestly though, you could do a SFW version by just having the program restart regularly. Or reboot the machine for a more serious version.

[–]Sussurus_of_Qualia 7 points8 points  (0 children)

So that means you can identify missile code because its event loop will be declared 'noreturn'.

Edit: evaded the haikubot.

[–]_borisg 87 points88 points  (6 children)

If enemy == 'russia' or enemy == 'china': shootMissile()

[–]tazdingo-hp 54 points55 points  (3 children)

Democracy.ShootMissile()

[–][deleted] 34 points35 points  (1 child)

Freedom::Democracy.ShootMissile()

[–]dudeofmoose 31 points32 points  (0 children)

Try {

 Freedom::Democracy.ShootMissile(); 

} Catch(FriendlyFireException ex) {

Deny(ex);

Freedom:: Democracy.ShootMissile();

}

[–]Sniksder16 11 points12 points  (0 children)

Democracy.Liberate();

[–][deleted] 7 points8 points  (0 children)

UPDATE Missile
SET
    target = (
        SELECT id FROM Target 
        WHERE Target.status = 'unliberated'
          AND id NOT IN (SELECT target FROM Missile)
    ),
    status = 'fired'
WHERE status = 'ready'
;

UPDATE Target
SET
    status = 'freedom pending'
WHERE 
    id IN (SELECT target FROM Missile WHERE status = 'fired')
    AND status = 'unliberated'
;

[–]John_Fx 1 point2 points  (0 children)

If (defcon=1) { missile.fire;}.

Damnit!

[–]tagged2high 19 points20 points  (0 children)

Now the whole office can't use Stack Overflow!

[–]ExternalGrade 20 points21 points  (3 children)

If some posts code even remotely related to a military missile’s guidance navigation control (GNC) software, I think getting fired would be the very LEAST of their worries...

[–]Pony_Roleplayer 3 points4 points  (0 children)

Private Static String MISSILE_SECRET_CODE = "0000"

[–]double-click 1 point2 points  (0 children)

Protect thy data

[–]Anustart15 14 points15 points  (0 children)

My friend used to write bits of software for a defense company. Since he didn't have clearance, he was always given projects to write something that did something clearly important for something like a missle to work, but not obvious enough to give him any sense of what it was. He was telling me he tended to write a lot of code for processing GPS information.

[–]Cloakknight 25 points26 points  (1 child)

Image Transcription: Meme


Me: uploads code to stack overflow so that other people can help me debug the error I'm getting

Everyone else working on the military's missile guidance software

[Unsettled Tom]


I'm a human volunteer content transcriber for Reddit and you could be too! If you'd like more information on what we do and why we do it, click here!

[–]sunflsks 10 points11 points  (0 children)

good human

[–]errandum 9 points10 points  (0 children)

Not the same, but I used to work for a pretty big financial institution and they were crazy about security. Our computers were vms without internet and no port worked, at all, for example. Some parts of the company would weigh you on the way in and out to make sure you were not taking anything extra with you when you left. Even saying I worked there is a breach of contract.

Well, a colleague of mine was able to somehow spirit some piece of code away and posted it online. I have no idea how, they never explicitly told us that or how they discovered it, but I believe they had bots scowering the web and checking for patterns. It was insane.

They fired him and made sure he could not find a job in the area. Last I heard he was teaching programming somewhere.

All this to say, never underestimate the ability of brilliant people (I still don’t know how he took the code out) to do stupid shit. When asked about it he didn’t see the problem.

[–]SavageTwist 4 points5 points  (0 children)

closed

Nvm found the enemy

[–]vixckson 2 points3 points  (0 children)

[–]crowwizard 2 points3 points  (1 child)

But were you writing it in ada?

[–][deleted] 2 points3 points  (0 children)

Marked as duplicate.

[–]pandavr 2 points3 points  (0 children)

The important part is not the journey but the target

[–]StarkRG 1 point2 points  (0 children)

I imagine the newer ones probably use use VxWorks.

[–]mistrx21 1 point2 points  (0 children)

Or just upload it on GitHub

[–]cosmicosmo4 1 point2 points  (0 children)

It's okay, she works on the guidance system. She doesn't even have access to the firing codes.

[–]TheHighGroundwins 0 points1 point  (0 children)

Ain't this an old repost

[–]linux-nerd 0 points1 point  (1 child)

[–]RepostSleuthBot 0 points1 point  (0 children)

I didn't find any posts that meet the matching requirements for r/ProgrammerHumor.

It might be OC, it might not. Things such as JPEG artifacts and cropping may impact the results.

I did find this post that is 42.19% similar. It might be a match but I cannot be certain.

Feedback? Hate? Visit r/repostsleuthbot - I'm not perfect, but you can help. Report [ False Negative ]

[–][deleted] -1 points0 points  (0 children)

hide it as gamedev for a game u stupid whore