646 reputation
28
bio website
location
age
visits member for 2 years, 10 months
seen Nov 14 at 21:00

Apr
7
revised Strategies for avoiding SQL in your Controllers… or how many methods should I have in my Models?
fixed formatting
Apr
6
answered Strategies for avoiding SQL in your Controllers… or how many methods should I have in my Models?
Mar
13
answered Best approach for a Java web chat client
Mar
8
answered Should I use the Date type in JAX-RS @PathParam?
Feb
22
awarded  Critic
Feb
22
comment When is it not appropriate to use the dependency injection pattern?
SRP = single responsibility principle, for anyone else wondering.
Feb
22
revised When is it not appropriate to use the dependency injection pattern?
clarified wording
Feb
22
revised When is it not appropriate to use the dependency injection pattern?
It's possible to do DI testing without creating a ridiculous amount of coupling, edited to reflect that.
Feb
22
comment When is it not appropriate to use the dependency injection pattern?
There wouldn't be so much cost to having an extra constructor used for testing only that allows the dependencies to be injected. I'll try to revise what I said.
Feb
22
comment When is it not appropriate to use the dependency injection pattern?
You misunderstand, I'm not talking about when you inject a mock, I'm talking about the real code. Consider class A with dependency B, which in turn has dependency C, which in turn has dependency D. Without DI, A constructs B, B constructs C, C constructs D. With construction injection, to construct A, you must first construct B, to construct B you must first construct C, and to construct C you must first construct D. So class A now has to know about D, the dependency of a dependency of a dependency, in order to construct B. This leads to excessive coupling.
Feb
21
answered When is it not appropriate to use the dependency injection pattern?
Feb
11
comment Why do variables need a type?
You're right, static/dynamic is what I should be using here, fixed.
Feb
11
revised Why do variables need a type?
weak->dynamic strong->static
Feb
11
awarded  Supporter
Feb
11
comment Why do variables need a type?
I'm pretty sure the closest you can get is C#'s var, where the type is still determined statically, but you don't have to spell out what the type is. That said, for clarity reasons, it's usually better to say the type explicitly in C#, since it means you can easily see the type of the variable when you have to modify your code six months down the line.
Feb
11
awarded  Editor
Feb
11
revised Why do variables need a type?
improved clarity (typing->keystrokes, since we're discussing variable type)
Feb
11
comment Why do variables need a type?
In most languages that I'm aware of, whether statically or dynamically typed, 10 + "10" is valid code. It's valid in Java, C#, VB.net, JavaScript...only one I'm sure it's not valid in, off the top of my head, is C.
Feb
11
comment Why do variables need a type?
I've given an example above in which you can't know the types of the objects statically...depending on the path of execution, the type of object stored in a variable with no type information can be different. You can have a language like C# where the compile-time type information can be inferred, but, so far as I know, there's no language with both static type-checking and truly typeless variables, the computational complexity of the static analysis is likely too great.
Feb
11
awarded  Teacher