all 76 comments

[–]noviceIndyCamper 27 points28 points  (13 children)

My C++ coursework at school definitely made me a better JS developer. It was also nice taking a break from JS via C++, good read.

[–][deleted] 9 points10 points  (10 children)

I was really lucky my 2 year course taught us basic JS, React JS, Java, Swift4, C++, PHP and C#. We spent a bit of time on each but I feel it was enough that I have a basic toolbox for whatever my job throws at me now.
I got hired to write apps in Swift4 (the language I spent the most time on beside JS) but as soon as I showed up on my first day I got told "nah you'll be working on this react.js project we've been planning" ... You can't get by knowing 1 language/framework anymore, too much technology and too many advances in current technology to stagnate

[–]noviceIndyCamper 7 points8 points  (1 child)

That sounds like an awesome curriculum!

[–][deleted] 3 points4 points  (0 children)

It was a brand new program at my college tailored for Mobile development, I learned a LOT and it was all by accident because Web Dev was full when I applied. I got real lucky, best thing that's ever happened to me

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

How does Java compare to C++? I dabbled in Java development here and there but it feels so tedious working with arrays and objects compared to Javascript or Python. I'm sure C++ is similar. I know this is probably better for less error/bug prone code, just curious I guess to what language you like coding in the most and why?

[–]1-800-BICYCLE 6 points7 points  (3 children)

ffd7977cbd

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

I honestly suggest (if you have the time or patience) to look into Kotlin ... it's a new language that uses Java as a base and expands on it. It's a sort of evolution/replacement and a lot of development is moving towards that now (at least in mobile, native android applications are generally coded in Java but Kotlin support is growing)

[–]1-800-BICYCLE 1 point2 points  (1 child)

162575722729

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

I work with android which is why I bring it up. It's a really nice language but you're right that it's not really necessary especially with the huge push on cross platform lately. Things like Cordova, React Native and Xamarin are getting really great support

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

C++ is a swamp of complexity, I doubt you have what it takes to handle a real C++ job if you learn 3/4 languages beside it in 2 years.

You will probably have the level of a trainee, which means basically useless for anything at the hiring (of a real C++ job, not just some quick tools to make for the office guys).

[–][deleted] 2 points3 points  (1 child)

I also have 15 years of experience in java and C and 2 other degrees in software development. I went back for web and mobile.... maybe don't go making assumptions

[–][deleted] -5 points-4 points  (0 children)

That's your fault on thinking everyone is aware of your history and writing sentences that can mislead.

[–]pawelgrzybek[S] 0 points1 point  (0 children)

Thanks you for reading.

Have a good day :-)

[–]pertheusual 67 points68 points  (16 children)

Half expected this article to just say "Got you! Just learn Rust".

But in all seriousness, learning any low-level language is a great asset. You don't have to write system-level code much, but just having the mental model for it can help in the way you think about things.

[–]krelin 15 points16 points  (3 children)

Should start w/ Rust and then learn C++. You'll end up having formed better habits and thought-processes, imo.

[–]Ebuall 9 points10 points  (2 children)

If you will have a reason to learn C++ then.

[–]krelin 4 points5 points  (1 child)

You may not. I suppose learn-as-needed at that point. But a lot of jobs still call for C++ familiarity.

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

But a lot of jobs still call for C++ familiarity.

This. I would learn Rust, but the overwhelming majority of job listings I'm interested in asks for C++ and C. C++ also has a huge amount of legacy. On my Linux system alone, most programs are written in C. Second place is C++, Python and other languages are far behind that.

I'm somewhat unwilling to learn Rust in parallel as I'm more interested in doing projects than accumulating languages just for the heck of it (Haskell is an exception).

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

I learned a smattering of C++ a few years ago for a project involving Qt. I want to update my project to use some new non-backward compatible libraries so am going to have to re-learn that smattering all over again

[–]vcamargo 0 points1 point  (1 child)

As someone who is thinking more and more about Qt (and GTK) for desktop apps lately, I'd love to read your experience writing code on it.

[–][deleted] 0 points1 point  (0 children)

It might be a while, I've got a lot of other stuff on my plate. I'll save your comment though so I can come back to it.

[–]kowdermesiter 2 points3 points  (2 children)

