1,879 reputation
822
bio website
location
age
visits member for 1 year, 10 months
seen 2 days ago

Mar
27
comment Should we test all our methods?
I'm still making up my mind on this question, but here's a talk of someone who has decided the answer is "no". Ian Cooper: TDD, where did it all go wrong To summarize this great talk, you should test outside-in and test new behaviors not new methods.
Mar
27
revised Should I refactor my unit tests when I extract a class out of the System Under Test?
added 1 characters in body
Mar
26
revised Should I refactor my unit tests when I extract a class out of the System Under Test?
deleted 3 characters in body
Mar
26
accepted Should I refactor my unit tests when I extract a class out of the System Under Test?
Mar
26
answered Should I refactor my unit tests when I extract a class out of the System Under Test?
Mar
4
comment I'm struggling with abstracting my animation code in my game using a functional style. How can I do this?
It also seems to be against the design of the Entity Component System design pattern. That said... If you think I should still just put the function in my state, I'll trust you on this.
Mar
4
comment I'm struggling with abstracting my animation code in my game using a functional style. How can I do this?
I'm using javascript + "discipline" to code it in a functional style. I've also been trying to keep my data and behavior completely separate from each other, and I feel like the player state having-a function would be mixing the two together. My rule is somewhat arbitrary, but a nice benefit is I can easily serialize the state whenever I want to save it or have another programming language send it over the wire. That said, your answer is an easy way to accomplish the result I'm looking for. But, is there a way to do it while keeping behavior out of my state?
Mar
4
revised I'm struggling with abstracting my animation code in my game using a functional style. How can I do this?
edited tags
Mar
3
comment I'm struggling with abstracting my animation code in my game using a functional style. How can I do this?
What's a functor? Are you using the "Function Object" meaning of the word?
Mar
3
asked I'm struggling with abstracting my animation code in my game using a functional style. How can I do this?
Jan
30
comment So Singletons are bad, then what?
@Lucas ah, so is he saying the impl of that Cache class uses those interfaces on the side but implements the interfaces below?
Jan
30
comment So Singletons are bad, then what?
@Lucas that didn't clarify. Maybe because of your typos.
Jan
30
comment So Singletons are bad, then what?
I'm not sure if I understand this last picture or not. Why are there interfaces on the side? How are these interfaces different from the ones below the cache?
Jan
28
comment Returning different types from one function in a dynamically typed language
By coincidence, I'm dealing with this with a Java Rest API I'm building. I made it possible for one resource to return either XML or JSON. The lowest common denominator type in that case is a String. Now people are asking for documentation on the return type. The java tools can generate it automatically if I return a class, but because I chose String I can't generate the documentation automatically. In hindsight/moral of the story, I wish I returned one type per method.
Jan
28
comment Returning different types from one function in a dynamically typed language
It seems that it makes sense to return multiple types in one function in all the same places it makes sense to return a generic type in Java. Unfortunately, I don't know how to articulate it better than this.
Jan
28
awarded  Notable Question
Jan
28
awarded  Good Question
Jan
28
awarded  Popular Question
Jan
27
accepted In TDD, if I write a test case that passes without modifying production code, what does that mean?
Jan
27
accepted Does functional programming ignore the benefits gained from the “On the Criteria To Be Used in Decomposing Systems into Modules” (data hiding)?