6 ms·
I agree with most of this dude's points, except about not starting new projects with C++. I think C++ still has good strong merit but it definitely needs some
by inetknght 8y ago
I agree with most of this dude's points, except about not starting new projects with C++.
I think C++ still has good strong merit but it definitely needs some critical thinking about where it's used. Other languages are likely better candidates for most things.
- acdha 8y agoThe author works on Google Chrome so I'm pretty sure they're familiar with the pros and cons of C++. It's possible that there's a place for using C++ on a new project in 2019 but that would definitely be a decision to justify with a comprehensive process for mitigating the risks of not using e.g. Rust.
- blub 8y agoAlthough on HN it looks like there's some kind of competition happening, Rust is a rounding error compared to languages like Java, C# or even Swift which are actually chosen instead of C++ for many projects. I'm looking at job ads periodically and Rust is almost not at all present. I've talked to someone from the Rust community and they told me that "many" companies are using Rust, but not advertising it and not hiring for it on public channels. Whatever the reason, the Rust skills market seems to be non-existent, which is a bad position to be in when considering whether to start a project in Rust. Project = commercial product that makes money, not OSS or start-up dreams.
- tptacek 8y agoThe subtext of Rust in posts like this is that Rust compiles programs that are pin-compatible with C/C++ programs. Without rethinking the architecture of a kernel, for instance, you're meant to be able to write Rust drivers. I prefer other higher-level languages to Rust; I'd rather just work with garbage collection than wrangle the Rust borrow-checker. But if you need to write software that can't abide GC, Rust is basically the only memory-safe game in town.
- pjmlp 8y agoAlthough I like Rust for those scenarios where GC isn't an option, I bet Ada/SPARK still have more commercial deployments out there. It might change given the price of their compilers versus free rustc, however those are industries that also certify compilers, which isn't going to happen for the time being for Rust toolchains. Also Rust still isn't pin-compatible with COM/UWP or Objective-C runtime, and I guess we need to wait around one year until mixed language debugging experience is a thing across all major IDEs.
- zozbot123 8y ago> Also Rust still isn't pin-compatible with COM/UWP or Objective-C runtime Both COM and Objective-C can be accessed from C, and Rust is compatible with the C FFI.
- pjmlp 8y agoSince Windows 3.x days actually, but only by those masochist enough to use the C API, or low level OS devs on the respective companies. Anyone else that praises productivity uses programming languages that take care of the lowlevel boilerplate, and offer high level debugging experience on the respective IDEs.
- saagarjha 8y ago> Also Rust still isn't pin-compatible with COM/UWP or Objective-C runtime I found this: https://github.com/SSheldon/rust-objc/ https://github.com/SSheldon/rust-objc/
- steveklabnik 8y agoAs someone currently looking for a job with Rust, there are tons of opportunities out there. I am obviously a bit of a special case, but I’ve had probably forty inquiries so far, from several FAANGs, YC startups, and others. There's enough that even though there are some places that didn't reach out and that I know are using Rust, I haven't had the time to apply myself. It is true that there’s no nearly as many as Java or C++, but that’s pretty normal given relative ages.
- blub 8y agoYeah, you might be a special case. Wouldn't be surprised if there were dozens of companies in total using Rust and you got contacted by most of them. I'm also looking in Europe, not US.
- steveklabnik 8y agoI'd like to end up in Berlin in the near future, so I hear you there. Some of them do require being in the US, it's true.
- dbcfd 8y agoI think one of the January Who's Hiring jobs was a company doing Rust, but looking for onsite in Berlin or remote in europe. Maybe one in London as well.
- yuushi 8y agoI mean, you really are a special case - I have only lightly dabbled in Rust, but I immediately recognize your name because of the work you've done in the Rust community.
- dbcfd 8y agoIf you want an easy time finding a job, Java or Javascript will definitely accomplish that. It is not however impossible to find jobs in Rust at the moment. I think January's Who is Hiring post had 5 rust job listings. Rust is still not used in a wide range of industries, but you can find a number of opportunities in crypto, fintech, security, and even a few big data shops. And yes, there's even more jobs that aren't always out there on public channels. Good reason to attend your local rust meetup.
- acdha 8y agoThat’s true in general but what I was referring to are the subset of new projects where someone would pick C++ instead of Java, C#, Go, etc. The latter are definitely more popular in general and I’d expect there to be far more cases where they’d be selected, so rejecting them for technical reasons would tend to bring you into areas like not using a runtime or GC.
- yuushi 8y agoIf you have the luxury of choosing between C++ and Java/C#, then you don't need C++.
- vorg 8y ago> when considering whether to start a project in Rust. Project = commercial product that makes money, not OSS or start-up dreams How do you know whether the commercial product is going to make money when you're still considering what programming language to write it in? Until it's built and launched, it's just a "commercial product dream", similar to a "start-up dream".
- duneroadrunner 8y agoWell if you're starting a project now that you expect to live for many years, there's the issue of C++ safety now, and C++ safety in the foreseeable future. Right now projects have the option of building with the santizers (particularly the address sanitizer) enabled, right? The executable would be slower and less memory efficient, but it would eliminate most of the critical CVEs that exploit invalid memory access. Is there a reason Google couldn't provide alternative builds of Chrome with the santizers enabled? As for the foreseeable future, you can come up with arguments (convincing or otherwise) that C++ will be effectively memory (and data race) safe in the foreseeable future. At some point, presumably the core guidelines lifetime checker will enforce memory safety. To what degree it will in practice is a matter of speculation, but in theory it could be as effective as the Rust compiler. Just as an observation, if you peruse the chromium source code, from a modern C++ perspective, there seems to me to be an alarming prevalence of raw pointers. (Probably understandable as chromium's been around for a while.) C++ is now a very powerful language, and if (memory) safety is a priority it is already practical (and performant[1]) to avoid the use of notoriously unsafe elements like raw pointers and unchecked buffers in favor of safer alternatives. (It is similarly practical to avoid data race prone elements[2].) [1] shameless plug: https://github.com/duneroadrunner/SaferCPlusPlus-BenchmarksGame https://github.com/duneroadrunner/SaferCPlusPlus-BenchmarksG... [2] https://github.com/duneroadrunner/SaferCPlusPlus#multithreading https://github.com/duneroadrunner/SaferCPlusPlus#multithread...
- sephoric 8y agoInterestingly this is in stark contrast to the recent article about learning C++ in 2018 and being perfectly happy with it. I think part of this is because C++ is such a vast language with a huge and diverse ecosystem that it's kind of like saying you should stay out of Africa because it's so dangerous, when it's such a huge place and many parts of it are relative safe. Maybe the two authors experienced different "parts" of C++ and are referring to that subsection only.
- dbcfd 8y agoYou can learn and use C++ in 2018 and be perfectly happy with it. This article is arguing that for safety/security, you shouldn't use it. For the majority of projects that are more complex than Hello World, you'll be venturing out of "relatively safe".
- pjmlp 8y agoThe problem with C++, is that unless you have the source code from everything available and the team agrees on making proper use of static analysers, there isn't any guarantee that a rogue team member, or a binary dependency isn't making use of unsafe bad practices. Whereas in some systems languages with modules, if you make use of unsafe code blocks or pseudo-module, the module gets tainted and you can even block its use.
- gamma-male 8y agoI find it hard to believe that there exists reasons to start a project with C++ in 2019 when we have rust.