Reputation
26,771
Next tag badge:
723/100 score
15/20 answers
Badges
8 62 110
Newest
 Good Answer
Impact
~695k people reached

Aug
26
awarded  Good Answer
Aug
4
awarded  Guru
Jul
8
awarded  Nice Answer
May
29
awarded  Great Answer
May
15
awarded  Nice Answer
May
8
awarded  Great Answer
Apr
23
comment Why have many programmers moved to using exception handling for input or output?
Obvious troll is obvious. en.wikipedia.org/wiki/Invariant_%28computer_science%29
Apr
17
awarded  Nice Answer
Mar
29
comment What kinds of Open-Source licenses are NOT OK to use internally in a corporation?
@Brandin: GPLv2 and GPLv3 have the same issues as AGPL. LGPL is often OK, depending on what kind of product you work on. Apache, MIT, and BSD are permissive. I don't think anyone other than Mozilla uses MPL. WTFPL doesn't explicitly let you do anything, relicensing is just one possible interpretation of the license. Believe me or don't, I don't care; I'm telling you how it is, most lawyers will tell you not to touch GPL and its offshoots with a 10-foot pole if you plan on doing any kind of commerce, related or not. Those licenses are specifically meant to "spread" open-source.
Mar
28
comment What kinds of Open-Source licenses are NOT OK to use internally in a corporation?
@hvd: It may shock you to know that corporate lawyers don't really care about things like "free" or "unfree". They care about "can we use this without getting sued?". Have you actually read the WTFPL? It tells you nothing. Read section 2 of the Apache License to see what a proper copyright clause looks like. The WTFPL neither explicitly grants a copyright license, nor does it make said license irrevocable. You don't need to read the FSF's evaluation - just look at the license yourself!
Mar
28
comment What kinds of Open-Source licenses are NOT OK to use internally in a corporation?
@hvd: You're citing a bunch of open-source software foundations as evidence here. My whole point is that these license agreements are generally fine for open-source software, but have a lot of problems when it comes to commercial purposes, even if the software is only "internal". One of the major issues with WTFPL is that it doesn't have a "no warranties" clause. To that, the authors respond "add your own", which doesn't address the issue at all. My source is actual corporate lawyers, both full-time and consultant. I neither need nor am inclined to search for an internet source.
Mar
28
comment What kinds of Open-Source licenses are NOT OK to use internally in a corporation?
Most companies simply won't touch "copyleft" licenses, and for good reason; it's borderline impossible to perfectly "quarantine" a system and ensure that nothing ever indirectly touches the GPL/AGPLed code. Some apparently "permissive" licenses like WTFPL are no help either, because they're too vague on important legal issues like copyright. Even if you think you could successfully defend against a lawsuit, do you really want to go through that? (Hint: Your lawyercats probably don't.) Stick to Apache and MIT. I think BSD is also OK.
Mar
28
comment What kinds of Open-Source licenses are NOT OK to use internally in a corporation?
Just be very careful about the meaning of the word "internal". Older open-source licenses, such as the original GPL, had loopholes that permitted its use as a "back-end" library or product. You could use a GPL database product to hold the content for a commercial web site. Newer licenses, such as the AGPL, are essentially "viral" - they apply to the entire network, and if you have a user-facing/commercial product that talks to some internal product using AGPL software, even in a trivial fashion, you would technically be in violation of the license unless you release all your source code.
Mar
21
comment When is it a good idea to force garbage collection?
@Neil: There's lots of code in the .NET Framework that's intended for (a) profiling and instrumentation, (b) library development, and (c) interop with unmanaged code. Any of these scenarios could potentially involve GC.Collect, although it is very rare even in those scenarios. People aren't saying never call it, they're saying if you have to ask when you should call it, then you should never call it. That's different. It's a bit like "you'll understand when you're older". If you ever really need GC.Collect, you'll know beyond a shadow of a doubt; if you don't know, don't call it.
Mar
19
awarded  Nice Answer
Mar
17
comment why is the latter function 10% faster although it must create the variables over and over again?
@amon: That might be how you'd ideally like it to work, but it's not how it actually works. People far more knowledgeable and experienced than I have written books about this; in particular I'd point you to High Performance JavaScript by Nicholas C. Zakas. Here's a snippet, and he also did a talk with benchmarks to back it up. Of course he's certainly not the only one, just the most well-known. JavaScript has lexical scoping, so closures actually really aren't that special - essentially, everything is a closure.
Mar
15
answered why is the latter function 10% faster although it must create the variables over and over again?
Mar
1
comment When NOT to apply Dependency Inversion?
@Kevin python was hardly the first language to possess either dynamic typing or loose mocks. It's also completely irrelevant. The question is not what an object's type is but how/where that object is created. When an object creates its own dependencies, you're forced into unit-testing what should be implementation details, by doing horrible things like stubbing out constructors of classes that the public API makes no mention of. And forgetting about testing, mixing behavior and object construction simply leads to tight coupling. Duck typing doesn't solve either of those problems.
Feb
28
comment When NOT to apply Dependency Inversion?
The DIP has absolutely nothing whatsoever to do with the type system. And in what way are "first-class types" unique to python? When you want to test something in isolation, you're supposed to substitute test doubles for its dependencies. Those test doubles can be alternate implementations of an interface (in statically-typed languages) or they can be anonymous objects or alternate types that happen to have the same methods/functions on them (duck typing). In both cases, you still need a way to actually substitute an instance.
Feb
28
comment When NOT to apply Dependency Inversion?
No? I do plenty of work in JavaScript and it still applies equally well there. The "O" and "I" in SOLID can get a little blurry, though.