Reputation
67,758
Next tag badge:
128/100 score
19/20 answers
Badges
21 147 241
Newest
 Nice Answer
Impact
~1.5m people reached

1d
comment Ambient dependency injection through static service locator
@john - nope that's the one. It's been a few months since it happened and I'm not able to recall the particulars. Still - I hate things like this that are hidden, and I doubly hate them when they're used to then hide other problems.
1d
comment Ambient dependency injection through static service locator
@john - hmm, I might be misremembering then. There was some situation (perhaps OWIN?) where the call context didn't flow the entire way.
1d
comment Ambient dependency injection through static service locator
@john - Except that Call Contexts don't always flow along async calls. Either your dependencies go along to other threads (and you have shared state problems) or they don't (and you have missing dependency problems).
1d
answered Ambient dependency injection through static service locator
1d
comment Service-locator anti-pattern alternative
@smoksnes - I can't tell, since it's unclear what it's supposed to do. Naively, it seems overwrought.
1d
answered Service-locator anti-pattern alternative
Apr
27
comment How does immutability remove the need for locks when two threads are trying to update the shared state?
@Stargazer712 - the OP didn't ask how to use immutability to eliminate locking. But you are right, that this example is plain old concurrent programming and gains you very little. I hoped the changed answer made that more clear... :/
Apr
27
comment How does immutability remove the need for locks when two threads are trying to update the shared state?
@ar7 - yeah, it is not atomic, but as long as tmp isn't changed, it doesn't matter.
Apr
27
revised How does immutability remove the need for locks when two threads are trying to update the shared state?
added 4 characters in body
Apr
27
comment How does immutability remove the need for locks when two threads are trying to update the shared state?
Yeah, and with concurrency, you need 0%, or else you're chasing random failures forever. Also, I updated my answer to better include some of the comments from here and elsewhere.
Apr
27
revised How does immutability remove the need for locks when two threads are trying to update the shared state?
Expanding answer to be more thorough, since people didn't seem to get the original one.
Apr
26
comment How does immutability remove the need for locks when two threads are trying to update the shared state?
@ar7 - the thing is that you don't know how other threads are using your data if it is mutable. You need to lock even for non-atomic reads then. The reason people only talk about reading is because that is all immutability helps.
Apr
26
comment How does immutability remove the need for locks when two threads are trying to update the shared state?
@ar7 - if you'll note, I am the answerer of the question you linked. Immutability means that two fields of an object can never be out of sync when you read them (or indexes in a collection). The read can't catch another thread in the middle of mutation. You don't need locks there like you would with a mutable object.
Apr
26
comment How does immutability remove the need for locks when two threads are trying to update the shared state?
@Stargazer712 - in every single modern language it is. Immutable objects != immutable references.
Apr
26
answered How does immutability remove the need for locks when two threads are trying to update the shared state?
Apr
26
comment Should I use cqrs + es to build a slot machine app?
You need none of those things, and I'm not sure why you think you might.
Apr
20
awarded  Nice Answer
Apr
15
comment What would be the merits/disadvantages of an OOP language that forced the generator pattern?
So... how are these different from constructors again?
Apr
14
comment As a programmer, how can I speed up my adoption and understanding of business rules?
To be clear, I'm focus on reading code first.
Apr
13
answered As a programmer, how can I speed up my adoption and understanding of business rules?