Live data from Hacker News

It's time to halt starting any new projects in C/C++

twitter.com

671–680 of 929 posts

Re: It's time to halt starting any new projects in C/C++

#671

I'm just a programmer who's been doing this for 20 years. I don't have the credentials of Mark, who is a legend. But I fully agree with him. There will be specific exceptions, but if you have the choice between Rust and C++ you would be making a big mistake to not choose Rust. The language is simpler, cleaner, safer, and more enjoyable to work with. The build tools are far more pleasant. The IDE experience is compara…

Why do you think Rust isn't used more widely?

Because total greenfield projects in systems languages is still a pretty rare thing. Writing a new game with a C++ game engine isn't going to count, for example, and that means quite few things will.

I actually think it is quite widely used in this small niche. Don't have any data to back it up and my newsfeed is probably biased.

Re: It's time to halt starting any new projects in C/C++

#672

Earlier quoted context omitted.

>> The hiring market is way better for Rust because it's not mainstream. The ratio of C++/rust jobs where I am (EU country) is 5564/54. And these 54 jobs are mostly in cryptocurrencies.

I mean the argument is made that Rust is not mainstream, but if you were to pull in e.g. Java or Javascript apps in that comparison I'm confident it would make C++ look like a non-mainstream language too. edit: numbers say I'm wrong, C++ is more mainstream than C#, C is more mainstream than Java: https://www.tiobe.com/tiobe-index/ . I mean I doubt this source (it seems to indicate objective-C, which is all but supers…

That doesn't really change the fact that the only job you can really get is in cryptoshit markets.

Re: It's time to halt starting any new projects in C/C++

#673
post #534

Earlier quoted context omitted.

Wut? Makes no sense to me.

Here's an example of C++ code written intentionally with all the latest C++ features: https://gist.github.com/caiorss/c7db87df674326793431a14006aa... It looks pretty much nothing like a C program doing the same job. A lot of those features were made to make C++ a safer language to use. Eg, with a construction like: for(const auto& it : ast){ You can't accidentally walk past the end of the array by going one item too…

That's quite readable and actually makes me wanna try C++20 or whatever it is.

Re: It's time to halt starting any new projects in C/C++

#674

Blanket statements like this just show that people don’t understand why people stuck with a language. I worked in C/C++ for a long time, though it’s been a while now. I just went to look at whether Rust had any bindings for MPI. It does - rsmpi. But they’re not fully implemented, and only support a restricted subset of MPI implementations which are pretty much the latest versions. Some others might work, but it is no…

Moreover, when stating about "new projects", it's too easy to forget that these new projects often start in an existing environment which includes in-house and external libs to integrate with and likely some in-house expertise and engineering skill that goes with it.

So offering these shops to consider Rust or any other "it's better" language is similar to Enterprise Java push back in time, which simply turned local weed gardens into weed prairies with even wilder variety.

Meanwhile considering safe practices and features of whatever modern C++ is a normal and indeed organic process for such organizations, be it for new or supporting the existing projects.

As for starting an "independent" new project, well, that's a whole new story. I guess the choice would still rely on the need and availability of external components for it. Ah, least we forget about the costs!

Re: It's time to halt starting any new projects in C/C++

#675
post #421

Earlier quoted context omitted.

> In other words, it's possible to put C and C++ on the same footing as Rust when it comes to memory bugs; No. This is only true if you don't care about occasional bugs. e.g. hobby projects. But if you're talking about mission-critical or security-critical software, there is a gap - or a canyon - between C vs C++ vs Rust. And no amount of extra "efforts" by the programmer's part can bridge those gaps completely.

Mission critical is almost meaningless when applied to the entire software industry. It’s whatever each company wrote their core software in. For twitter Ruby was mission critical, for Facebook it was PHP. Security critical is also rather meaningless, because the idea that a specific language must be used to write secure software is something that the Rust community is claiming but is otherwise unproven and not parti…

> Finally, there’s the mighty inconvenient fact that a large amount of safety-critical software (a well-defined term and domain!) is written in C and C++ with a track record of multiple decades

Well stated.

Re: It's time to halt starting any new projects in C/C++

#676

Earlier quoted context omitted.

get back to me when there's equivalents of KPP/Credential Guard/a stable driver API/etc

Do we still have ads in the operating system?

MS would still fit ads into the OS even if the kernel was Linux tbh. Look at Android, really lowered the bar of what you could do with Linux.

Re: It's time to halt starting any new projects in C/C++

#677

Blanket statements like this just show that people don’t understand why people stuck with a language. I worked in C/C++ for a long time, though it’s been a while now. I just went to look at whether Rust had any bindings for MPI. It does - rsmpi. But they’re not fully implemented, and only support a restricted subset of MPI implementations which are pretty much the latest versions. Some others might work, but it is no…

I agree. It's like when MS tell everyone just to "upgrade to dotnet 6" or 7 or whatever! Most of us don't have the funding, skills, time, priority to rewrite all of our old web forms apps even if we wanted to. Who is going to pay to rewrite the app that only earns us $10K a year? Even if we did decide that Rust is great, do we immediately expect our C++ senior devs to produce the same quality code in a language they…

>Most of us don't have the funding, skills, time, priority to rewrite all of our old web forms apps even if we wanted to. Who is going to pay to rewrite the app that only earns us $10K a year?

He's not suggesting rewriting anything. He explicitly said "it's time to halt starting any new projects in C/C++" (emphasis mine)

C/C++ isn't going away, old C/C++ things can remain as old C/C++ things.

Re: It's time to halt starting any new projects in C/C++

#678

Earlier quoted context omitted.

Because, little by little, C++ became "unlearnable". Long ago C++ made C a little bit more complex. Because there were already lots of C programmers that wasn't a big deal. But then it didn't stop. Little by little C++ grew into a monstrosity. A lot of people went along. I gave up. For new programmers to climb in 2-3 years a mountain that seasoned programmers took 15-20 years to climb is asking too much.

In what world is C++ harder to learn than Rust?

Time to write a program that compiles and seems to do what it does: Takes ages longer in Rust, unless you're experienced.

Time to be reasonably sure your multi-threaded code won't crash randomly: Takes ages longer in C++, even if you're experienced.

Re: It's time to halt starting any new projects in C/C++

#679
post #602

Earlier quoted context omitted.

> Programmers currently using Rust are superior to programmers using C++ > People learn C++ in college. People learn Rust because they love their craft Wow... and rust programmers wonder why rust has a stigma? So I guess John Carmack is inferior and is not an ultimate craftsman.

You cut out the words “statistically speaking”, which entirely change the meaning.

An appropriate thing to do in the absence of actual statistics or methodology.

Re: It's time to halt starting any new projects in C/C++

#680
post #666

Lumping C and C++ together implies much about the use of the language - "modern" C++ features go out of their way to avoid memory unsafe and bug-prone operations (avoiding raw pointer arithmetic, no manual new/delete memory management etc). Comparing Rust against the overlapping subset of "C" and "C++" is rather disingenuous. It's like writing /everything/ in Rust in an unsafe block and avoiding all the tools that ac…

How short is your project? I learnt Rust to a productive level in 6 weeks. So I guess if your project lifetime is shorter than ~6 month then sure.

The library ecosystem in Rust is less mature (there isn’t a library for absolutely everything), but where a library does exist it tends to be much more robust than the C++ equivalent. A library in Rust will not have UB (however you call it). It won’t throw exceptions. It won’t return null without warning you, etc.

Post reply on HN