Tag Info

New answers tagged

1

As with most style questions, it is less important that you have strictly perfect code than it is that you agree on a standard and stick to it. In this case, the choice of name is very subjective, so it is really difficult to choose one over another, although personally I'd argue that "systemUnderTest" is too long, and that "target" is a more succinct ...


0

This is a real interesting question where the two essentially opposing answers are both correct. Here's a real-world example of this discussion we're having on a project of mine. I think there are two very salient considerations so far that would make you want to go in one direction or the other, drawing from the two answers from @Jorg and @Frank: If you ...


1

In the Windows world, the term is "service" and in the Unix / Linux world, the term is "demon" or "daemon". a Windows service is a computer program that operates in the background and a daemon (/ˈdiːmən/ or /ˈdeɪmən/)[1] is a computer program that runs as a background process, rather than being under the direct control of an interactive user Both ...


1

I feel like I'm missing something, but I would just make your CarRepository a Map[RegistrationNumber, PlainCar] or something similar. Usually with immutable objects, it's much easier to create this kind of association outside the original object. My second choice would be RegisteredCar extends PlainCar, but I think this creates unnecessary coupling and ...


3

It sounds as if registration is a state which only has meaning in the context of a repository. You have described two states, (registered with the repository, not registered with the repository). It sounds to me as if what you need is a car container (wrapper if you like). Think of it as a collection which can hold one car, in the same way that ...


-2

I personally find camelcase to be more natural when coding variables, but because variables in PHP are case sensitive, and it's no fun hunting through code looking for a variable you forgot to make camelcase, I always use snake case for variables. While its true that the conventions are mutable, coding after someone that has used camelcase on variables, ...



Top 50 recent answers are included