Reputation
2,118
Top tag
Next privilege 2,500 Rep.
Create tag synonyms
Badges
7 19
Newest
 Enlightened
Impact
~32k people reached

Oct
24
comment algorithm to print the digits in the correct order
The problem with this solution is to properly cover edge cases. Logarithm is floating-point number (which are tricky themselves), not to mention, 10-based logarithm is not natural (natural is e-based one), so some more error can accumulate. Which can leads to situations, where log n will be off by one. So you should not blindly believe it, but test the edge case. Also, if you know you have an integer, it is safer (again, floating point, unsafe edge cases) to do things like (1234 - 1234 % (10 ^ [4-1])/(10 ^ [4-1])) to eschew the floating point.
Oct
24
revised MVC Can the model know ANYTHING about the view?
typo MVVC -> MVVM
Oct
23
answered MVC Can the model know ANYTHING about the view?
Oct
22
comment How can I explain object-oriented programming to someone who's only coded in Fortran 77?
OOP is (sort-of) simple, C++ "OOP" is not. Take Smalltalk (object has instance variables and a class, class has methods, you send message to and object which is serviced by a method, that's basically it). Prototype-oriented OOP can even put classes off the equation. --- That's why I would recommend (if possible) to only use subset (no private, no protected, no const, no multiple inheritance, all methods virtual, all destructors virtual etc.) so the model is simpler. Add other things later.
Sep
30
awarded  Nice Answer
Sep
26
revised Do any OO languages support a mechanism to guarantee an overriden method will call the base?
deleted 5 characters in body
Sep
26
answered Do any OO languages support a mechanism to guarantee an overriden method will call the base?
Sep
19
awarded  Nice Answer
Sep
19
comment Test Driven Development Code Order
@martiert: It is a wrong test. You do not test anything in that test (existence of class is implementation detail).
Sep
19
comment Test Driven Development Code Order
@ollins: Yes. Or, from the bigger PoV, "Never write a line of code without a failing test.", that is, never write any piece of production code which is not necessitated by existence of failing test and which makes this failing test pass. Kent Beck calls this approach "test-infected".
Sep
19
revised Test Driven Development Code Order
edited tags
Sep
19
answered Test Driven Development Code Order
Sep
18
comment Misunderstanding Scope in JavaScript?
Sort of. I said it can't be "passed" because by passing I meant giving it to someone else to manipulate. But it is not passed in that sense, it is just "brought with" the closure - only the code inside the closure can see/manipulate it. But these are the details (the devil is in the details ;-) ). BTW, functions returning functions are pretty common stuff in JavaScript; usage of closures to "simulate private variables" etc. are common patterns which all base upon closures (returned from other functions) having lexical scope.
Sep
18
comment Misunderstanding Scope in JavaScript?
GlenPeterson said it right. apply and call are about setting this for a call; there is no way to pass scopes at all. But you must take into account that functions are in fact lexical closures so they take hold of their scope for their lifetime. The articles aim to show this, that is why I recommended them.
Sep
18
answered Misunderstanding Scope in JavaScript?
Sep
17
answered Is it dangerous for me to give some of my Model classes Control-like methods?
Sep
6
comment software architecture (OO design) refresher course
I would add more than +1 if it was possible...
Sep
5
comment Does software testing methodology rely on flawed data?
IIRC, Kent Beck did not say the curve is flat after the first rise, only that it is "almost flat" but still rises slightly.
Sep
4
comment How to write reusable code in node.js
It is not very clear what is your problem, maybe rephrase it. I'd have two comments: 1. Maybe you just need to get used to async/callback way of doing things, I do not see anything like "unmanageable code soup" there. 2. Ad "loosely coupled classes": do you really need "classes" there? Classes are not needed to do OO neither to do good design. Maybe change the title.
Sep
3
revised Continuous integration (with iOS and Android projects)
typo correction