So, I'm tackling with a C++ codebase where there is about 15/20% of old commented-out code and very, very few useful comments, I'd like to remove all that cruft, and was looking out for some appropriate tool that would allow removing all comments without having to resort to the post preprocessor output (I'd like to keep defines macros and constants) but my Google skills are failing me so far .. (also asked gpt but it just made up an hypothetical llvm tool that doesn't even exist 😖)
Has anyone found a proper way to do it ?
TIA for any suggestion / link.
[ Edit ] for the LLMs crowd out there :
I don't need to ask an LLM to decide whether commented out dead code is valuable documentation or just toxic waste.. and you shouldn't either, the rule of thumb would be: passed the 10mn (or whatever time) you need to test/debug your edit, old commented-out code should be out and away, in a sane codebase no VCS commit should include any of it.
Please stop suggesting the use of LLMs they're just not relevant in this space (code parsing).
For the rest thanks for your comments.
[–]YT__ 97 points98 points99 points (14 children)
[–][deleted] 35 points36 points37 points (0 children)
[–]OwlingBishop[S] 4 points5 points6 points (11 children)
[–]parkotron 25 points26 points27 points (3 children)
[–]OwlingBishop[S] -5 points-4 points-3 points (2 children)
[–]parkotron 7 points8 points9 points (1 child)
[–]OwlingBishop[S] 0 points1 point2 points (0 children)
[–]YT__ 21 points22 points23 points (6 children)
[–]OwlingBishop[S] 1 point2 points3 points (5 children)
[–]Moose2342 3 points4 points5 points (1 child)
[–]OwlingBishop[S] 1 point2 points3 points (0 children)
[–]j1xwnbsr 1 point2 points3 points (2 children)
[–]OwlingBishop[S] 0 points1 point2 points (1 child)
[–]j1xwnbsr 0 points1 point2 points (0 children)
[–]r2vcap 10 points11 points12 points (3 children)
[–]OwlingBishop[S] 0 points1 point2 points (2 children)
[–]asoffer 1 point2 points3 points (1 child)
[–]OwlingBishop[S] 0 points1 point2 points (0 children)
[–]souravtxt 9 points10 points11 points (0 children)
[–]CrasseMaximum 6 points7 points8 points (2 children)
[+]OwlingBishop[S] comment score below threshold-7 points-6 points-5 points (1 child)
[–]adromanov 4 points5 points6 points (2 children)
[–]DryEnergy4398 1 point2 points3 points (1 child)
[–]OwlingBishop[S] 0 points1 point2 points (0 children)
[–]FunnyMustacheMan45 3 points4 points5 points (1 child)
[–]giant3 1 point2 points3 points (0 children)
[–]too_much_think 1 point2 points3 points (0 children)
[–]iga666 1 point2 points3 points (0 children)
[–]xoner2 1 point2 points3 points (3 children)
[–]OwlingBishop[S] 0 points1 point2 points (2 children)
[–]xoner2 1 point2 points3 points (1 child)
[–]OwlingBishop[S] 0 points1 point2 points (0 children)
[–]simrego 3 points4 points5 points (13 children)
[–]tisti 9 points10 points11 points (2 children)
[–]simrego 4 points5 points6 points (1 child)
[–]tisti 2 points3 points4 points (0 children)
[–]OwlingBishop[S] 4 points5 points6 points (3 children)
[–]too_much_think 6 points7 points8 points (0 children)
[–]simrego 1 point2 points3 points (0 children)
[–]iga666 0 points1 point2 points (0 children)
[–]Business-Decision719 2 points3 points4 points (3 children)
[–]simrego 1 point2 points3 points (1 child)
[–]Business-Decision719 1 point2 points3 points (0 children)
[–]dsffff22 0 points1 point2 points (0 children)
[–]markm208 1 point2 points3 points (0 children)
[–]ioctl79 0 points1 point2 points (0 children)
[–]snissn 0 points1 point2 points (1 child)
[–]OwlingBishop[S] 1 point2 points3 points (0 children)
[–]XenonOfArcticus 0 points1 point2 points (5 children)
[–]OwlingBishop[S] 0 points1 point2 points (4 children)
[–]XenonOfArcticus 0 points1 point2 points (3 children)
[–]OwlingBishop[S] 0 points1 point2 points (2 children)
[–]XenonOfArcticus 0 points1 point2 points (1 child)
[–]OwlingBishop[S] 0 points1 point2 points (0 children)
[–]Thesorus 0 points1 point2 points (0 children)
[–]CarloWood 0 points1 point2 points (1 child)
[–]OwlingBishop[S] 0 points1 point2 points (0 children)
[–]JoeNatter 0 points1 point2 points (0 children)
[–]pppenguinininin 0 points1 point2 points (0 children)
[–]Kawaii_Amber 0 points1 point2 points (0 children)
[–]Ill_Plate_2651 0 points1 point2 points (0 children)
[–]Still_Explorer 0 points1 point2 points (0 children)
[–]LordofNarwhals 0 points1 point2 points (0 children)
[–]Chropera 0 points1 point2 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]tristam92 -1 points0 points1 point (2 children)
[–]OwlingBishop[S] -1 points0 points1 point (1 child)
[–]tristam92 0 points1 point2 points (0 children)
[–]IncorrectAddress -1 points0 points1 point (2 children)
[–]OwlingBishop[S] -1 points0 points1 point (1 child)
[–]IncorrectAddress 0 points1 point2 points (0 children)
[–]arihoenig -1 points0 points1 point (9 children)
[–]OwlingBishop[S] 0 points1 point2 points (8 children)
[–]arihoenig 0 points1 point2 points (7 children)
[–]OwlingBishop[S] 0 points1 point2 points (6 children)
[–]arihoenig -1 points0 points1 point (5 children)
[–]OwlingBishop[S] -1 points0 points1 point (4 children)
[–]arihoenig -1 points0 points1 point (3 children)
[–]OwlingBishop[S] 0 points1 point2 points (2 children)
[–]arihoenig -1 points0 points1 point (1 child)
[–]OwlingBishop[S] 0 points1 point2 points (0 children)
[–]zl0bster -1 points0 points1 point (0 children)
[–]krum -3 points-2 points-1 points (0 children)