How to name a variable when the word is both a noun and a verb
I have run into a corner-case problem with the general guidance of:
How can I avoid using my own name in the identifiers, packages, or namespaces of open sources projects I create?
I do a lot of development in my own time. These projects I work on are all just for fun and learning (so far). I commonly do Java development with Maven but I have also been known to dabble in .NET and Python. All of the projects I work on use open source licenses, although most of them are not on any public code repositories.
addIfNotExist alternative [closed]
Closed 9 years ago.
Should the variable be named Id or ID? [closed]
Closed 9 years ago.
Is it considered poor practice to include a bug number in a method name for a temporary workaround?
My coworker who is a senior guy is blocking me on a code review because he wants me to name a method ‘PerformSqlClient216147Workaround’ because it’s a workaround for some defect ###. Now, my method name proposal is something like PerformRightExpressionCast which tends to describe what the method actually does. His arguments go along the line of: “Well this method is used only as a workaround for this case, and nowhere else.”
organising classes / folder structure for TDD-based development
Due to test-driven development, one ends up with many classes doing just one thing. It is quite a headache just to see where such classes would be placed inside the folder structure.
Naming for a class that consumes an iterator pattern [closed]
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for […]
Is C# namespace should be Project-Name? [closed]
Closed 9 years ago.
The suffix Exception on exceptions in java
Specifying a suffix of Exception on exception classes feels like a code smell to me (Redundant information – the rest of the name implies an error state and it inherits from Exception). However, it also seems that everyone does it and it seems to be good practice.
Is there an accepted name for a fake object injected via a preprocessor seam?
I am dealing with some old, sloppy C++ code in which there is a structure with a lot of data members and functions. I want to test a class that I have implemented which uses the struct, but this dependency is going to make the unit tests extremely ugly. Inspired by Michael Feather’s discussion of preprocessing seams in Working Effectively with Legacy Code, I am getting ready to solve this problem by faking the ugly structure with the preprocessor (not with inheritance) polymorphism as demonstrated in the following notional code.