Live data from Hacker News

C++20, How Hard Could It Be

docs.google.com

251–260 of 444 posts

Re: C++20, How Hard Could It Be

#251
post #227

Earlier quoted context omitted.

I've written firmware, systems software, drivers and plenty else this way. Just because the language gives you rope doesn't mean you _have_ to use all of it. I enjoy how terse and straightforward even good ol' structured non-object oriented code can be.

same here, but I'm embracing modern c++ these days, not for all low level coding yet though.

Yep, big thing for me is smart pointers and RAII. Everything else is secondary.

I have worked on template-heavy codebases that would really benefit from concepts, though.

Re: C++20, How Hard Could It Be

#252

Earlier quoted context omitted.

it's not that you need it, it's that when destructuring, std::tuple_size / std::tuple_element are implicitly checked to see how destructuring can be made to work if you have a type with some custom destructuring. (example: https://gcc.godbolt.org/z/5jq61oox7 ) If they are not available or just not overloaded (e.g. when destructuring some basic struct) it just falls back to the destructuring one expects. So you need f…

This whole thread is why c++ is..bad. It just leaves me with a sense of hopelessness.

You're being overdramatic. You don't need to be a language lawyer to use C++ correctly and effectively.

Re: C++20, How Hard Could It Be

#253

In a few months, I might be switching to a team with a C++ project. A lot of the team is new to C++, and there's nothing about the project that needs C++, Java would have been fine. This doesn't look very fun.

Compared to Java, modern C++ isn't so bad. Dependency management and build systems are the main problems. Both of those should be solved in an existing project.

Re: C++20, How Hard Could It Be

#254

In a few months, I might be switching to a team with a C++ project. A lot of the team is new to C++, and there's nothing about the project that needs C++, Java would have been fine. This doesn't look very fun.

If there's ever a big production outage, you can make the case for Java.

Because Java is known to magically never cause production outages?

Re: C++20, How Hard Could It Be

#255
post #224

Earlier quoted context omitted.

or use a subset of c++ that does everything c does, plus OOP, RAII and smart pointers for free, and it compiles and links with c code smoothly as well. the only price to pay is that libstdc++ runtime must be present, which is just a few MBs that can even fit for small embedded boards.

This is what I do. Write C in C++. You don't have to use all the fancy new shit. I'll never understand why people get so upset about it.

That C in C++ id the part where most of the serious bugs in C++ come from

Re: C++20, How Hard Could It Be

#256

In a few months, I might be switching to a team with a C++ project. A lot of the team is new to C++, and there's nothing about the project that needs C++, Java would have been fine. This doesn't look very fun.

C++ has a lot of sharp edges. Skimming through the slides it seems as though Chromium hit upon a lot of the big problems because:

1. Google always seem to enjoy bucking the trend in terms of recommended ways to do things and end up using niche features that are likely to be deprecated 2. Chromium is a stupidly massive codebase so they have more things to fix just purely through scale

If you stick to the sane subset of the language that any competent modern C++ development shop would then you wouldn't encounter any of these problems except small/easy stuff like the new reserved keywords.

That being said, if you don't have a team that's already experienced in C++ then picking C++ is a bizarre choice.

Re: C++20, How Hard Could It Be

#257

Earlier quoted context omitted.

It's so funny to me that MSVC has become the cutting edge of C++ standards implementation. I remember starting out when it was a joke compared to Clang - although I was a novice, so who knows how complete my knowledge was at the time. In any case, it's a really impressive effort from STL and the rest of their library team. STL has some incredible CPPCon talks, too.

One way you could interpret this (definitely not the only way) would be that Microsoft - or some group within Microsoft - sees C++ as a possible legacy system, with an opportunity to make a lot of money by judging correctly what customers want and how much income you need to justify that support as existing offerings rust out (so to speak). Do you have any particular CPPCon talks to recommend ? My favourite is "Absei…

I really love this talk in particular: https://www.youtube.com/watch?v=4P_kbF0EbZM (On charconv)

But any of the ones I've seen from Stephan have been fantastic, I think, although I'm not actually sure if I've seen more. He seems to have a lot of talks on very specific subjects, which can be really fun.

> Hyrum Wright is in the audience yelling interjections as a result of Hyrum's law

This sounds absolutely hilarious, I'll have to take a look.

Re: C++20, How Hard Could It Be

#258

Earlier quoted context omitted.

Sounds like Fortran to me.

Fortran is easy to hire for?

For numerical and scientific (high performance) jobs, possibly not that much harder than C++. For other jobs, I doubt it and would stick to C++.

The issue is that, for example, you might be getting people with poor software engineering training per se. You risk hiring some very smart phd that writes code that works and runs really fast, but isn't that readable, extendable, maintainable, testable, etc.

Re: C++20, How Hard Could It Be

#259

Earlier quoted context omitted.

It's so funny to me that MSVC has become the cutting edge of C++ standards implementation. I remember starting out when it was a joke compared to Clang - although I was a novice, so who knows how complete my knowledge was at the time. In any case, it's a really impressive effort from STL and the rest of their library team. STL has some incredible CPPCon talks, too.

One way you could interpret this (definitely not the only way) would be that Microsoft - or some group within Microsoft - sees C++ as a possible legacy system, with an opportunity to make a lot of money by judging correctly what customers want and how much income you need to justify that support as existing offerings rust out (so to speak). Do you have any particular CPPCon talks to recommend ? My favourite is "Absei…

I love the idea of placing a gadfly in the crowd to provide a dialogue.

Re: C++20, How Hard Could It Be

#260

Say I have a new project to start today. I need pick a language to use: 1. a well-tested language 2. can not use garbage collector due to *performance* requirement 3. easy to hire if project expands. 4. ready to use tooling support 5. widely available tutorials and info on the web. 6. language is itself alive and updated 7. project can be scaled over time. what options do I have? I have to pick up c++ in this case. i…

I wonder how much of (2) is speculative and how much of it is a real need in actual projects.
Post reply on HN