Reputation
30,839
Next tag badge:
117/100 score
18/20 answers
Badges
3 51 122
Newest
 Nice Answer
Impact
~1.5m people reached

Feb
4
comment Is it possible to access protected members of an object from the function of an object whose type is derived from type of first object?
Yes, this is entirely possible (unless I've misread your intent).
Feb
1
comment Cons and Pros of ternary operator instead of if/else
Without specifying at least something in the way of circumstances or context, any "better" or "worse" seems to be purely opinion.
Jan
28
comment Should we avoid language features that C++ has but Java doesn't to increase maintainability?
@SebastianRedl: change "Java has features" to "Java has mistakes" (and likewise, "Java's other features" to "Java's other mistakes", "Java-exclusive features" to "Java-exclusive mistakes", etc.), and you're pretty close correcting things. :-)
Jan
28
comment Should we avoid language features that C++ has but Java doesn't to increase maintainability?
@supercat: OTOH, given the number of platforms that support Java but not C++, this strikes me as almost entirely a solution in search of a problem.
Jan
28
comment Should we avoid language features that C++ has but Java doesn't to increase maintainability?
Presumably where you say "may need", you really mean: "may not need"? Assuming so, then I'd tend to agree.
Jan
25
comment Should we avoid language features that C++ has but Java doesn't to increase maintainability?
If you want Java, use Java. If you use C++, use C++, not some horrible, twisted imitation of Java with C++ syntax. Using C++ but restricting yourself to Java's feature set gives you the worst of both worlds.
Jan
23
comment Why does integer division result in an integer?
@MasonWheeler: Yes, you make it clear that you're aware of its existence--but to all appearances fail to grasp its significance.
Jan
22
comment Why does integer division result in an integer?
@MasonWheeler: You do realize, don't you, that Pascal provides precisely the same operation, using an operator named div? Oh, and it was originally implemented on a Control Data mainframe that didn't provide an integer division instruction, so its inclusion in the language added work.
Jan
22
comment Why does integer division result in an integer?
@LightnessRacesinOrbit: Remember that old definition of insanity as being repeating the same action and expecting a different result? Believing that mere facts could change Mason's belief that every characteristic of C++ is the essence of wrongness, is clearly insane.
Jan
11
comment Isn't the use of NoSQL Databases impractical in a large number of use cases?
But MongoDB is Webscale! [warning: includes some NSFW language]
Jan
10
comment Is an AST enough to build any translator?
Regardless of the name used, nobody can enter new answers to it right now. Comments can be posted until/unless it's deleted.
Jan
10
comment Is an AST enough to build any translator?
@Harry: The question's been closed for ~15 hours already...
Jan
9
comment Is an AST enough to build any translator?
An AST can represent an arbitrary amount of information about the source file, up to an including "all of it". As such, the answer is clearly "yes". The only real question is how much of the information in the original source is needed to translate a particular language. Usually you preserve more than is strictly necessary for translation, to support producing better error messages.
Jan
9
comment How are objects stored in unordered_sets?
Yeah, probably worth mentioning that it's technically wrong.
Nov
19
comment JIT compiler for C, C++, and the likes
@user3125367: Yes, but in many cases the compiler does various type checking and such that might be bypassed if you load compiled code directly from the cache. Depends on the JIT, of course--Java does a lot of enforcement work when loading a (compiled) .class file, but many others do a lot less (nearly none, in many cases).
Nov
18
comment When is code “legacy”?
@VincePanuccio: My only answer is that you really need to read what I wrote.
Oct
2
comment When is it ok to use a Global variable
@B1KMusic: Then I'd guess somebody else would write something similar (or we'd start recommending others of the same sort that aren't quite as good).
Oct
1
comment When is it ok to use a Global variable
@B1KMusic: while the book in question may not be freely available, it 1) is dependably available, and 2) when a programmer starts asking this kind of question, he should get and read that book, regardless. This site isn't, and can't reasonably become, a substitute for the basic books on the subject. In any case, look at the date: back then, the prohibition against link-only answers basically didn't exist--back then, it was more like a suggestion or rule of thumb.
Jun
27
comment JIT compiler for C, C++, and the likes
@JohnMudd: I suspect the reasoning is security. E.g., modify the cached code, then the next time the VM starts, it executes code I put there instead of what it wrote there.
Apr
21
comment Do you ever read language specs?
The question specifically talks about knowing "all its dusty corners", which implied to me that it was about really studying the spec in a great deal of detail, not just reading some parts. At the same time, I doubt anybody fully understands the entirety of the C++ spec. It's too big and too complex.