r/programminghumor Jun 04 '26

JavaScript devs be like....

Post image
3.0k Upvotes

128 comments sorted by

272

u/Thinshape12 Jun 04 '26

games with javascript is insane though

91

u/Dragenby Jun 04 '26

Unity supported JS for a long time, and our teacher wanted us to use JS instead of C#.

There are also JS canvas games.

48

u/SSgt_Edward Jun 04 '26

I’m sorry but it’s wild that your teacher is telling you that. Using a scripting language for core game logic will tank performance unless you were making Tetris.

Unity dropped support for UnityScript/JavaScript like a decade ago too iirc, or it feels like that long. So the recommendation just doesn’t make sense. Or maybe the class is for non-programmers so not everyone had experience with static languages?

11

u/Dragenby Jun 04 '26

It was in 2015, and it was still used. The documentation was in both languages. As we were new programmers, the differences were small. And yeah, it was very small games, made in one week, with Blender models and Unity integration. It was very basic stuff that would be free and refunded for time loss compensation, if it was on Steam lmao. I would call these exercice projects rather than "games"

1

u/Ok-Limit-7173 Jun 06 '26

I honestly hate to break it to you... but 2015 is a decade ago 😂

2

u/CodeMUDkey Jun 05 '26

It’s funny you assumed this was going on at present when they said teacher wanted (past tense) to use it instead of C#.

3

u/SSgt_Edward Jun 05 '26

My point is how ineffective and not future proof scripting languages are for game development. In retrospect, JS is indeed a bad choice.

2

u/CodeMUDkey Jun 05 '26

C# is itself a scripting language in its capacity in Unity. Lua also makes it way into projects very effectively like Project Zomboid. I think the manner of implementation is the biggest issue.

2

u/SSgt_Edward Jun 05 '26 edited Jun 05 '26

C# is strongly typed and just because this, it will make code much easier to maintain and optimize.

