760 reputation
49
bio website
location Cologne, Germany
age
visits member for 3 years, 9 months
seen 13 hours ago

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.


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.
Dec
12
comment Is there something as a bug-free application?
@JanDvorak: basically, yes. And as I said, in an "ordinary" static-types language, this is not really sufficient to proove correctness. But in a dependently-typed language, you can in fact refine your types so they'll only match in a thoroughly correct program. ("Thoroughly", of course, again ignoring real-world runtime and similar dirt.)
Dec
12
comment Is there something as a bug-free application?
@Giorgio: dunno, but for sure similar loops can be found in lots of production applications.
Dec
12
comment Is there something as a bug-free application?
@Giorgio: the condition is "there is no new post on StackExchange I haven't processed yet".
Dec
12
comment Is there something as a bug-free application?
@JanDvorak: it's an official usage of the term "proven". You make some mathematical statement in form of a type signature, and then the implementation prooves that the statement was correct. Mind, those statements generally don't look much like function signatures as you would find in real-world programs.