770 reputation
49
bio website
location Cologne, Germany
age
visits member for 3 years, 11 months
seen May 20 at 16:35

Functional programming enthusiast, audio engineer & musician. Whilst not busy with any of that, I study physics at Universität zu Köln / Bonn-Cologne Graduate School.


May
19
comment How do you avoid getters and setters?
FTR, I think more “experts” still teach to meaninglessly create getters/setters for everything, than to never create any at all. IMO, the latter is less misguiding advice.
Apr
15
comment performance versus reusability
Modularity and optimisation are not necessarily at odds. Modern compilers can inline pretty much anything anywhere, so no matter how modular you write, as long as the compiler can stitch it together to a “non-modular executable”, there's no reason it couldn't be as fast as code that was written non-modular in the first place. Of course, not all compilers can do this very well, but...
Apr
2
comment Does path coverage guarantee finding all bugs?
@MatthewRead: if you apply this consequently, then the “error space” is a proper subspace of the space of all states. Of course it's hypothetical because even the “correct” states make up a far too large space to allow any exhaustive tests.
Apr
2
answered Does path coverage guarantee finding all bugs?
Mar
25
awarded  Nice Answer
Mar
24
answered Is there a reason to have a bottom type in a programming language?
Mar
10
comment Why aren't `void *`'s implicitly cast in C++?
Well, templates aren't really needed for such a complete safe type system: Hindley-Milner based languages get along without them quite well, without implicit conversions at all and no need to write out types explictly either. (Of course, these languages rely on type erasure / garbage collection / higher-kinded polymorphism, things which C++ rather avoids.)
Jan
22
awarded  Yearling
Jan
22
revised class in OOP language and type
added 89 characters in body
Jan
22
comment class in OOP language and type
...more importantly, my anwer does consider behaviour. Indeed behaviour is usually the reason why you use inheritance, and the unification of different possible behaviours precisely captures the sum-type aspect of OO classes.
Jan
22
comment class in OOP language and type
@ruakh: no. You can of course implement functions in OO, but in general, methods are not functions (because they modify state etc.). Nor are "functions" in procedural languages functions, for that matter. Indeed, single-static-method interfaces come closest to function/exponential-types, but I hoped to avoid the discussion of that because it has no relevance for this question.
Jan
22
revised class in OOP language and type
Typos in footnote
Jan
22
answered class in OOP language and type
Dec
31
comment What is different between the internal design of Java and C++ that lets C++ have multiple inheritance?
@MasonWheeler: well, surely nobody is going to choose a dynamic over a static language just because it supports multiple inheritance. But it's certainly a valid point to remark here that problems like Diamond can be better solved in dynamic languages (how true that is I'm not actually sure), whereas general flamewar about dynamic vs. static is hardly on topic here (question already has enough Java vs. C++ flamewar).
Dec
23
awarded  Pundit
Dec
22
comment Is every language written in C?
1970: Niklaus Wirth creates Pascal, a procedural language. Critics immediately denounce Pascal because it uses x := x + y syntax instead of the more familiar C-like x = x + y. This criticism happens in spite of the fact that C has not yet been invented...
Dec
20
comment Are all magic numbers created the same?
The ideal way to eliminate magic numbers is to make the literal itself unnecessary. In this case: store such sizes not in integer variables but in a type-system enforced variable of some physical-dimension type Information. In an OO language that would be a class with methods to output readings in specific prefix, or as a string with automatically-chosen prefix ("human-readable"). But the conversion by multiplication / division should never appear anywhere openly. (Admittedly, what I'm describing is still a bit of a utopia.)
Dec
20
comment Are all magic numbers created the same?
@LightnessRacesinOrbit: I could bet that somebody used #define BYTES_PER_MBYTE 1024*1024 somewhere, and later wondered why they got MBval ≡ byteVal...
Dec
12
comment Is there something as a bug-free application?
(Again, there are concepts like STM which allow some proofs even in concurrent systems, but that also has its limits – any setting in which you want to proove something needs a well-bounded scope; the actual physical world simply is not a well-defined mathematical setting.)
Dec
12
comment Is there something as a bug-free application?
@Giorgio: well, looping forever might be correct for some application. Then, of course, terminating would probably be a bug! Real-world applications have of course specifications, often somewhat "fuzzy" ones, but obviously some behaviours are just wrong. I'm not going to boil up some particular example here, but IMO the point is really obvious given the complexity of many real-time systems, in particular when concurrency is involved, and many parts depend on something to be ready at a given time. Such a system can break in all kinds of ways, simply because some function takes a bit too long.