10 ms·
Writing new C++ code with all the modern approaches and tooling doesn't sound so bad. Troubleshooting a big legacy C++ codebase is probably something that Dant
by photochemsyn 4y ago
Writing new C++ code with all the modern approaches and tooling doesn't sound so bad.
Troubleshooting a big legacy C++ codebase is probably something that Dante would have included in his Inferno as a punishment for pride and hubris.
- commandlinefan 4y ago> Troubleshooting a big legacy C++ codebase ... with deadlines measured in hours.
- spoiler 4y ago> Writing new C++ code with all the modern approaches and tooling doesn't sound so bad. Uh, but it still kinda sucks, if only because the nice way that looks idiomatic is usually the incorrect way for either performance (anything newly added like std::variant or std::optional) or safety (operator[]). The correct way is usual the ugly way, because it seems like the committee puts C++ arcanum knowledge above all else, instead of developer satisfaction or maintainability
- s9w 4y ago[dead]
- bluGill 4y agoC++ puts you don't pay for [at runtime!] what you don't use above all use. However that often means you have to know the arcanum bits to decide if need to pay for something. You can save a bit of CPU time if you don't check if a pointer is null - which is a great thing to do if you have knowledge that the pointer cannot be null - and also something that is very easy to screw up so most languages don't give you the option. (which is the right thing for them to do - a lot of people are writing C++ where they could write something else)
- gary_0 4y agoThe "correct" way is also template-heavy so enjoy long compile times followed by utterly incomprehensible error messages.
- peteradio 4y agoYou mean coffee breaks and job security are baked into the language?
- intelVISA 4y agoShhhhh. You're supposed to trick people into learning the "other" langs.
- raverbashing 4y agoIf you call PTSD job security, sure
- peteradio 4y agoYou know what they say: ya can't get PTSD twice!
- Shorel 4y agoI prefer C++ compile times than Node.js webpack copying plain text around 'transpile' times. At least the C++ compiler is doing actual work. And it is faster than the webpack madness.
- logicchains 4y ago> the incorrect way for either performance (anything newly added like std::variant or std::optional) or safety I don't know where you got that idea from, but with an up-to-date compiler variants are safer and more performant than the traditional approach (classes hierarchies), and std::optional is safer and 99.9% as performant as a nullable pointer.
- ben-schaaf 4y ago> and std::optional is safer and 99.9% as performant as a nullable pointer. Except for it taking up twice the memory as a pointer (https://godbolt.org/z/5We9zEbvh https://godbolt.org/z/5We9zEbvh) and it not doing anything in regards to safety when using pointers. Even if you're replacing a nullable-pointer with a std::optional you're still handling landmines when using operator* or operator-> - the most convenient ways to use std::optional.
- pornel 4y agoThe fact that modern C++ still added more easy to hit UB in std::optional blows my mind. "But making it safe would be slow!" and "-> being safe would be inconsistent with the rest of the language". C++ is doomed forever to have safety-third design.
- tw1984 4y agoC++ is legacy. You can't just ignore the fundamentals.
- lionkor 4y agoThat doesnt change the fact that software has been written in it, and will be written in it.
- tw1984 4y agoSame can be said for BASIC, my favourite childhood language. you know people collect old cars, computers, stamps as hobby, tens of millions of people are into that. for the exact same reason, there will be people who are just into writing software using legacy tools. I totally understand & respect such decisions.
- jahnu 4y agoJust spent two years writing a medium size fresh c++ codebase in modern style with all the warnings turned to max and nearly every static analysis tool we could throw at it from day 1. It’s been an utter pleasure with no pain that can be blamed on c++ alone. It can be done :)
- tw1984 4y agofor stuff like gaming & HFT, you are probably forced to do it in C++, it is a sad reality affecting small % of developers. for everything else, if you are still building fresh new projects in C++, you are making a big mistake. C++ today is like Cobol in 2010. yes, there are reasons for them to exist, people tell your the good old days, probably some fresh good recent experience. but come on, there is a much better place for C++ - https://computerhistory.org/ https://computerhistory.org/
- jahnu 4y agoAs mentioned below we are doing audio plugins. Every cycle is precious to our artists. Especially since we are doing spectral effects.
- TillE 4y agoSpeaking as a professional C++ developer for the past 20 years, I think this sums it up well. A modern project should be able to use most of C++17 at least. Even if you still need to target some ancient garbage like Windows XP, you can use an MSVC toolchain that supports C++17. That's a good basis to work from. So your real concern is the moldy old code that's written for C++03, that's still not using std::unique_ptr or anything equivalent. If you're given license to finally rewrite that code to modern standards, that can be fun if it's not a complete mess. But if you just have to live with it, and still write C++03, absolutely not, I would never do that job.
- steve918 4y agoIf C++03 is old code then you're in one of the outer circles. The code base I'm working on has "Old style" C function declarations that predate C89.
- mort96 4y agoDo we have a reason to believe the code base you're working on is representative or is it just an anecdote?
- rizzaxc 4y agodo you have a good template (pun intended) on how to best learn modern c++? coming from Go and Typescript which have very mature devX tooling, c++ is a landmine to navigate. and that's when I already have professional experience with it (the place just didn't have strong c++ culture)
- olvy0 4y agoTry watching the "back to basics" videos from the last 4 years' cppcons. But that's mostly learning modern paradigms of the language. If you also mean the tooling, then it depends: Learn CMake which is sort of an industry standard. There are books and videos, but for a concrete experience, try looking through the CMakeLists.txt of some non-trivial C++ open source project.
- jokoon 4y agoMy first real C++ job involved a bug in a largely technical indebted codebase, lines of code in the millions. I spent two months asking one guy who knew about it for help. I really understood the concept of "hostage taker" in a software team. It's the guy you cannot fire and will constantly arm-wrestle everybody where there is a problem, never really helping, and continuing to write bad code that allows him to keep his job. Fortunately they did not hire me. I never was so discouraged in my life.
- lelanthran 4y ago> Fortunately they did not hire me. I don't understand this, where you working for free?
- jokoon 4y agopaid trial period
- 1123581321 4y agoMore likely circle 8.4, since so much of that old code would be ass-backwards.
- watmough 4y agoTotally describes what I do. Last couple jobs have been heavily legacy C++ in the energy sector. Lots of maintenance, but also opportunities to overhaul and build new objects. Funnest project right now is porting some supercool Science code to cuda and getting about a 30x speed up.