42,643 reputation
13104193
bio website
location London, United Kingdom
age
visits member for 4 years, 4 months
seen May 19 at 12:26

Apr
2
comment Is it a bad practice to separate the unit tests for a class?
@AvetisG: People don't have to elaborate on their downvotes and it's unfair to ask them to. But I'll try to help you ... Only the first paragraph here even attempts to answer the question. The rest is an opinion, which some people wouldn't share. I, personally, agree with your opinion but I don't agree with the one paragraph that's relevant to the question, and I don't see the connection you're making. Mike's answer is correct: "Each test class (like any other class) should have a clear focus." That may or may not be the same focus as for your classes under test.
Mar
12
comment How to Use Python as a “Macro” runner for a C# Application
@Katana314: The question suggests he wants an application to which Python can send messages. Which would be a web service, even if it's not web-hosted. But the comment above suggests that he might want to send scripts to the app; in that case, I might suggest running Python, rather than embedding IronPython. Although, I've a gut feeling that Python isn't the answer either. Perhaps a DSL, perhaps in Boo. And that's why I'm looking for more information.
Mar
12
comment How to Use Python as a “Macro” runner for a C# Application
What is your app trying to achieve that couldn't be achieved with a RESTful web service?
Mar
11
comment Decorater pattern or strategy pattern
@8bitcat: Don't confuse the MVC for ASP.NET framework with the MVC pattern. There are other MVC frameworks out there that look entirely different (while still following the same pattern), particularly when you look outside the .NET world. Design Patterns (GoF, PoEEA) are a common language for problems that have been solved repeatedly in many different languages. programmers.stackexchange.com/questions/70877/…
Mar
4
comment Is using interfaces for datatypes an anti-pattern?
@Doval: I could create an IList that fulfils the contract IList and throws exceptions on each method, or make it delete a database on Add. But any method that calls Add on an object that fulfils the contract IList will still blindly call Add, no matter the behaviour of my implementation.
Mar
4
comment Is using interfaces for datatypes an anti-pattern?
@JeffO, Doval: That's my point, isn't it? It fits the interface, it fulfils the contract, the outlet will blindly send it electricity. If it doesn't do what it's intended to do at that point, that's a failure of the person who plugged that particular device into outlet. An interface does not guarantee behaviour, only that A will fit into B.
Mar
4
comment Is using interfaces for datatypes an anti-pattern?
@Doval: The distinction is that the contract is between the code passing the entity and the code receiving it (any object I pass you will conform to this contract, so you can make that assumption), not between the entity and either piece of code. Behaviour is the business of the entity. And seeing the behaviour as part of the contract leads to the question above. It's like seeing a 3.5mm jack socket as a behaviour, rather than a standard link between two undefined objects; my plugging headphones into my phone defines the overall behaviour of the circuit, not the connection.
Mar
4
comment Is using interfaces for datatypes an anti-pattern?
@Doval: I guess the name of the interface may describe the expected behaviour. But it doesn't have to; the interface could equally be named IHasIdAndDescription and the answer would be the same. The interface itself doesn't describe behaviour, it describes expectations.
Dec
18
comment Is it poor practice to call methods through multiple objects?
@supercat: I like that. I'm going to ponder it, and then probably steal it. :)
Dec
18
comment Is it poor practice to call methods through multiple objects?
@supercat: Lists and arrays are definitely one of those examples where common sense has to kick in. Although a List<Car> is an object in and of itself, I'd argue that every element in that list is really one of "O's direct component objects". Take your point one step further and we'll talk about each character in a string being owned by the string, not by the object that owns the string. Or maybe ban bitwise operators for working on bits owned by an int. Strict adherance to LoD could definitely get that silly, but that doesn't nullify the guideline.
Dec
18
comment Is it poor practice to call methods through multiple objects?
@supercat: If I'm understanding what you mean, that's exactly what LoD advises you not to do. Each object should have only one owner, which should pass it to child objects as method parameters or expose methods that allow parent objects to access the "grandchild" indirectly. Again, I'm not arguing for the LoD as a hard-and-fast rule here, I'm explaining why there's no mention of multiple ownership in an article about the Law of Demeter -- because the two things are orthogonal.
Dec
16
comment Shortest Common Superstring: find shortest string that contains all given string fragments
@majidgeek: Thanks for letting me know.
Dec
5
comment Is “White-Board-Coding” inappropriate during interviews?
@KyleStrand: It was weird. He totally managed to model the problem I gave him in the interview, but he couldn't apply the same thinking to the business. But, also, he had a more general problem with laziness, so perhaps it was more that he wouldn't than couldn't. And perhaps that's the lesson to be learned, with 5 years of hindsight: technical tests are all well and good, but can't identify a fundamental character flaw.
Dec
3
comment Creating a sort of 'in-language compiler'
Might want to have a look at this book: manning.com/rahien
Dec
2
comment Scrum: Is it ok for the design/UX of user story to occur in the same sprint as implementation
@Allan: What your scrum master is failing to understand is that, if the designer has to complete their work before a developer can begin their work, that IS up-front design. Making it happen within the sprint removes none of the cost of up-front design but it does make it less-visible AND makes it harder to estimate your development. If you can find a way to iterate with your designer, that's great, make it part of the sprint and make the effort appropriate to a collaborative task. But up-front is OK, as long as it's honest and, preferably, done before the sprint.
Dec
1
comment Scrum: Is it ok for the design/UX of user story to occur in the same sprint as implementation
Worth mentioning that your question in the subject line is very different from the questions at the bottom of your text. Would be helpful if you edited that to choose one or the other.
Nov
18
comment Understanding the static keyword
@Allan: Arguably, if you're calling a public method on a class that doesn't affect the state of an instance of that class, it SHOULD be static, to make that clear to the client developer. If that method does so much that it needs mocking, that's a different problem that can be solved a number of different ways.
Oct
30
comment Should I store images in my database or file system in this application?
@EsbenSkovPedersen: "Moving to a CDN" is the "that" in the sentence you quote ... maybe I should edit that line.
Oct
15
comment What is the difference between the factory pattern and abstract factory?
@SerG Well, in fairness, you've picked up that quote from Wikipedia, on a page that read very differently three years ago. I would argue that the current Wikipedia page contradicts itself in several places, but I don't have the desire to get involved in picking that apart. What I would concede, in hindsight, is that the example I've provided here is a specific kind of Factory Method, known as the Parameterized Factory Method. But the point about the difference between Factory Method and Abstract Factory holds across all types of Factory Method.
Aug
4
comment Best practices for unit testing methods that use cache heavily?
@Jonathan: "Just have a Repository and a Caching Wrapper that use the same interface" -- if they have the same interface, you can use the same methods. The calling code doesn't need to know anything about implementation.