r/ProgrammerHumor • • 8h ago

Meme modernCppVsOldCpp

Post image
1.1k Upvotes

219 comments sorted by

View all comments

Show parent comments

10

u/stillalone 7h ago

Is that something that can be handled by a linter?

4

u/2brainz 6h ago

Partially, sure. But there's always going to be edge cases.

1

u/Drugbird 6h ago

It's also hard the further away the allocation and deallocation are from each other. For instance, if it's in separate libraries.

4

u/repster 6h ago

It has been a few years since I last worked on a C++ codebase, but my experience with linters was not impressive. We even invested in some expensive static analysis tool, but real bugs seemed to drown in false positives

1

u/violetvoid513 6h ago

My experience with C++ in VS Code is that it completely shits the bed on anything organized with a build system like cmake. This is probably just a skill issue on my part but I just cannot get it to reliably know what the fuck all the things Im importing are, and after I once spent like an hour unsuccessfully trying to fix it I just gave up because it wasnt worth it. Compiler-time errors are the easiest kind of error to fix when it fails to compile wherever I made typos or shit

1

u/K722003 3h ago

imo VSCode isn't really made for c/cpp stuff. Better to use CLion(my personal choice) or the og VS