Reputation
762
Top tag
Next privilege 1,000 Rep.
See votes, expandable usercard
Badges
4 10
Newest
 Informed
Impact
~18k people reached

Jun
9
comment What is the “type” of data that pointers hold in the C language?
You can depend on the conversion to work, but the mapping between integers and pointers is implementation-defined. (The sole exception is 0 -> null, and even that is only specified if the 0 is a constant IIRC.)
May
27
comment Is there any “real” reason multiple inheritance is hated?
COM solved the problem by letting you ask the object itself for an interface that lets you manipulate it in a chosen manner. That "interface" may in fact be a full-fledged class, but you intentionally don't know or care about that. As for a "reference to anything" type, no, it's actually rather useless since generics. But you can have such a baseline type even with MI.
May
27
comment Is there any “real” reason multiple inheritance is hated?
Casting in itself is just another hack to make strict static typing palatable. So i don't particularly care whether a cast is "identity preserving", because it's something that really ought to be avoided anyway. But the problem of switching from one type to another was already largely solved by the likes of COM, so there's no reason .net couldn't have done it as well. It already had to be done in order to make interfaces work in the first place.
May
27
comment Is there any “real” reason multiple inheritance is hated?
And that is exactly Foo must resolve the ambiguity between Moo::Zoo and Goo::Zoo: it's the only class capable of doing so. If there's no way to do that, then inheritance is not the right relationship. MI is less creating the problem than highlighting it as an actual problem.
May
26
comment Is there any “real” reason multiple inheritance is hated?
There's no inherent requirement in MI that classes not call base methods, and no particular reason one would be needed. It seems a bit odd to blame MI, considering that problem also affects SI.
May
26
comment Is there any “real” reason multiple inheritance is hated?
The problems with MI are easily solved or avoided altogether using the same techniques you'd use with single inheritance. None of the abilities/axioms you've mentioned is inherently hampered by MI except for the second one...and if you're inheriting from two classes that provide different behaviors for the same method, it's on you to resolve that ambiguity anyway. But if you find yourself having to do that, you're probably already misusing inheritance.
Feb
9
comment Why is instance creation the way it is?
...which wouldn't be a problem if naming conventions weren't as they are. Class is a perfectly valid identifier.
Feb
4
comment Is a 1 < 10 comparison less expensive than 1 < 1000000?
@supercat: CSS z-indexes only have meaning relative to each other. If you're comparing them against hard-coded values, you're doing it wrong. :P
Feb
4
comment Is a 1 < 10 comparison less expensive than 1 < 1000000?
@Falco: In that case, immediates wouldn't even factor in; loading and comparing against a register seems pretty much inevitable.
Feb
3
comment Is a 1 < 10 comparison less expensive than 1 < 1000000?
@LưuVĩnhPhúc: A register can be loaded before the loop. At that point, the actual comparison will be the same number of instructions in either case.
Jan
21
revised class in OOP language and type
added 108 characters in body
Jan
21
revised class in OOP language and type
added 108 characters in body
Jan
21
revised class in OOP language and type
added 108 characters in body
Jan
21
revised class in OOP language and type
deleted 168 characters in body
Jan
21
answered class in OOP language and type
Jan
13
comment What does SVN do better than Git?
I love how "you can fiddle around with history" is allegedly a feature. I'd consider it a bug if it weren't intentional.
Jan
12
comment How do I avoid cascading refactorings?
If you're truly refactoring, though, other code shouldn't have to concern itself with the changes right away. (Of course you'll eventually want to clean up the other parts...but that shouldn't be immediately required.) A change that "cascades" through the rest of the app, is bigger than refactoring -- at that point it's basically a redesign or rewrite.
Jan
8
comment Why would a program require a specific minimum number of CPU cores?
Linux has /proc/cpuinfo and sysconf(_SC_NPROCESSORS_ONLN) (the latter being mentioned in POSIX). Using the info to enforce a minimum performance threshold is still pretty bad form, though.
Dec
16
comment How would you design a programming language?
OOP's failure, frankly, is that hardly any "object oriented" language actually implements it. Most simply shoehorn an object model into a procedural language and call it a day. I do wish Smalltalk had caught on more itself, rather than prompting every procedural-language weenie to say "Eh, we can do something kinda-sorta-maybe like that" and manage to miss the point of OOP entirely.
Dec
2
comment Why aren't there code overviews for open-source projects?
For what it's worth, i've seen enough profiteering off of shoddy documentation to at least wonder whether it's intentional. When the same groups putting half-assed documentation online are more than happy to sell you a book or a training class, it doesn't take much cynicism at all to reach that conclusion.