The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.
You have my blessings on the underscore
But why is there a comment that just puts the two words of the function name in a different order?
Why not change the function name to _Terminate_Users (or TerminateUsers if you want to do it right ) so it's slightly more readable and ditch the comment?
Why not change the function name to _Terminate_Users (or TerminateUsers if you want to do it right )
That was last month. The coding standard of this month says that functions should be named _<class>_<action>. The argument for that is that in a sorted list of function names, you get all the actions on one object class gathered together.
I have no information wha will be the right way to format code next month, or what the arguments will be, but I am really happy that modern IDEs have support for coding style changes. For newlines, indents and spacing it can be fully automated. Changing naming standards usually require some more manual work, but compared to the old days where you had to manually search for every occurence of a symbol to change it to the standard of the month required a lot more work.
The comment was removed shortly thereafter. The "user termination" logic was directly after the comment, but was moved into its own method. This was part of a reorganization/refactoring going on in preparation for a new feature.
A long time ago I took a programming class from Dan Saks, one-time secretary of the ISO C++ standardization committee. He said something to us which has stuck with me ever since, and has led to a profound reduction in the number of comments I write:
"If you can, say it in code. If you can't, only then say it in a comment."
While we do maintain change history in our source, my comments now tend to serve other purposes than simple documentation. For example, our code base is in the neighborhood of 3 million lines so navigation can be a problem. Comments can serve as markers for 'find in files' destinations when Intellisense doesn't work.
I find the comment more problematic.
But it's good that I instill fear in those that write code of dubious quality*
* The quality of code shall be measured by braceless single line if statements, indentation, lack or abundance of white space, naming conventions and comments.
Whether the code does what it should do is of secondary concern.
Code written in Java shall be considered bad quality by default.