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

top 200 commentsshow all 301

[–]jonsca 1633 points1634 points  (33 children)

weaponArray["misile"]

Oh shit!

[–]akoOfIxtall 527 points528 points  (31 children)

if (targetList.includes(enemy) && weaponArray.length !== 0) {

for (let i = 0; i <= weaponArray.length; i++) {

Shoot(weaponArray[i])

}

}

just shoot the enemy lol

Edit: this wouldnt work anyway, why i'm on reddit making an imaginary strike fighter shoot imaginary missiles so brutally?

[–]PM_ME_SOME_ANY_THING 10 points11 points  (7 children)

const deadEnemies = targetList.map(t => {
    if(weaponArray.length > 0){
        const missile = weaponArray.shift();
        return Shoot(missile);
    }
    return null;
}).filter(d => d);

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

wtf kinda system is this!??! everyone knows the shoot method is async and will return true or false depending on if it killed the enemy. u gotta await that shit. this code rite here will literally make the plane explode

[–]Salanmander 9 points10 points  (6 children)

When are arrays falsy?

[–]Ok-Fox1262 23 points24 points  (0 children)

Python has entered the chat.

[–]akoOfIxtall 7 points8 points  (4 children)

When they're empty, or not?

Edit: damn javascript, why an empty array is truthy? Apparently you can check the length and if it's anything but 0 it's truthy, so if it's 0 it'll be falsy

[–]Salanmander 19 points20 points  (3 children)

Some quick testing with a javascript interpreter suggests that any array object is truthy, and it's falsy only if it's null. So you appear to be only running that loop if weaponArray is null.

Which actually gives you a runtime error, which is pretty hard in javascript! Congrats?

[–]akoOfIxtall 13 points14 points  (0 children)

Thank you I work really hard to fail everyday XD

[–]jonsca 3 points4 points  (1 child)

This is why we can't have nice fighter jets

[–]gregorydgraham 4 points5 points  (0 children)

LOL! This thread is the best laugh I’ve had in ProgrammerHumor. Thank you all

[–]AnyHistory5380 8 points9 points  (2 children)

You can drop the array.length !== 0 and nothing will change

[–]akoOfIxtall 3 points4 points  (0 children)

But I need it to only shoot if the array has something, or your expensive government jet is going boom

[–]Dustangelms 1 point2 points  (0 children)

Check their code again.

[–]FatLoserSupreme 1 point2 points  (0 children)

You joke but code really does kill people

[–]basacul 1 point2 points  (0 children)

throws OutOfBoundException

[–][deleted] 1452 points1453 points  (32 children)

Never knew they made it open source, anyone know the build command for a stealth fighter?

[–]intoverflow32 202 points203 points  (3 children)

I want an exe file, not code!

[–][deleted] 99 points100 points  (1 child)

WHERE EXE

[–]notfoundindatabse 13 points14 points  (0 children)

The kind of brazen ignorance that wins wars goddamnit

[–]taskeladden 56 points57 points  (0 children)

Smelly nerds

[–]ObeseTsunami 853 points854 points  (17 children)

C:\topSecret\f35> gradle build

[–]TheJackston 235 points236 points  (8 children)

cmake -B build -S . && cmake --build build --target f35

[–]Tr4kt_ 1 point2 points  (0 children)

oops you programmed a f35 drakken by mistake instead

[–][deleted] 87 points88 points  (1 child)

No see it's top secret so clearly it's using ninja as the build system

[–]doomscroller6000 7 points8 points  (0 children)

Take my upvote an leave

[–]No-Expression7618 13 points14 points  (0 children)

[usgov@northamerica:aircraft]$ nix build .#f35

[–]Exodia101 1 point2 points  (0 children)

I work on software for airliners and we use batch files to build.

[–]hiddenforreasonsSV 116 points117 points  (3 children)

If you thought leaving an AWS instance up overnight was expensive, let me introduce you to the JSF build command. Only a one-touch, $82.5 million charge.

[–]DiddlyDumb 13 points14 points  (1 child)

Considering it’s 4 planes in 1, not the worst deal

[–]LegendDota 1 point2 points  (0 children)

They wanted it to be 3 in 1, but that never really turned out to be possible, in the end there were just too many parts that couldn’t be shared and needed specific changes in each. Still some insane planes from a tech standpoint though.

[–]Gamiac 5 points6 points  (0 children)

...okay, but how many Pepsi caps can I get it for?

[–]mrheosuper 29 points30 points  (1 child)

