Reputation
1,035
Top tag
Next privilege 2,000 Rep.
Edit questions and answers
Badges
5 13
Newest
 Yearling
Impact
~33k people reached

  • 0 posts edited
  • 0 helpful flags
  • 58 votes cast
Sep
12
comment DRY unrelated, but nearly identical, code
One important note: if you do repeat yourself, always mention in the comment all the other places that have to be visited when the repeated code changes. Not only it reduces the likelihood of a desync, it also works as an indicator of how much maintenance pain the repetition is causing you.
Jun
14
answered Using a one-shot class to store not-quite-global variables
May
13
awarded  Yearling
Mar
22
awarded  Critic
Aug
22
comment Questioning one of the arguments for dependency injection: Why is creating an object graph hard?
But dependency tree must be a tree, in the graph theory sense. Otherwise you've got a cycle, which is simply unsatisfiable.
Jul
12
comment What's a good simple way to combat the n+1 problem?
I'm nitpicking, but subquery loading in SQLAlchemy is not exactly like the OP's second approach. The difference is that it uses a nested SELECT (SELECT x FROM (SELECT y ...))), so that the programmer doesn't have to provide parent object IDs (here: posts) explicitly.
Jun
22
awarded  Editor
Jun
22
revised How can I use guice to replace code dependent on service locator implementation?
added 708 characters in body
Jun
22
answered How can I use guice to replace code dependent on service locator implementation?
May
13
awarded  Yearling
Apr
17
answered Do I need to publish deployment scripts for deploying AGPL licensed work (MongoDB)
Mar
20
answered Java Method Returns Unbounded Type
Jan
8
comment Why do C++ and Java both use the notion of “reference” but not in the same sense?
Note that in your first C++ example, you are not making the reference "point to something else". Instead, you are changing the value of variable the reference points to. This is conceptually similar to mutating the state of object that is referred to with Java reference,
Jan
3
comment Using std::sort et al. with user-defined comparison routine
"The problem is that we allow users of the language to supply their own comparison routine, and (...) std::sort does not take kindly to routines that fail to be a strict order." Okay, but what requirements on comparison routines do you impose for your users to satisfy? If you require strict ordering and your API users fail to provide it, it's outside of the scope of your code to try and fix it.
Nov
15
awarded  Good Answer
Nov
14
comment Updating password hashing without forcing a new password for existing users
In that case, probably your only option is admit that you screwed up hard and just go ahead and reset password for all users. It's less about migration at that point and more about damage control.
Nov
12
awarded  Nice Answer
Nov
10
answered Updating password hashing without forcing a new password for existing users
Sep
7
comment Should I use mMember and sStatic naming convention in Android?
Note this is not full blown Hungarian Notation, it only distinguishes fields by its kind. I imagine it may be useful in constructors and setters (mFoo = foo; rather than this.foo = foo;). It also makes you less reliant on semantic coloring which not every color theme/IDE offers.
Sep
4
comment Why is there a “new” in Go?
By the same notion, Python and Ruby are very alien to C developers, as they use bunch of unfamiliar keywords, "weird" syntactical rules (where are braces?) and strange semantical concepts (generators? metaclasses? decorators?). Yet they don't get ~0 traction, quite the opposite.