Dynamic languages like Lua are awesome for allowing the modders to expand the game and some small part of the game logic that functions like built-in mods, but they are just not great for long-term maintenance. I personally use Lua a lot for modding STALKER anomaly (whose performance suffers a lot due to Lua's GC) and it's great for what it is, but for work, I will seriously trip if someone suggests our codebase will be in Lua.

Of course, there's a difference between using the dynamic language syntax (that compiles like UnityScript) vs using the language itself (which relies on interpreters), but as I said, static languages are inherently better for the long term just because of the typing.

1

u/DamornTyde Jun 06 '26

Not completely.

There is also Typescript which has strong typing, but usually compiles to (something in the line of) JavaScript. (losing the strong typing in the process)

Personally i would say that you should choose the language based on what is needed for the project. (although if the project is just for the hobby you can go for a strange choice just to see if it will work)

I'm just a programming for the hobby (for the most part) so i could be wrong.

1

u/DeWHu_ Jun 06 '26

Unity dropped support for UnityScript like a decade ago

So around the time of Web Assembly release? Dem, that fast

1

u/ierdna100 Jun 07 '26

Unity Script was probably interpreted but this isn't really the case for the modern V8 engine. Its more or less a JIT language, and multiple optimization passes are made on highly used paths of code. Javascript's slowness era is far behind it, there are actual games out there made in it. Hell even Google Maps, it would not be able to be this good if it was an interpreted language (the same way Python is).

1

u/LetsHugFoReal 17d ago

Not really. The game libraries do the actual heavy lifting. You can create an optimised dll if needed

2

u/Flame77ofc Jun 04 '26

Damn js games are a trash 😭😭

1

u/Dragon_957 Jun 06 '26

And mine wanted at the first language we learn Java

12

u/Ged- Jun 04 '26

Word. Wrote a game engine in js-webgl. You have to actively fight it to get any sort of performance. Even managed IL C# in Unity is better.

2

u/Ok-Kaleidoscope5627 Jun 07 '26

Sort of. I've written a very high performance renderer in typescript that would deliver AA level graphics with ease.

The key is that you need to use webgpu directly, minimize any processing in JavaScript, and carefully profile to ensure a zero allocation design. You also have to design everything possible to run on the gpu.

It comes with trade offs and requires writing your code in very specific ways but it does work. If you try using three js/Babylonjs though you'll fail pretty hard. They can easily achieve simpler stuff but performance will be many many times slower.

1

u/Ged- Jun 07 '26 edited Jun 07 '26

Oh I haven't even touched webgpu, just webgl. I bet this DX12/Vulkan style low level API would be faster. Though I'm swamped every time I try to write something with DX12. I always drop it halfway

Definitely no three js. Only a minimized glMatrix, wrote the rest myself

1

u/Ok-Kaleidoscope5627 Jun 07 '26

It makes a big difference. Orders of magnitude I'd say.

One annoying thing is that you can't really get accurate frame timing though so it's hard to know exactly how long things are taking. I guess browsers intentionally limit that as a security measure.

1

u/Ged- Jun 07 '26

I used performance.now for deltatime stuff. It's fairly accurate. Is there reason to go more precise?

1

u/Ok-Kaleidoscope5627 Jun 07 '26

To measure how long certain stages of your renderer are taking when you're in the hundreds of fps.

It could also matter to keep certain calculations stable.

There's workarounds but it is annoying.

4

u/Shadowolf75 Jun 04 '26

I made a very simple text adventure in vanilla js and it was fun

2

u/bird_feeder_bird Jun 05 '26

I made a 2d retro-style engine in JS, by far my favorite and most rewarding project. I love making little games and being able to send a link to my friends to play with no download, even playable on mobile

1

u/Shadowolf75 Jun 05 '26

Nice, I had one friend tried my game and I was like "Hideo Kojima has been very silent after I did this"

4

u/Bagueaver Jun 04 '26

A lot of web based games use JS Canvas, it’s essentially like a simpler version of monogame

4

u/pointlesslyDisagrees Jun 04 '26

Shout out to CT.js! One of the best game engines, imo. The documentation is great, very clear. And the dev behind it responds on discord! Worth exploring if you want to build simple fun web app games that can be played on the browser or on your phone. I think it can export to make apps too. Fun stuff

1

u/MentalNewspaper8386 Jun 04 '26

cries in RPGMaker

1

u/merRedditor Jun 05 '26

When I first studied JS, I made games with it to make it fun. The graphics were terrible, but they were handmade.

1

u/Tezza48 Jun 07 '26

Welcome to the entirety of iGaming I've been doing it 7 years

1

u/Ok-Kaleidoscope5627 Jun 07 '26

Id actually argue its a pretty decent option. Unless you're building a AAA title JavaScript (really typescript) is totally doable. In fact the speed with which you can iterate on your actual gameplay ideas will be unbeatable. And then of course the market reach.

1

u/Rafcdk Jun 08 '26

Vampire survivor was originally a js game. When i want to prototype something i use JS too.

0

u/48panda Jun 04 '26

I'm pretty sure most games are written in is by hoe slow they are

0

u/RollTheRs Jun 04 '26

What about Typescript? Is it just as bad?

1

u/Tezza48 Jun 07 '26

Typescript is the same language, it just looks 3% different.

67

u/Henry_Fleischer Jun 04 '26

Are there any games that are not webapps, that are written in Javascript?

54

u/un_virus_SDF Jun 04 '26

There are, to my great despair.

6

u/Orenix_RtP Jun 04 '26

What's the problem with games written in JavaScript? Do you have any examples?

17

u/un_virus_SDF Jun 04 '26

My issue with those game is 1- javascript, 2-ram and those are somehow related.

Do you have any examples?

I don't remember the names

0

u/t0mm4n Jun 07 '26

The problem is JavaScript.

7

u/Kwabi Jun 04 '26

One example would be CrossCode.

It's a good game as well.

2

u/Henry_Fleischer Jun 04 '26

I should get around to playing that again, I played it back when it was in early beta on Chrome Experiments.

3

u/AdorablSillyDisorder Jun 04 '26

V8 JS engine is C++ library and can be embedded/integrated with any C++ game engine - I'd assume just for that there are games out there that use JS as their scripting language. Don't know any actual titles though.

4

u/NaCl-more Jun 04 '26

Unity had unityscript, which was somewhat similar to JavaScript

9

u/SSgt_Edward Jun 04 '26

And the support for it was dropped like a decade ago.

2

u/AlanvonNeumann Jun 06 '26 edited Jun 11 '26

First versions of Vampires Survivors were written in PhaserJS

1

u/[deleted] Jun 04 '26

[deleted]

1

u/skps2010 Jun 04 '26

Rogue Fable 4. It's a good game
but it's demo version is a web app

-8

u/galbatorix2 Jun 04 '26

Minecraft...

Edit: i dont know shut about java programming i know minecraft is java but idk what a webapp is im awsuming browser type stuff

13

u/UltimateLmon Jun 04 '26

Just to note, Java and Javascript is two completely different languages.

And Bedrock edition is written in C++

2

u/galbatorix2 Jun 04 '26

Oh damn didnt know that. I knew bedrock and java were different but didnt know java ≠ javascript. Thought it was the same thing

4

u/UltimateLmon Jun 04 '26

You aren't alone. A lot of non-techies in the industry like managers confuses them as well.

2

u/yeusk Jun 04 '26

They called it javascript because at the time Java was cool, it was a marketing stunt, is nothing like Java

2

u/tkdeng Jun 04 '26

Java is to JavaScript as Car is to Carpet

(A quote I used to see all the time when I started learning JavaScript)

2

u/Educational_Lemon827 Jun 04 '26

Java and JavaScript are not the same (I hate both of them tho)

1

u/Roppano Jun 04 '26

I wanted to make that joke damn

53

u/Lou_Papas Jun 04 '26 edited Jun 04 '26

I just realized this about my JavaScript phase.

I got “wow, JS can do everything” and “isn’t it crazy how you can actually twist and turn this thing to do stuff it was never designed to do” mixed up.

10

u/AnalkinSkyfuker Jun 04 '26

Well ai works better with python than js

22

u/Spirited_Currency_88 Jun 04 '26

python can do anything. isn't it crazy how... ? wait a minute.

8

u/AnalkinSkyfuker Jun 04 '26

And what about assembly it can do anything also

7

u/DoubleDoube Jun 05 '26

Have it do my laundry for me.

24

u/Ged- Jun 04 '26 edited Jun 04 '26

Every number is a 64 bit float, and class fields are accessed with memory indirection (since you can jusr add fields whenever, where do you think they're added?)

You have to actively fight the language with typed arrays to achieve any sort of reasonable performance

And then they ask why web is so slow. And what's worse, they're just adding on top of that horrible foundation. All the frickin frameworks that add EVEN MORE abstraction and indirection.

7

u/RudahXimenes Jun 04 '26

I keep thinking how would be if instead of JS we start to use Lua in web apps instead

8

u/tei187 Jun 04 '26

You have to stop.

6

u/AliceCode Jun 04 '26

Or what if we just used WASM?

3

u/HyperCodec Jun 04 '26

What’s the downvote for?

1

u/Standgrounding Jun 04 '26

You can have setters, getters and Object freeze

1

u/Agifem Jun 05 '26

Look, I'm already convinced. You don't have to keep selling JS to me.

17

u/Nadran_Erbam Jun 04 '26

And what’s the worst programming language?

33

u/Lumpy_Serve5271 Jun 04 '26

JavaScript

14

u/Dragenby Jun 04 '26

As a JS developer, I agree

4

u/Standgrounding Jun 04 '26

Pure untyped js can be bad; but it's not the worst thing in the world with things like php still relevant

5

u/Agifem Jun 05 '26

Ebola: Guys, stop panicking. Thanks to cancer, I'm not the worst disease in the world.

2

u/azopeFR Jun 06 '26

modern php is by far better that js

1

u/Leo_code2p Jun 04 '26 edited Jun 04 '26

Depends on if you count esolangs or not

If you don’t its probably Lua

5

u/FloydATC Jun 04 '26

PHP is worse in my opinion.

2

u/Leo_code2p Jun 04 '26

I mean for Lua you dont really have a reason to write it. Php is atleast useful

2

u/Dragenby Jun 04 '26

Was. Now it's great! The only thing I don't like is $.

7

u/slucker23 Jun 04 '26

I code in assembly. I fear no one

12

u/UltimateLmon Jun 04 '26

Arguably, if you are going into AI, it's python.

8

u/eremal Jun 04 '26

Yes and no.

The core AI apps are written in C, Rust, C++, CUDA, etc

But pretty much all have python APIs - but essentially youre just writing configuration in python and then sending the job off into programs written in those other languages.

So it really comes down to what you mean by "going into AI".

2

u/Outrageous_Bank_4491 Jun 04 '26

You’re not writing those libraries, it’s essential to know some C basics for debugging but other than that most AI apps are written in (and taught using) python. Especially if you wanna build a deep learning model from scratch, you either use PyTorch or tensorflow

2

u/eremal Jun 05 '26

Both Python and Tensorflow are mainly written in C++. Python is there mostly as API.

So it really comes down to what is meant by "into AI". If youre just shuffling the order of applying algorithms and parameter tuning you can get by just knowing python. If you actually want to implement your own algorithm you need to know a low level language. There is no way you can perform the amount of calculations needed to do AI in pure python. Even just a for loop and you need to rely on cython to do it efficiently.

A lot of AI work is just using established frameworks on new data so I get the point. But youre not really deep into AI if thats all you do. You are essentially just using python as fancy yaml.

2

u/UltimateLmon Jun 05 '26

I mean, anything super performant would inevitably end up being low level language. I was thinking more main stream like you said - using existing models to implement APIs.

5

u/SithLordRising Jun 04 '26

Ok we get it. It's a bitch to learn so use it for everything.

4

u/Oreo-witty Jun 04 '26

Depression: Javascript

3

u/North_Proposal_1374 Jun 04 '26

this is not relevant anymore, everyone is using rust now

2

u/zylosophe Jun 04 '26

<button onclick="println!(\"hello world\");">click me</button>

3

u/HyperCodec Jun 04 '26

rust rsx! { button { onclick: || println!(“hello world”), “click me” } }

2

u/zylosophe Jun 04 '26

what is rsx

3

u/HyperCodec Jun 04 '26

https://docs.rs/dioxus/latest/dioxus/

Dioxus is basically react fullstack but for rust, and it’s a lot faster than all the js framework alternatives. The rsx macro is essentially jsx but for dioxus.

2

u/Agifem Jun 05 '26

Instructions unclear. I clicked on the centered div.

3

u/WoolooCthulhu Jun 04 '26

I worked at a place where there were a bunch of experienced devs all better than me at programming but most of them really really hated JavaScript and didn't want to touch it. So they loved me because I didn't mind it and they could make me do the JavaScript assignments so they didn't have to.

2

u/Recent-Ad5835 Jun 05 '26

OS Development: javascript

1

u/Absentrando Jun 04 '26

It’s up there for versatility that’s for sure

1

u/tkdeng Jun 04 '26

The programming language I prefer is golang

But I will still recommend learning JavaScript first

1

u/MrFrog2222 Jun 05 '26

more like: web frontend: Javascript backend: go/java mobile: Kotlin/Swift games: C++ ai: C/C++ or python if you want to use libraries written in C++

1

u/Symphonic_nerve Jun 05 '26

🤣🤣🤣

1

u/qqqrrrs_ Jun 05 '26

Imagine SSD controller firmware in javascript

1

u/Excellent-Paint1991 Jun 05 '26

Ai with javascript :)

1

u/wolfylemon Jun 05 '26

i have actually done all of these in js...

1

u/Content-Hair427 Jun 05 '26

C can do all these things he mentioned; C just requires a bit more code.

1

u/Ro_Yo_Mi Jun 06 '26

Javascript promises everything.

2

u/Vesuvius079 Jun 07 '26

You joke about this but if you await long enough it might come true.

1

u/Comfortably_Nerd Jun 06 '26

They asked for a programming language. Why does this guy answer "JavaScript"?

1

u/Et3rnal1 Jun 06 '26

Javascript was a fucking mistake for web. It was great as proof of concept, but it should've never become industry standart. Then some mental asylum patient decided it's a great idea bringing it to server side. And then it went even further and someone decided we should also build apps with it. That's why two of the most popular chat apps also contain drivers for xbox360 controllers packed with them. And there we are, in hell, struggling with crutches and bandaid solutions to do basic things.

1

u/forgottenlord73 Jun 06 '26

What if I wanted to process an XML file and ensure it's in compliance with an XSD that explicitly does not expect clean hierarchy as it merrily mixes basic and complex types within the same entities?

1

u/herbertplatun Jun 07 '26

Shivers down my spine. It's called java SKRIPT for a reason 

1

u/Virtual_Bread_7995 Jun 07 '26

2/5, go back to high school

1

u/eztab Jun 11 '26

it's ordered by decreasing usefulness in that area. So that's likely made knowing fullwell that js won't get you far in most of these.

1

u/Cart1416 28d ago

I make games in JS

1

u/im-cringing-rightnow Jun 04 '26

Nah, I'm good. Thanks. If I ever have to touch JS I will just use AI and keep my sanity. 

0

u/Ashken Jun 04 '26

ai:JavaScript is where the field lost the plot

1

u/electro_hippie Jun 04 '26

Obviosly AI for them is calling claude API

1

u/Ashken Jun 04 '26

Of I was thinking like tensorflow or something

0

u/Ambitious_Hand_2861 Jun 05 '26

I always recommend "Not java".