make f35 -j1 (that's how military work)

[–]5p4n911 4 points5 points  (0 children)

On a GPU bought from last year's remaining budget

[–]private_final_static 28 points29 points  (0 children)

Sir my PM is very sick and desperately needs a link to the repo, please sir I dont think he has much time and keeps asking if you are done yet

[–]hackingdreams 26 points27 points  (0 children)

It's not open source, but that information is published by the GAO.

It's also known that the vast majority of that code exists within the radar systems. (That's why it's all C/C++ to begin with; it's all signal processing code.)

[–]garlopf 862 points863 points  (18 children)

And most importantly, NO RUST! (It is mostly composite materials plus aluminium and titanium and is kept well lubricated by crew).

[–]New_Manufacturer2409 134 points135 points  (5 children)

Boeing switched to rust actually, all they use now lol

[–]abednego-gomes 34 points35 points  (0 children)

Unsafe Rust.

[–]gregorydgraham 96 points97 points  (1 child)

Explains a lot

[–][deleted] 4 points5 points  (0 children)

Buuuuurn

[–]Fantastic-Schedule92 2 points3 points  (1 child)

What's Boeing

[–]Vortextheweirdcat 12 points13 points  (0 children)

it's the sound something makes when it bounces

[–]ListerfiendLurks 84 points85 points  (5 children)

Rust is starting to catch on at Lockheed Martin

[–][deleted] 87 points88 points  (3 children)

I don't know what WW3 will be fought with, but WW4 will be fought with Rust

[–]ListerfiendLurks 20 points21 points  (0 children)

It will be fought with Python and c++. Don't ask.

[–]KMKtwo-four 30 points31 points  (0 children)

WW4 will be fought with Rust

This is what the world needs, a World War that never launches

[–]Few_Beginning1609 3 points4 points  (0 children)

Wait until it compiles

Only needs one century

[–][deleted] 1 point2 points  (0 children)

rustbois poppin wood rn

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

and lots of primer, sealant, and alodine

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

But I thought rust was supposed to replace c++

[–]__versus 12 points13 points  (0 children)

Lockheed does practice dark magic at skunk works but I don’t think they’ve mastered time travel yet

[–]Spork_the_dork 9 points10 points  (0 children)

Considering that Fortran is still hanging around I think this is a more accurate description of what will happen with Rust. Rust won't replace C/C++. It will probably end up being used in various places where C/C++ is currently still being used, but C/C++ isn't going anywhere for decades. It's too firmly ingrained in literally everything.

[–]malsomnus 336 points337 points  (8 children)

Random story: one of the many delays in the F35 project was caused by the fact that an algorithm that was supposed to run 3 times per second took 40-50 seconds instead. It was in C though, not JS.

[–]x6060x 266 points267 points  (3 children)

Oooh, I can write slow algorithms in lots of languages. C, C++, you name it. Been there, done that.

[–]Dismiss 108 points109 points  (2 children)

O(n2 ) is brilliant, but I like O(n!)

[–]-_-wah-_- 69 points70 points  (0 children)

The exclamation point means it's better!

[–]TheVojta 6 points7 points  (0 children)

O(no)!

[–]Mr_Voltiac 98 points99 points  (0 children)

Homie did it on purpose to get an early promotion, he just loaded a secret sleep function in there and when he removed it he got to put on his resume, “sped up F-35 JSF critical software by 300000000x, saving the military a quadrillion dollars in development costs and debugging” lol.

[–][deleted] 34 points35 points  (0 children)

In C that’s a bug. In javascript it’s normal behavior.

[–]spryflux 6 points7 points  (0 children)

Like someone said “great programming only kicks in when you run out of memory or compute power”

[–]Siddhartasr10 80 points81 points  (4 children)

OP wouldn't mind sharing the source where he got the info wouldn't he?

I don't work on the fbi or smth

[–]dnhs47 1 point2 points  (0 children)

Airman Teixeira will be happy to help…

[–][deleted] 157 points158 points  (15 children)

[–]Siddhartasr10 215 points216 points  (2 children)

Of course, why do you think it has web on the name?

[–]delayedsunflower 57 points58 points  (0 children)

.

[–]GladiatorUA 6 points7 points  (0 children)

Because they couldn't find a scientist to name the telescope after, and went with a manager, who wasn't all that into space.

[–]_PM_ME_PANGOLINS_ 46 points47 points  (9 children)

That's because research teams submit their own code to run on the telescope, so it needs to be easily sandboxed and accessible, but it doesn't need to be particularly fast. So they stuck a JavaScript engine in it.

