12,973 reputation
12758
bio website
location
age
visits member for 4 years, 2 months
seen 2 hours ago

May
20
comment Interfaces on an abstract class
More or less, yes. The big advantage is that you will reduce the number of references to BaseWorker that will have to change to be BetterBaseWorkers instead; most of your code won't reference the concrete class directly, instead using IFooWorker, so when you change what is assigned to those IFooWorker dependencies (properties of classes, parameters of constructors or methods) the code using the IFooWorker shouldn't see any difference in usage.
May
4
revised Why do people nowadays use factory classes so often?
added 10 characters in body
May
4
comment Why do people nowadays use factory classes so often?
A protected and/or internal constructor would be such a signal; this constructor would only be available to consuming code whether in a subclass or within the same assembly. C# does not have a keyword combination for "protected and internal" meaning only subtypes within the assembly could use it, but MSIL has a scope identifier for that type of visibility so it's conceivable the C# spec could be extended to provide a way to utilize it. But, this really doesn't have much to do with the use of factories (unless you use the restriction of visibility to enforce a factory's use).
May
4
comment Should we always DRY? Any edge case examples of when not to?
@StevenBurnap - I actually disagree here; I follow the same mentality for POCs as for code specifically intended to enter production. This is because POCs and other "prototype code" get folded into production code all the time; there's even a term for it, "protoduction". Management's mentality is, the POC solves the problem, so the "least-work" solution to that problem in the production system is to bolt the prototype code onto the production system the fastest way possible. The better your prototype code, the more willing you will be to go along with that and the happier everyone will be.
Apr
28
revised Should we always DRY? Any edge case examples of when not to?
added 91 characters in body
Apr
28
comment Should we always DRY? Any edge case examples of when not to?
I've been bitten a couple times. I might want to amend that to say that making two tests from one is typically OK, but when that grows into five or six you have to look at it the same way you would production code and say "this is too much, it needs a refactor".
Apr
28
revised List comparing techniques for faster performance
added 58 characters in body
Apr
28
answered List comparing techniques for faster performance
Apr
28
comment Why is it common to put an underscore before a method in JavaScript?
@Snowman - While "asked and answered" is a good reason to close, I disagree with what you actually chose; coding convention questions are definitely on-topic here.
Apr
28
answered Should we always DRY? Any edge case examples of when not to?
Apr
27
revised Why is it common to put an underscore before a method in JavaScript?
added 172 characters in body
Apr
27
answered Why is it common to put an underscore before a method in JavaScript?
Apr
27
comment How to convince teammates to use TDD
Good answer, but I would mention that if nobody else is TDDing or even running the test suite, then a common scenario for breaking a test would be if someone made a change to the production code without changing the test to expect the change in behavior. Could be as simple as changing the wording in an exception message. They check in, OP checks out, tests break, hilarity ensues. You might consider a test that asserts an exact error message too brittle, but the contract for my last job defined a defect as any deviation from the stated AAT, and error messages were common defects.
Apr
17
comment Elegant way to count the number of files in Zip archive
Given the structure of a Zip archive it doesn't get a whole lot prettier; the only thing faster is to examine the "Central Directory" byte for byte and that tends to be something Java makes intentionally difficult.
Apr
17
revised Java and .NET: Why different sorting algorithms are used by default?
added 188 characters in body
Apr
17
comment Java and .NET: Why different sorting algorithms are used by default?
It does remain that Microsoft devs are proven fanboys of QuickSort over other implementations, as QuickSort has been the algorithm of choice since MS-DOS, and this would have influenced their decision to implement .NET's sorting with this algorithm.
Apr
17
comment Java and .NET: Why different sorting algorithms are used by default?
@RobertMacLean - ".NET isn't layered on top of anything" is not a true statement, though you have demonstrated that the Sort function in question is wholly "managed" code. Large portions of .NET, including cryptography support, Windows desktop GUI libraries, Windows API interop (including process and threading control) are all based on pre-existing unmanaged code including the MFCs. They simply have to be; Windows itself has only a very minor .NET component of its codebase, the rest is unmanaged
Apr
17
comment Who owns code if project cancelled
Where the court will step in is where there was a proven misrepresentation of fact (fraud), or where certain specifics of the agreement are conceded by both parties and the outcome does not live up to them (such as a finished product for 10 grand, or overtime for hours in excess of a stipulated amount). In neither case is either party guaranteed "fair value" for the money they have spent or the effort they have put in. Even if the court calls the contract void, and the company keeps their money and the OP his code, is the OP going to be able to turn around and resell that code? Probably not.
Apr
17
comment Who owns code if project cancelled
Yep. "The legal system is not intended to be a remedy for bad decision making". A contract is merely an offer and an acceptance, which can be in any form of communication understood by both parties. Therefore, there was an "agreement" of some sort of work for payment. The specifics, however, don't exist. Therefore as long as some money was paid and some work was done, the court will call it a wash even if the freelancer's only been paid a dollar for two weeks' work, or if the company paid $10,000 up front for what turned out to be 8 hours.
Apr
14
comment Who owns code if project cancelled
If there was no explicit contract, it's up to a judge, who will see that the freelancer has been paid some amount of money, will direct the freelancer to make the product of his work to date available to the client, and consider the contract satisfied.