11,293 reputation
34064
bio website
location Waco, TX
age 29
visits member for 4 years, 8 months
seen 3 hours ago
My native language is C++, but I have left my first love and now use python whenever I have the slightest excuse. Actually, I use python even if I don't have an excuse.

May
13
comment can i use json file as a module in node.js
stackoverflow.com/questions/7163061/…
May
9
comment Are mocks in unit tests dangerous in dynamic languages?
It bothers me because those don't mitigate the dynamic typing in javascript, you are mitigating other broken parts of javascript. It just doesn't seem relevant to the question.
May
9
comment Are mocks in unit tests dangerous in dynamic languages?
@RobertHarvey, I've come across people who insist that every single thing outside of the class you are actually testing has to be mocked or your a bad person. That's what I had in mind there.
May
9
comment Are mocks in unit tests dangerous in dynamic languages?
I assume you are talking about: blogs.msdn.com/b/ericlippert/archive/2012/10/15/…, Lippert talks about "weak typing" being an imprecise concept. That is not the same thing as dynamic typing. My concern is that the question asks about dynamic typing, and you end up talking about type coercion in javascript which is a different issue. I.e. many dynamic languages don't do type coercion in that way.
May
9
answered Are mocks in unit tests dangerous in dynamic languages?
Apr
26
comment What is the maximum number of steps to find a bug using bisecting?
Related: cstheory.stackexchange.com/questions/8923/… cs.stackexchange.com/questions/22451/…
Apr
23
comment Why python function programming functions are not collection methods?
@Giorgio, you're missing the point. The point is that I can use map,reduce,filter on anything that defines __iter__ if I can only use them on objects that have also decided to specifically add these methods I've lost a great deal of the power of duck typing.
Apr
23
comment Why python function programming functions are not collection methods?
@Giorgio, no they don't. They all just call __iter__ to iterate over the element and implement there particular operation on top of that. They don't have to reimplement their logic for every possible collection.
Apr
23
comment Why python function programming functions are not collection methods?
@Giorgio, you really want every class that I can iterate on to have seperate implementations of all those methods?
Apr
23
comment Why python function programming functions are not collection methods?
@Doval, who said anything about choosing one construct over another because Guido said so? I'm not actually personally a fan of comprehensions. But, the design of python and the community has gone in the direction of preferring them over the functional language tradition of map/reduce/filter.
Apr
23
comment Why python function programming functions are not collection methods?
@Doval, see artima.com/weblogs/viewpost.jsp?thread=98196 for Guido's thoughts on reduce. He thinks that outside of a few trivial cases reduces are really hard to read and are better done as explicit for loops.
Apr
23
answered Why python function programming functions are not collection methods?
Apr
23
comment I've been told that Exceptions should only be used in exceptional cases. How do I know if my case is exceptional?
@supercat, fair enough, incorporating the exception logic in a loop context would be considerably more awkward.
Apr
22
comment I've been told that Exceptions should only be used in exceptional cases. How do I know if my case is exceptional?
@supercat, why? What is so bad about having to catch an exception that you'd risk silent failures instead of having to catch them? But I'll agree that in many cases the ideal is to have an exception-less alternative.
Apr
21
comment I've been told that Exceptions should only be used in exceptional cases. How do I know if my case is exceptional?
@supercat, I don't think it really matters which ends up being more common. I think the critical question is having a sane default. If I don't explicitly handle the error condition, does my code pretend nothing happened, or do I get a useful error message?
Apr
13
answered Is it OK to use Promises for Caching
Apr
13
comment Is it OK to use Promises for Caching
1) The time intensive function takes a callback, so I'd say its already taking care of the co-operation internally. 2) The code doesn't start the promise twice. 3) The data comes from the callback in the intensive code. No mystery there.
Mar
27
awarded  Good Answer
Mar
26
awarded  Nice Answer
Mar
26
answered Dynamic Code Evaluation in Java - Clever or Sloppy?