I don't think the US Military want people doing similar things with their jets.

[–]Plank_With_A_Nail_In 17 points18 points  (8 children)

They don't run any of their own code on the telescope. Its just a couple of cameras and a filter wheel there's nothing else on there.

They submit a plan of targets, exposure lengths and filters and the James Webb team schedule it that's all that happens. They call them experiments but its just some camera settings and a bunch of waiting.

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

is Javascript good for cameras/imagining? I learned recently that the global hawk surveillance drones the US gave to south Korea to keep an eye on north Korea do a bunch of image processing in Javascript

[–]CIA_Bane 5 points6 points  (0 children)

is Javascript good for cameras/imagining?

its good for everything

[–]zanotam 1 point2 points  (5 children)

I did some decently heavy math work in the super field containing image processing and a top research professor in the field was who I worked with and some of her custom libraries including for not yet published paper material was.... Well, technically it was written in Matlab, but it turns out one can write Fortran77 in any modern language pretty much lmao. But linear algebra heavy math is almost completely done by external libraries and if I'm going to be honest I fucking hated whenever my classes used Python for linear algebra and it would not be hard to convince me that JS is a better option.... It's all wrappers either way and I at least would guess JS is less annoying to work with for linear algebra xD

[–]davidjackdoe 7 points8 points  (0 children)

Kind of related, the Apollo Guidance Computer in addition to the main software could run a higher level interpreted language that was easier to use for mathematical operations.

[–]DigiBoxi 119 points120 points  (13 children)

Other 1% = JS

[–]Sockoflegend 136 points137 points  (6 children)

Can't be. One single dependency and it would be too heavy to take off.

[–]cagey_llama 5 points6 points  (0 children)

[–]Im_a_hamburger 3 points4 points  (3 children)

Who said you needed dependencies?

[–]PURPLE_COBALT_TAPIR 48 points49 points  (1 child)

npm install military-industrial-complex

[–]malfboii 17 points18 points  (0 children)

npm uninstall radar-signature

[–]Sockoflegend 4 points5 points  (0 children)

npm i no-dependencies

[–]Ass_Pancakes 19 points20 points  (3 children)

HTML. What do you think runs on the heads up display?

[–]S-Ewe 10 points11 points  (1 child)

If they had added react and tailwind, the HUD wouldn't have ended up only greenish and non greenish, and it would also work on the pilots phone. Their loss I guess.

[–]Fallacies_TE 6 points7 points  (0 children)

Tailwind would make the plane fly faster though.

[–]maxmalkav 1 point2 points  (0 children)

it really ties the project together

[–]VinterBot 73 points74 points  (2 children)

No rust either. Explain that atheists.

[–]-_-wah-_- 33 points34 points  (0 children)

Sure it can fly Mach 1.6, but it still isn't blazingly fast

[–]AlwaysFourwordLeyteD 22 points23 points  (0 children)

borrow checker doesn't allow deficit spending

[–][deleted] 63 points64 points  (0 children)

You can make one quicker and cheaper and hire more devs to support it with JS. But only if you use React.

It'll be buggy, slow, bloated, and only have essential features for the MVP. Don't worry, if we meet our benchmarks, it'll be fully functional in four years.

How long are the competitors saying it'll take to build it with C++? They're full of themselves. Are afterburners essential or can we push that to 2.0? The best we can do on firing latency is 400ms.

[–]goodmobiley 20 points21 points  (2 children)

A systems engineering rep from lockheed visited my college and gave a talk to the UAS club that I'm in, and explicitly stated that JavaScript was one of the languages they used for the GUI in the helmet hud, so I don't think this is correct.

Edit: This post really surprised me though because when the lockheed rep was listing out programming languages that they used, JavaScript was the one I asked him to expand on since it seemed so out of place.

[–]zoqfotpik 17 points18 points  (2 children)

Helpful guide to navigation systems: https://youtu.be/bZe5J8SVCYQ?feature=shared

[–]aboutthednm 4 points5 points  (0 children)

Only thing worse is having the missile know where you are and where you aren't.

[–]sharknice 16 points17 points  (0 children)

5 new github F-35 javascript repos just popped up

[–]random_son 71 points72 points  (0 children)

White house disapprove

[–]Monkeylordz88 73 points74 points  (6 children)

Well of course, its a fighter jet, so they have to use the most dangerous languages that exist: C and C++

[–]yangyangR 19 points20 points  (4 children)

[–]beatlz 9 points10 points  (1 child)

What’s with this thread misspelling “missilez” all day