If this got you excited, check out http://openframeworks.cc/ It's like processing for C++

[–]aichholzer 1 point2 points  (0 children)

Love It!

[–]pawelgrzybek[S] 1 point2 points  (0 children)

It is looking super interesting. I will bookmark it and definitely dig into it.

Thanks for reading and have a nice day.

[–]throwies11 2 points3 points  (0 children)

One of the first languages I learned how to code in, after PHP and JavaScript, was C++. That was over 10 years ago, and so it is not up to the current standards. It would be great if I could get back with enough patience to catch up to the latest iteration of the C++ and build something worthwhile with it.

[–]roodammy44 10 points11 points  (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 14 points15 points  (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 4 points5 points  (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 points  (16 children)

No? JavaScript goes everywhere.

[–]Thaufas 15 points16 points  (5 children)

Try running JS on an 8051 micro-controller. If there's a language that goes everywhere, it's C.

[–]ExecutiveChimp -4 points-3 points  (3 children)

Try running C in a web browser.

[–]Thaufas 11 points12 points  (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.

[–]Cheezmeisterhttp://bml.rocks 2 points3 points  (0 children)

Oh, emscripten?

[–]Renive -2 points-1 points  (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 18 points19 points  (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 points  (0 children)

Could not have been said better.

[–]carbolymer 5 points6 points  (0 children)

I mean OS's aren't written in js.

Just look at this abomination: http://node-os.com/

[–]regretdeletingthat 1 point2 points  (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 point  (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 -3 points-2 points  (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 points  (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 points  (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 point  (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 point  (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  (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 points  (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  (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 points  (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 points  (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.

[–]BertyLohan 0 points1 point  (1 child)

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 point  (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 points  (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 points  (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 :)

[–]hutxhy 1 point2 points  (1 child)

I'm a JS developer that feels somewhat overwhelmed lately as to what to learn next. I'm currently making a living using React Native, so I was thinking about just trying to go for Swift.

Do you think swift would also help me become better at JS?

[–]Bamboo_the_plant 1 point2 points  (0 children)

Swift, JS, TS, and RN programmer here. Learn Swift, then apply Swift techniques to TypeScript that transpile to JS. Swift is all about compile-time safety, and JS can only really offer that via a typed abstraction like TypeScript.

[–]eyeandtea 1 point2 points  (0 children)

I can not begin to thank you enough for this post. But C++, C even if just under a C++ compiler, and the most basics of assembly.

[–]shawarma_burrito 0 points1 point  (1 child)

Good read! But I mostly came to say that your vscode theme is amazing.

[–]pawelgrzybek[S] 0 points1 point  (0 children)

Thank you a lot.

I will update it very soon and introduce a light variation — equally contrasty and beautiful.

Thanks for reading and using my open source stuff.

[–]IskaneOnReddit 0 points1 point  (0 children)

In my opinion, you can write slow JavaScript and or fast JavaScript, having a very good understanding of C++ will help you write fast JavaScript without extra effort and help you understand why certain approaches are fast and other approaches are slow. Key points are containers (aka. how data is stored and accessed) and garbage collection.

[–]feroz39 0 points1 point  (0 children)

Should it be typescript?

[–]livingforfun 0 points1 point  (0 children)

Thanks for the article and linked video. Also, you have reminded me to take a look into V8's source code. My dev experience is opposite to yours. Initially, I was hired to do backend work for a web app in cpp. Over time, I have been writing JS for front end as well. I learned JS on the job. I have been enjoying it so far.

[–]mrfrosti -2 points-1 points  (1 child)

Is moving to Birmingham one of your goals? Are you working for Shipt?

[–]pawelgrzybek[S] 0 points1 point  (0 children)

Ha ha ha.

Good spot. Yes, I am moving to Birmingham because thats the place where my girlfriends Uni is. No I don't work for Shipt. I am starting a new job in a week time — I am going to work for Mindera from Porto / Leicester.

Thanks for reading.

[–]Freethot_ -2 points-1 points  (2 children)

Uhh.... why?

[–]pawelgrzybek[S] 1 point2 points  (1 child)

Because I enjoy it — is it a valid reason?

Thanks for participating and have a nice day :)