419 reputation
28
bio website sharp-gamedev.blogger.com
location Stockholm, Sweden
age 36
visits member for 3 years, 10 months
seen Nov 21 '12 at 12:03
The programmer formerly known as Joh. Joh used to think C++ was the greatest language on Earth, but he has now found the light in .net thanks to F#. Joh loved Linux and seldom used his installation of Windows. Due to his recent discovery and F#, he is now spending all of his computer time on Windows. He is not quite sure if this is a good thing or not.

Jul
11
comment Is it worth making a commit solely to resolve non-critical typos?
Checking with your team leader for a typo fix? If I was the team leader who's stressed up with the upcoming release, I wouldn't want to be disturbed with such trivialities.
Apr
28
comment When to stop inheritance?
@DeadMG: I've edited my answer to clarify that. I persist in thinking that calls to virtual methods in this situation is a no-go, if performance matters.
Apr
18
comment When to stop inheritance?
If you don't need extensibility, an approach based on switch/enum is preferable because it's faster than a virtual method dispatch. A chess engine is CPU-heavy, and the operations that are done most often (and therefore efficiency critical) are performing moves and undoing them. Just one level above that comes listing all possible moves. I expect this will also be time critical. The fact is, I have programmed chess engines in C. Even without OOP, low-level optimizations on the board representation were significant. What kind of experience do you have to dismiss mine?
Apr
18
comment When to stop inheritance?
@WeekendWarrior inheritance is OOP. If OOP isn't advisable, neither is inheritance.
Nov
29
comment Should one comment differently in functional languages?
The use of "you" in the answer is ambiguous. I think you meant "what it (the function) is doing", "how it does it". The third point seems OK, I interpret it as "why it's needed".
Nov
17
comment Is there a name for “More events than expected” bug?
Nevertheless, the concept seems applicable to GUIs. After all, the term "bug" initially applied to hardware-related issues, but was transposed to software. You can criticize the author for not providing a definitive answer, but it's still an interesting remark, IMO.
Nov
7
comment OO best practices for C programs
Great answer. Aim for modularity. OO is supposed to provide it, but 1) in practice it's all too common to end up with OO spaghetti and 2) it's not the only way. For some examples in real life, look at the linux kernel (C-style modularity) and projects which use glib (C-style OO). I've had the occasion to work with both styles, and IMO C-style modularity wins.
Oct
7
comment How to fit beta versions into a numeric versioning scheme?
How do I know if 1.0.0.123 is the first, second... beta before 1.0.1.0? Moreover how do I distinguish between a bugfix release 1.0.1.1 and a beta of 1.0.2.0 ?
Oct
7
comment How to fit beta versions into a numeric versioning scheme?
What disturbs me a bit is that what we call "1.3 beta 2" is the 2nd beta that precedes 1.3. With your numbering scheme, it would be called "1.2.1.2". If I use "1.3.0.2" instead, I get the weird effect that "1.3.0.2" is before the final "1.3.0.0".
Oct
7
comment How to fit beta versions into a numeric versioning scheme?
In your example, does the beta release 1.2.1.1 follow the normal release 1.2.1.0 or precede it?
Sep
26
comment Has there been any formal work comparing ease of maintenance at the programming language level?
I found the paper again: citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.20.2141
Sep
17
comment Why don't many code review tools seem to be syntax aware or provide more in-depth analysis of changes?
I definitely think there is a market for tools that work at the level of the abstract syntax tree, e.g. code manipulation, highlighting changes... The skills needed to write parsers and understand the underlying structure of code may have been lacking, but it seems the advent of intellisense and refactoring tools in mainstream IDEs have changed that.
Sep
17
comment Has there been any formal work comparing ease of maintenance at the programming language level?
I saw a link on reddit earlier this summer pointing to a paper showing that of all complexity measures, the one that had the strongest correlation to the number of bugs was lines of code. Other more complex measures were not good indicators of number of bugs. A shame I can't find the paper again, but I'll keep looking.
Sep
17
comment Why is DRY important?
@Incognito: I have edited my answer. No concrete example, but hopefully what I meant is clear enough.
Sep
17
comment *Code owner* system: is it an efficient way?
"it encourages badly documented hard to understand code as only the coder who wrote it is responsible for maintaining it". It depends on the type of programmer. If my name is attached to some code, I want that code to have really high quality. If I don't own it, I tend to do limit myself to minimal changes which when accumulated over time can affect code quality negatively. When an entire team works that way, it can also go horribly wrong.
Sep
17
comment *Code owner* system: is it an efficient way?
@Matthieu M.: Indeed. I agree that the stricter interpretation of ownership where changes by non-owners are forbidden is harmful.
Sep
14
comment *Code owner* system: is it an efficient way?
@Matthieu M.: If you own the code, you are responsible for it. Reversely, if you don't own the code, you can't be held responsible for it. It seems to me the two concepts are identical. The danger with code ownership is if people never work outside of their area of responsibility. That's the awful idea. Not ownership in itself.
Sep
14
comment *Code owner* system: is it an efficient way?
"awful idea" is too strong. The Linux kernel uses that model and it seems it has worked well.
Jul
27
comment Are abstract classes / methods obsolete?
@Scott Whitlock: Your example using apples and fruits is a bit too detached from reality to judge whether going for inheritance is preferable to delegates in general. Obviously, the answer is "it depends", so it leaves plenty of room for debates... Anyway, I find that template methods occur a lot during refactoring, e.g. when removing duplicate code. In such cases, I usually don't want to mess with the type hierarchy, and I prefer to stay away from inheritance. This kind of surgery is easier to do with lambdas.
Jul
25
comment Are abstract classes / methods obsolete?
-1. I don't understand what "generic code vs inheritance" has to do with the question. You should illustrate or justify why "abstract classes have significant advantages over interfaces".