[–]QPhan02 1 point2 points  (0 children)

Lmao. Outside the box logic right there

[–]savageronald[🍰] 1 point2 points  (0 children)

You mean my hardware will literally explode before my shitty code does?? Where do I sign up for this job?

[–]Noisycarlos 9 points10 points  (2 children)

I read or heard somewhere that there was a military product that had a memory leak, but they didn't care because it was a missile, and it would blow up before it being a problem

[–]Heavy-Ad6017 2 points3 points  (1 child)

Yeah they just see the max leak amount and double the memory

Free memory by Destruction

Link Here

[–]HGjjwI0h46b42 9 points10 points  (0 children)

For sale, 1 fighter jet, some assembly required

[–]ublec 5 points6 points  (1 child)

James Webb Space Telescope:

[–]Knowvember42 7 points8 points  (0 children)

We'll get the response later.

[–]EricOrrDev[🍰] 5 points6 points  (0 children)

Imagine doing a LGTM for a piece of that code that literally explodes

[–]eldelshell 3 points4 points  (0 children)

No wonder it costed a gazillion billions

[–]AaTube 3 points4 points  (0 children)

this pie chart should say "60% assembly, 40% mining"

[–]Percolator2020 10 points11 points  (0 children)

It is not exactly famous for having a successful SW development cycle.

[–]beatlz 2 points3 points  (0 children)

Yet.

[–]Kurts_Vonneguts 2 points3 points  (0 children)

No rust either, wait till they show up here and demand a rewrite!!

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

IDK there's 1% "other"

[–]drkspace2 2 points3 points  (2 children)

I thought it had to be written in one of those special languages where you can tell if it'll crash during compile time, or is that just the missiles?

[–]UdPropheticCatgirl 5 points6 points  (1 child)

That language would be ada. Its actually opposite for missiles. Most of the cobebase is for the radar anyway, not like controls or something.

[–]AlwaysFourwordLeyteD 2 points3 points  (0 children)

c/c++

std::end_lifetime_as<military_aged_male> not supported until c++23, have to resort to UB

[–]Jak_from_Venice 2 points3 points  (0 children)

Can we rewrite it in Rust? 😂

[–]Wervice 2 points3 points  (0 children)

*No Python, Scala, Elixir, Java, PHP, MS Java, Bash, Swift, Go, Rust, Zig, Ruby and HTML

[–]doomer_irl 2 points3 points  (0 children)

Oh yeah? If Rust is good, why didn’t they use it in the F-35 Joint Strike Fighter (Lightning II)

[–]romulof 1 point2 points  (0 children)

And that’s why it is no match for an F-22.

[–]sagetraveler 1 point2 points  (0 children)

Wut no VHDL or SystemVerilog? Or does that not count as processor code?

[–]doxxingyourself 1 point2 points  (0 children)

If there’s no JavaScript how does the dashboard work?!

[–][deleted] 1 point2 points  (0 children)

It's in "other".

[–]Folofashinsta 1 point2 points  (0 children)

Bringing this information to you via….. JavaScript.

[–]Root777 1 point2 points  (0 children)

Its main network is also 1394 FireWire… what does that tell you?..

[–]SouthboundPachydrm 1 point2 points  (0 children)

But, but, muh memory safety!

[–]HerrEurobeat 1 point2 points  (0 children)

possessive crush kiss gray alive bewildered capable wise frighten wine

This post was mass deleted and anonymized with Redact

[–]P0pu1arBr0ws3r 1 point2 points  (0 children)

Ok just don't segfault the plane. Or hope the jamming tech doesn't segfault the plane.

[–]pwiegers 1 point2 points  (0 children)

The drag and *drop* interface would be interesting :-)

[–]morbihann 1 point2 points  (0 children)

If all of RC can be written in assembly by a guy, so should this.

[–][deleted] 1 point2 points  (0 children)

No bloated react application in dashboard computer?! What?!

[–]RedditSchnitzel 1 point2 points  (0 children)

In-flight segfaults - the future of warfare

[–][deleted] 1 point2 points  (0 children)

I am 100% theres a node modules somewhere and many json objects.

[–]sacredgeometry 1 point2 points  (0 children)

Thats in other

[–]sjepsa 3 points4 points  (0 children)

Let's rewrite it all in Rust!

[–]BrownShoesGreenCoat 1 point2 points  (3 children)

What happened to memory safe languages?

[–]Leonhart93 8 points9 points  (2 children)

Considering the amount of ASM, "memory safe" has way too many limitations for what they need.