Tag Info

New answers tagged

3

Fixtures. The setUp and tearDown methods are for creating or cleaning up your fixtures. If they live in memory, cleanup is easy ;) but if your fixtures live in the database, then both setting them up and tearing them down can be a little more involved. (the last bit was to pad the answer, because "Fixtures" wasn't enough characters)


-1

I randomly happened to find exactly what I wanted: Daemon.


0

Some naming guidelines make a distinction between "short" and "long" acronyms. For instance, the coding style guide for Microsoft's .Net runtime specifies that short acronyms should be in block caps while long acronyms should only have the first letter capitalized. Their threshold for a long acronym is 3 letters, so would favor "XmlHttpRequest", however it ...


-1

I would just call it "Git" at this point. The class should be named after the thing that it is modelling, and you're modeling a "git" command.


0

It's not very clear, but I'll give it a shot :) A design pattern that comes to mind is Adapter, but that's quite generic. I would probably call this a GitClient, as ~Client is often used for a class encapsulating a third party API into a clean internal interface. But I'm sure there are valid alternatives. Probably I'd also end up having some helper ...


0

You haven't explained what is the purpose of the short representation of text, so one can only stipulate. I assume you need it to be able to distinguish different pieces of text while not having to do a full comparison. If you need only a hint and accept that two different pieces of text may sometimes result in the same short representation, use hashes. ...


0

Short answer: method names aren't supossed to reflect internal implementation but expected behavior. Long answer: haveChildren() should be named hasChildren(). Also I don't see hasChildren() as necessarily being the getter for a boolean class member. I guess such a method would find out whether or not a member of type Collection is empty. Default ...


5

Naming things can be tricky - A good rule of thumb is that if you are having trouble naming a class/function clearly then you should read it as a red-flag that you haven't thought about the architecture or design enough yet and should probably stop coding until you have. For naming stick to the name of the object/concept being modelled and exclude the ...


1

This is an old question, but I'm going to post here anyway. I have some 20+ years of programming and dealing with other people's code. I think that naming your variable with a short indication as to their scope is really really useful for the next person (or yourself) who will look at your code. One does not already look at code in an IDE with pretty ...


3

From what I have both read and experienced, it is not a good practice to have more than one single step in initialization of an object. This is not good because You need to babysit all such objects, so that the required initialization steps are completed before the objects are used You would have to expect anyone using your code to also properly babysit ...



Top 50 recent answers are included