Live data from Hacker News

Ask HN: Learn C++11 or Rust in 2022?

news.ycombinator.com

141–150 of 161 posts

Re: Ask HN: Learn C++11 or Rust in 2022?

#141
post #139

Earlier quoted context omitted.

Agreed but doing this at compile time would require some sort of pointer lifetime tracking in the compiler. Don't know how much of this is feasable without going "full borrow checker", but static analyzers for C do a similar thing, by far not as watertight as Rust of course. The General Purpose Allocator can optionally catch use-after-free by not recycling virtual memory addresses, not very efficient for small high-f…

> ...but static analyzers for C do a similar thing.. Exactly, which begs the question why bother with Zig at all.

Zig is a much more ergonomic language, toolchain and build system. And since Zig is also a C/C++/ObjC toolchain, it's not about "Zig or C/C++", but about "Zig and C/C++" (at least from my PoV).

Re: Ask HN: Learn C++11 or Rust in 2022?

#142
post #118
post #101

Earlier quoted context omitted.

memory safety issues are the result of poor software engineering.

History has demonstrated over and over and over again that c/c++ code above a certain complexity threshold (which is fairly low), _will_ have memory safety issues. It doesn't matter how good you are at engineering.

but all the companies are making people do coding inteviews now. didn't that solve the problem????? apparently not.

Re: Ask HN: Learn C++11 or Rust in 2022?

#144
post #113
post #103

Earlier quoted context omitted.

at least c++ doesn't force constructs onto you. remember java? that language was a fad too that didnt' go anywhere, because it forced object-oriented programming onto the user.

I remember, it is running on all the mobile phones around the house, on the TV, on the blueray player, and apparently Amazon needs it to deliver my packages, Netflix to manage the next movie I want to watch,...

ah yes, it runs on a lot of mobile phones, and app developers cannot get consistent performance out of all those different phones, thanks to java and the Shit OS that runs on them, which shall remain unnamed.

i worked for a startup once that put a java based GUI on top of some C code and used the JNI. the endless issues with java bankrupted the company as the clients who were supposed to adopt the solution refused to deal with the sub par performance and reliability.

Re: Ask HN: Learn C++11 or Rust in 2022?

#146
post #144
post #113

Earlier quoted context omitted.

I remember, it is running on all the mobile phones around the house, on the TV, on the blueray player, and apparently Amazon needs it to deliver my packages, Netflix to manage the next movie I want to watch,...

ah yes, it runs on a lot of mobile phones, and app developers cannot get consistent performance out of all those different phones, thanks to java and the Shit OS that runs on them, which shall remain unnamed. i worked for a startup once that put a java based GUI on top of some C code and used the JNI. the endless issues with java bankrupted the company as the clients who were supposed to adopt the solution refused to…

Not everyone can afford to hire good coders, so they get what they pay for.

Re: Ask HN: Learn C++11 or Rust in 2022?

#147
post #139

Earlier quoted context omitted.

> ...but static analyzers for C do a similar thing.. Exactly, which begs the question why bother with Zig at all.

Zig is a much more ergonomic language, toolchain and build system. And since Zig is also a C/C++/ObjC toolchain, it's not about "Zig or C/C++", but about "Zig and C/C++" (at least from my PoV).

From my point of view it isn't enough to warrant adoption over existing alternatives.

Maybe someone proves me wrong with some killer application that makes Zig unavoidable for the rest of us.

Re: Ask HN: Learn C++11 or Rust in 2022?

#148
post #101
post #94

Earlier quoted context omitted.

And your software will continue to have memory safety issues.

memory safety issues are the result of poor software engineering.

FYI, the fact that you can do poor software engineering in safe Rust (or any memory-safe language) and still do not have memory safety issues completely disproves your statement.

Re: Ask HN: Learn C++11 or Rust in 2022?

#149
post #102
post #98

Earlier quoted context omitted.

I agree, and let's not even start with operator overloading. Rust on the other hand seems to be a safe but also rather explicit language (a good thing not just for system programming).

I am talking about Rust, not C++

I was agreeing with the comment I replied to, who assessed that Rust was the less "magic"-y language.

Re: Ask HN: Learn C++11 or Rust in 2022?

#150
post #67

Here’s a fun way to decide. Do Raytracing in One Weekend[1] in one of them. Then rewrite it again in the other. That should give you a good sense for which one you want to invest in. Spoiler: I did this exercise myself. I found Rust to be more convenient in some ways. The Rayon crate made adding parallelism (threads) pretty easy. Some other crates made things pretty terminal output easier. C++ feels more familiar to…

Well said, sometimes the developer community forgets what they are giving up (vs what they are exchanging for).

Is it a sin to say that, because you know c++ so well you don't need the nanny's and excessive overhead of validation?

That's akin to someone saying they never need to write tests.

Have you ever started a project without tests?

Post reply on HN