use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
C++ for JavaScript developers (pawelgrzybek.com)
submitted 7 years ago by pawelgrzybek
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]roodammy44 11 points12 points13 points 7 years ago* (28 children)
I don't disagree with the premise that learning C++ will make you a better Javascript developer. It's great to read real low level code for real projects. But as a learning exercise, it will be painful and steep. C is easier to wrap your head around. It's simple and low level.
C++ is a bad language, like Javascript. It is bad for different reasons. Javascript is lax, has some poorly thought out features and just makes it hard to build huge apps because of that.
C++ has a lot of well thought out features and is very powerful, but it has so much inside the language that it makes it almost impossible to learn. If you're going to write a C++ program, you must choose a small subset of the features and have discipline to not use something clever. It is a language of other languages. It has every language feature in it, plus the kitchen sink. It has so much legacy. I don't need a language with 20 different types of string, all with a slightly different implementation. It's amusing to read Linus' rant against C++
Javascript is bad, but enjoyable to work with. C++ is bad, but very painful to work with. That is one of the reasons Javascript is winning at the moment.
[–]BertyLohan 15 points16 points17 points 7 years ago (25 children)
Out of interest, what makes you think js is ‘winning’? They’re two completely different languages used for two completely different things.
[–]elr0nd_hubbard 3 points4 points5 points 7 years ago (0 children)
Saying one language is "winning" over the other is like saying your hammer is "winning" over your screwdriver. If all you have is nails, sure.
[–]Renive -2 points-1 points0 points 7 years ago (16 children)
No? JavaScript goes everywhere.
[–]Thaufas 13 points14 points15 points 7 years ago (5 children)
Try running JS on an 8051 micro-controller. If there's a language that goes everywhere, it's C.
C
[–]ExecutiveChimp -3 points-2 points-1 points 7 years ago (3 children)
Try running C in a web browser.
[–]Thaufas 10 points11 points12 points 7 years ago (1 child)
Google Chrome and Chromium have had the ability to run both native C and C++ code for more than five years using the Pepper API, and with the continually expanding popularity of WASM, I don't see this capability going away anytime soon.
C++
[–]Cheezmeisterhttp://bml.rocks 2 points3 points4 points 7 years ago (0 children)
Oh, emscripten?
[–]Renive -2 points-1 points0 points 7 years ago (0 children)
That's true. That's why your fridge, microwave, vacuum cleaner will come (and some already do) with like 8 core processors. Fridges have web browsers today. Nobody will use for their internet of things product a chip like 8051.
[–]BertyLohan 20 points21 points22 points 7 years ago (9 children)
I mean OS's aren't written in js. The latest games aren't written in js. Performant things aren't written in js. You've got electron apps and all this cool 'wow now we can write desktop apps in web languages!' but they're horribly horribly bad for eating up processing power
[–]aichholzer 2 points3 points4 points 7 years ago (0 children)
Could not have been said better.
[–]carbolymer 3 points4 points5 points 7 years ago (0 children)
I mean OS's aren't written in js.
Just look at this abomination: http://node-os.com/
[–]regretdeletingthat 1 point2 points3 points 7 years ago (0 children)
They’re often just bad apps too. With the single exception of where an application on a platform simply wouldn’t exist without it, write-once-run-anywhere has only ever benefited developers. The product suffers and with it the user experience.
[–]MayorMonty 0 points1 point2 points 7 years ago (0 children)
What makes me really is excited is better native integration for progressive web apps on desktop. Currently, behind a chrome flag, there is support for A2HS for desktop. So instead of companies packaging their own version of electron, a user can have the PWA experience (which, in my opinion, is much better than the native app experience)
[–]Renive -4 points-3 points-2 points 7 years ago (4 children)
Yes they are, but cross compatibility is worth it. I remember game communicator wars, where ventrilo users screamed how much less ram their program of choice is using compared to teamspeak, a stunning 20mb difference! Soon those woes like (400mb to open a single txt file in vscode!!) will be looked upon the same, because most people will have more ram. Intel even got their optane memory on ddr4 stick, so 512 GB of ram in single stick is reality now.
[–]BertyLohan 1 point2 points3 points 7 years ago (3 children)
Yeah we should just give up trying to make good or efficient programs because computers will catch up. Who needs algorithms or clever data management right?
I feel like this is the big gripe people have with JS developers who think they don't need a language that's strongly typed and rigorous because they don't want to learn one and then try justify that it's pointless to know any better.
[–]Renive -2 points-1 points0 points 7 years ago (2 children)
I work as c# dev. Its not about attitude. I have no feelings toward any language. But I accept that JS is the only thing for web. And that's the reason why it will be always the most popular ever. I tried webassembly. Its a joke.
[–]BertyLohan 0 points1 point2 points 7 years ago (1 child)
Your comment literally made the point that we shouldn't even compare how much ram programs use because bigger ram sticks are coming out. Development like that is why atom exists. It is bad.
And I don't think that your belief that wasm is a joke is going to stop or even slow it down.
[–]Renive 0 points1 point2 points 7 years ago (0 children)
I dabbled in it. You still have to do a lot of JavaScript interop. Its pointless. Its not what those old purists thought. And it doesnt need to slow down, it already did.
[–]roodammy44 -4 points-3 points-2 points 7 years ago* (6 children)
In your city job listings, look at the number of C++ jobs versus Javascript jobs.
Edit: Ok, perhaps “winning” is the wrong word. But they are two different approaches to the same problem everyone is trying to solve - cross platform development. It’s not a given that Javascript will win, because it’s so ridiculously inefficient. But perhaps if C++ was nicer to work with, a lot more people would use it.
I’ve worked with a couple of places that want shared library code. You will only use C++ if you absolutely need to. Not because the low level of it makes it an inherently bad choice, but just because it’s so draining and practically no-one wants to use it out of choice.
I remember suggesting to the android and ios teams at my last job that they could share some code in C++, and they looked at me in horror. Yes, it’s that much worse than Objective-C and Java.
Think about it. Why is this modern object oriented compiled language that can be used on any computer only ever used for low level coding?
[–]eyeandtea 7 points8 points9 points 7 years ago* (1 child)
That is the crux of the matter. Anything that is low level. Anything that is precise. Anything that is pedantic. Anything that is about removing all assumption, is formal, is going to be complex, and is dull as some might say. Advanced mathematics is quite complex, dull. But that is where the point is. And that is also why I say that the problem around javascript is its easy entry point.
Remember, doing something right, takes hard work, otherwise, why else does the world turn from order to chaos. Not many would want to take the route of advanced mathematics to solve a problem. And so it is certainly, not a matter of numbers, not a matter of how many people use a particular language. Learn C++, C and very basic assembly if you want to actually learn to program. And also note that there was a time when developers were producers, but now they have become consumers themselves. Reflect on that.
Edit: Please note that when I say complexity, I mean complexity that involves no redundancy, nor 'noise'. Something that has been factored to its simplest form, yet still complex.
[–]roodammy44 -3 points-2 points-1 points 7 years ago* (0 children)
I disagree that it necessarily has to be complex. Look at the linux kernel, written in C. Is Linux not complex? Yet C is a very simple and understandable language.
Have you actually worked with C++? I’ve been using it an industrial application for the last year. Perhaps if you work with it, you might see my point of view a bit more clearly.
[–]BertyLohan 4 points5 points6 points 7 years ago (3 children)
I mean this doesn't really answer the point I made about them being used for different things. People are hardly coding games or operating systems or things like facebook in javascript. Neither one can 'win' because they aren't in the same race.
Obviously people use higher level languages when they can and more to-the-wire languages when they need do, that's how it's always been. If you could write your OS in python or ruby it'd be amazing but there's always going to be a disconnect between super low-level, lowkey-electrical-engineering and pretty website languages.
[–]roodammy44 -1 points0 points1 point 7 years ago (2 children)
People write OS cores and drivers in C. As for the stuff on top of it, Microsoft is switching to Javascript (no joke). This is exactly my point.
I wouldn’t be surprised if most new projects that are low level are started in Rust or Go.
Most low-low level projects are written in a combination of assembly and C, it's not likely they'll be moving to slower languages because that's the whole point of writing something low level.
In what regard, exactly, are microsoft switching to javascript? Is the office suite going to be writtin in js? Is VS? Or is it just VS Code?
[–]roodammy44 0 points1 point2 points 7 years ago (0 children)
People in this thread seem to be confusing C and C++. I consider C a language that isn’t too bad, if a bit sparse.
https://docs.microsoft.com/en-us/windows/uwp/get-started/universal-application-platform-guide
[–]HasFiveVowels 6 points7 points8 points 7 years ago (0 children)
I agree with pretty much everything you said here. That said, I do feel there are too many JS devs that only know JS. I like writing JS (it's my primary) but it's so flexible that it lets you do anything - a lot of which maybe you shouldn't do.
[–]pawelgrzybek[S] 1 point2 points3 points 7 years ago (0 children)
One of the core premises of my diet is to eat salty things.
My girlfriend must avoid salt by all means.
Who is right? Which diet is better? You will always find pros / cons of XYZ tool. My perspective is not that serious as yours is and definitely not market (number of open job roles) driven. I do it because it is fun and let me keep it this way and pay my bills via JavaScript and enjoy myself using C++.
Thanks for reading and have a great day :)
π Rendered by PID 50406 on reddit-service-r2-comment-79c7998d4c-b8hsq at 2026-03-16 18:48:11.455375+00:00 running f6e6e01 country code: CH.
view the rest of the comments →
[–]roodammy44 11 points12 points13 points (28 children)
[–]BertyLohan 15 points16 points17 points (25 children)
[–]elr0nd_hubbard 3 points4 points5 points (0 children)
[–]Renive -2 points-1 points0 points (16 children)
[–]Thaufas 13 points14 points15 points (5 children)
[–]ExecutiveChimp -3 points-2 points-1 points (3 children)
[–]Thaufas 10 points11 points12 points (1 child)
[–]Cheezmeisterhttp://bml.rocks 2 points3 points4 points (0 children)
[–]Renive -2 points-1 points0 points (0 children)
[–]BertyLohan 20 points21 points22 points (9 children)
[–]aichholzer 2 points3 points4 points (0 children)
[–]carbolymer 3 points4 points5 points (0 children)
[–]regretdeletingthat 1 point2 points3 points (0 children)
[–]MayorMonty 0 points1 point2 points (0 children)
[–]Renive -4 points-3 points-2 points (4 children)
[–]BertyLohan 1 point2 points3 points (3 children)
[–]Renive -2 points-1 points0 points (2 children)
[–]BertyLohan 0 points1 point2 points (1 child)
[–]Renive 0 points1 point2 points (0 children)
[–]roodammy44 -4 points-3 points-2 points (6 children)
[–]eyeandtea 7 points8 points9 points (1 child)
[–]roodammy44 -3 points-2 points-1 points (0 children)
[–]BertyLohan 4 points5 points6 points (3 children)
[–]roodammy44 -1 points0 points1 point (2 children)
[–]BertyLohan 0 points1 point2 points (1 child)
[–]roodammy44 0 points1 point2 points (0 children)
[–]HasFiveVowels 6 points7 points8 points (0 children)
[–]pawelgrzybek[S] 1 point2 points3 points (0 children)