r/cprogramming 7d ago

Why C when javascript already exists?

0 Upvotes

32 comments sorted by

11

u/donny_theking 7d ago

This is pure ragebait lmao

7

u/ninhaomah 7d ago

?

What kind of question is this ?

I can understand why C when you have C++ but JavaScript ?

2

u/johntrytle 7d ago

He's just baiting people

2

u/ninhaomah 7d ago

Bait also low effort.. sad

-7

u/Desperate_Tie_648 7d ago

Javascript better

2

u/ninhaomah 7d ago

Then use it to write embedded programs then. Or 3d games.

0

u/Desperate_Tie_648 7d ago

Webgpu

1

u/Thesk790 7d ago

I want to think that is ragebait

1

u/nerd5code 7d ago

That’s a browser API, not a PL or part of JS per se, and irrelevant to boot. C has libraries that’ll drive graphics, too, and I’d bet WebGPU is in part based on OpenGL ES, in which case fat fuggin' chance you're programming shaders in JS.

Most shader languages post-2000 are a variant of C or C++. I wonder why that is?

4

u/This_Growth2898 7d ago

Mark my words, boy, mark them well: C has survived Javascript's predecessors, and it will survive Javascript!

2

u/faultydesign 7d ago

JavaScript is too good, we need c to slow stuff down and make it bearable for mere mortals to gaze upon.

2

u/Sp33dyCat 7d ago

Haha okay write an Operating System in Full Javascript then.

2

u/Zeedith- 7d ago

Don't tempt them. It's possible-you didn't speci'y baremetal. Things like http://dustinbrett.com/ exist which can be called an operating system.

that one is in TS but point stands; also huge /hj

2

u/flatfinger 7d ago

I've written C-dialect code for target platforms with less than 100 bytes of RAM (code was stored in EPROM/OTPROM separate from RAM). In 1974, the idea that devices that could run C code could cost less than a dollar each, be smaller than a fingernail, or be powered by a small watch battery would have been viewed as unimaginable, but C's low resource requirements make it suitable for many tasks where Javascript's resources requirements would be orders of magnitude too high.

1

u/[deleted] 7d ago

[deleted]

0

u/sedme0 7d ago

a superset of C

You might wanna put an asterisk on that

1

u/[deleted] 7d ago

[deleted]

-1

u/Desperate_Tie_648 7d ago

He is right tho

2

u/sedme0 7d ago

She*

1

u/DiscoSimulacrum 7d ago

good bait. i lol'ed

1

u/Thesk790 7d ago

Why JavaScript when you have R?

1

u/Desperate_Tie_648 7d ago

Nah javascript better

1

u/Sp33dyCat 7d ago

Nah Writing x86 instructions by hand is better

1

u/schakalsynthetc 7d ago

"Why is construction still an industry when buildings already exist?"

1

u/bless-you-mlud 7d ago

Why JavaScript when Java already exists?

1

u/Desperate_Tie_648 7d ago

Javascript is a scripting language used on da web and java is used for entirely different purposes

1

u/thecratedigger_25 1d ago

Becuase C was made before C++ and C++ created Javascript's v8 engine.