3,263 reputation
21030
bio website
location Chicago, IL
age 26
visits member for 3 years, 5 months
seen 4 hours ago

Aug
28
revised if else brackets on same line, best comment style?
edited body
Aug
27
comment How do I move away from the “for-loop” school of thought?
@sapi Ah, I missed what's going on in the doctests, thought those were plain list
Aug
27
comment How do I move away from the “for-loop” school of thought?
Wait, is there a typo in the last answer or does NumPy modify how Python interprets the code?
Aug
25
comment Questioning one of the arguments for dependency injection: Why is creating an object graph hard?
@oberlies Still is; you'd then have to go digging in 9 class definitions to figure out which classes are being used for that ShippingService, rather than one location
Aug
22
comment Questioning one of the arguments for dependency injection: Why is creating an object graph hard?
This answer would seem to provide a very good example as to why you'd want some sort of container for your object graphs (in short, you're not thinking big enough, using only 3 objects).
Aug
22
comment Can this word search algorithm be made faster?
This is really only worth it if you intend to search the same text multiple times for different matches, due to the overhead of creating the hash.
Aug
18
comment What does 'stage' mean in git?
@LexiR --interactive is newer on commit; it's not on the version we have installed at work
Aug
15
comment JS design pattern/algorithm for avoiding duplicate redraws in a fairly coupled system
Let us continue this discussion in chat.
Aug
15
comment JS design pattern/algorithm for avoiding duplicate redraws in a fairly coupled system
@slicedtoad Just don't forget that S also needs to emit some event that A, B, and C can listen to, to know when to redraw. I was mainly pointing out that dirty flags/counts aren't necessary, but it's at the cost of some of the flexibility that flags/counts give.
Aug
15
comment JS design pattern/algorithm for avoiding duplicate redraws in a fairly coupled system
@slicedtoad That's not how they work in Javascript. Because it's single threaded, anything setTimeout triggers will happen after the current callbacks - it won't interrupt the current execution flow. B updates A, A calls setTimeout(), B finishes execution, A's timeout callback triggers. Or if B and C both ran immediately, the update to A will happen twice before any setTimeout callback can trigger, and the second update will cancel the first timeout
Aug
15
comment Point estimates scale skewed
@svidgen We also ended up with a logarithmic scale, and balance it out by pulling in around the same number of cases of each point level in each sprint. This way the sprints stay comparable and velocity consistent despite the points not adding up linearly between cases. There's nothing wrong with a logarithmic scale as long as it's adjusted for in other ways.
Aug
15
comment Point estimates scale skewed
@EricKing I don't think this is the case. Our team has also ended up with the same logarithmic scale over time (such that an 8-point case is way larger than three 3-point cases). It's not all that surprising, either, given that humans apparently think logarithmically and not linearly
Aug
15
comment JS design pattern/algorithm for avoiding duplicate redraws in a fairly coupled system
@slicedtoad Javascript is, for the most part, single-threaded. Assuming B and C don't delay any processing themselves, this means you can (ab)use setTimeout with a timeout of 0 and not even need a dirty flag - whenever A determines it needs to redraw, put the redraw behind the timeout and cancel the previous one with clearTimeout.
Aug
12
comment What does 'stage' mean in git?
Particularly sleske's answer, which uses the same source
Aug
11
comment Is a try-catch-finally clause appropriate for production code?
Yeah, in this case, the best solution for that question is "find the actual root cause; you might have bigger problems". It might take too long if they have a deadline, though...
Aug
11
comment Is splitting up a function into several inner functions an anti-pattern?
Your specific example has hints of an anti-pattern called sequential coupling, but it may be the correct way to go given the specific algorithm involved - or there could be a better way to split your code into different functions that reads better.
Aug
10
comment What does 'stage' mean in git?
@jiggy It can, just use git commit -a (for "all") to skip having to stage files, and commit all changes
Aug
5
comment Naming: StartDate or StartDateTime when working with DateTimes
Note that including the datatype is "Systems" Hungarian Notation, and is generally accepted as bad practice (let the IDE tell you instead of cluttering up variable names). "Apps" Hungarian on the other hand - using the semantic meaning - is considered "good" practice (use it for things the IDE won't tell you). For example, instead of Start, StartDate, or StartDateTime, why not ProjectStart?
Aug
5
awarded  Announcer
Aug
3
comment Is this approach to CSS correct?
@mattecapu It's probably more frequent because it's more flexible. With the "clearer" animal-based example, if you have interactivity with javascript, you'll either have to select all types of animals or go back and add the animal class to the elements. It also distinguishes between ambiguities in English - for example, is it "bat" or "bat"?