Reputation
945
Next privilege 1,000 Rep.
See votes, expandable usercard
Badges
7 14
Newest
 Nice Answer
Impact
~337k people reached

Oct
4
comment What functionality does dynamic typing allow?
@WarrenP: You assert that "dynamic type systems reduce the amount of extra cruft I have to type in" -- but then you compare Python to C++. That isn't a fair comparison: of course C++ is more verbose than Python, but that's not because of the difference in their type systems, it's because of the difference in their grammars. If you just want to reduce the number of characters in your program source, learn J or APL: I guarantee they'll be shorter. A more fair comparison would be to compare Python to Haskell. (For the record: I love Python and prefer it over C++, but I like Haskell even more.)
Oct
4
comment What functionality does dynamic typing allow?
@CzarekTomczak: That is a feature of some dynamically-typed languages, yes. But it is possible for a statically-typed language to be modifiable at runtime. For example, Visual Studio allows you to rewrite C# code while you're at a breakpoint in the debugger, and even rewind the instruction pointer to re-run your code with new changes. As I quoted Chris Smith in my other comment: "Many programmers have used very poor statically typed languages" -- don't judge all statically typed languages by the ones you know.
Oct
4
comment What functionality does dynamic typing allow?
@Justin984: I'm glad you enjoyed the article -- it changed how I think about static vs. dynamic typing too. But my comment wasn't really directed at answering your question, just helping to frame it. If you feel the article answers your question, why not add it as an answer yourself? That way you can explain what you think the answer to your question is, and you can mark it as accepted.
Oct
3
awarded  Pundit
Oct
3
comment What functionality does dynamic typing allow?
As Chris Smith writes in his excellent essay What to know before debating type systems: "The problem, in this case, is that most programmers have limited experience, and haven't tried a lot of languages. For context, here, six or seven doesn't count as "a lot." ... Two interesting consequences of this are: (1) Many programmers have used very poor statically typed languages. (2) Many programmers have used dynamically typed languages very poorly."
Oct
3
comment What functionality does dynamic typing allow?
@RobertHarvey: When I was writing a lot of C# code, I used LINQPad as basically a REPL for C#, which allowed me to write code in a more dynamic-ish workflow.
Sep
6
comment Getting out of my head
Related to the "rules" based approach, running static analysis tools (e.g. lint for C, JsLint for JavaScript, Findbugs for Java, FxCop for .NET) can often give useful hints, and code metrics (e.g. cyclomatic complexity, LCOM4) can show you what parts of the code may be problematic. Of course, you should always use your brain and take the advice of such tools with a grain of salt.
Aug
3
comment What backs up the claim that C++ can be faster than a JVM or CLR with JIT?
+1 -- overall, this is a good answer. However, I'm not sure the "there is no stack allocation" bullet point is entirely accurate. Java JITs often do escape analysis to allow for stack allocation where possible -- perhaps what you should say is that the Java language doesn't allow the programmer to decide when an object is stack-allocated versus heap-allocated. Additionally, if a generational garbage collector (which all modern JVMs use) is in use, "heap allocation" means a completely different thing (with completely different performance characteristics) than it does in a C++ environment.
Jul
26
awarded  Good Answer
Jul
25
awarded  Nice Answer
Jul
25
answered Are unit tests really that useful?
Jul
24
comment Pair Programming and ISO 27001
+1, this is what is done at my company. We have the choice of peer code review or pair programming. The pair programming case is just a special case of peer review, where the peer has been reviewing continuously while the code was written.
Jul
9
comment Unit testing time-bound code
Note that Guava has the Ticker class for just this purpose.
Jun
11
awarded  Citizen Patrol
May
25
comment When using method chaining, do I reuse the object or create one?
Hmm... I've always called the final method of the builder pattern build() (or Build()), not the name of the type it builds (Car() in your example). Also, if Car is a truly immutable object (e.g., all its fields are readonly), then even the builder won't be able to mutate it, so the Build() method becomes responsible for constructing the new instance. One way to do this is to have Car have only a single constructor, which takes a Builder as its argument; then the Build() method can just return new Car(this);.
May
24
revised What is the name for a NON-self-calling function?
Expanded answer in response to clarification of question
May
24
awarded  Nice Answer
May
24
comment What is the name for a NON-self-calling function?
Wow, great minds think alike...
May
24
answered What is the name for a NON-self-calling function?
May
24
comment Dependency injection: How to sell it
Possibly relevant to this discussion is Uncle Bob's article Dependency Injection Inversion.