Reputation
18,090
Top tag
Next privilege 20,000 Rep.
Access 'trusted user' tools
Badges
1 47 73
Newest
 Nice Answer
Impact
~310k people reached

Mar
27
answered What is ASM.js and what does it mean for everyone?
Mar
26
comment How does understanding computer architecture help a programmer?
@Volkanİlbeyli Programming in high level languages is just a means to an end. Many programmers who need to know this stuff for part of their job will also have use for some high level languages, if that was your question.
Mar
26
answered method to allow me ability to freely modify my classes, but make them immutable to others?
Mar
23
comment In C++ why and how are virtual functions slower?
@James You have a point. What I tried to say is: Any indirection has the same problems, it's nothing specific to virtual.
Mar
23
revised In C++ why and how are virtual functions slower?
added 1681 characters in body
Mar
23
comment In C++ why and how are virtual functions slower?
@JörgWMittag ... C++ guys aren't very interested in those optimizations because they're in a very different situation: The AOT-compiled vtable way is already pretty fast, very few calls are actually virtual, many cases of polymorphism are early-bound (via templates) and hence amendable to AOT optimization. Finally, doing these optimizations adaptively (instead of just speculating at compile time) requires run-time code generation, which introduces tons of headache. JIT compilers have already solved those problems for other reasons, so they don't mind, but AOT compilers want to avoid it.
Mar
23
awarded  Nice Answer
Mar
23
comment In C++ why and how are virtual functions slower?
@JörgWMittag These optimizations primarily exist to make indirection/late binding (almost) free when it isn't needed, because in those languages every call is technically late-bound. If you really do call lots of different virtual methods from one place over a short time, these optimizations don't help or actively hurt (create lots of code for naught). C++ guys aren't very interested in those optimizations because they're in a very different situation ...
Mar
23
comment In C++ why and how are virtual functions slower?
@vasile Nonsense, everything he mentioned is JIT compiler technology, and could be applied to AOT compilers with some effort (worth a paper, but not nearly as hard as inventing it in the first place). While many JIT compilers are married to an interpreter, this is only an optimization (for performance, and sometimes for simplicity). A prominent JIT compiler that features nothing resembling an interpreter whatsoever is V8, it always compiles straight to machine code.
Mar
22
comment In C++ why and how are virtual functions slower?
@ChristopherCreutzig Ironically, such switch statements might very well be significantly slower than virtual calls. It pays to think and understand...
Mar
22
answered In C++ why and how are virtual functions slower?
Mar
21
comment Why is Java boolean primitive type name not 'bool'?
So you're saying int should be integer?
Mar
20
comment How to maintain synchronised state across threads - is this a good use for a Singleton?
@glenatron You don't. The whole point is allowing (or rather, not explicitly prohibiting!) several completely independent instances. When you need multiple places (e.g. server threads) to get unique and sequential IDs w.r.t. to each other, you give them the same instance.
Mar
20
answered How to maintain synchronised state across threads - is this a good use for a Singleton?
Mar
19
comment upgrading to newer version of compiler
Testing, testing, testing.
Mar
17
comment Why Java does not support private/protected inheritance like C++?
One doesn't need a reason to omit a feature, one needs a reason (ideally, several good ones) to add it.
Mar
13
comment Would Python be too slow for client-side use in Browsers?
@TMN What Daniel B said, and also gzip should reduce the difference. Oh, and Python doesn't need most of those new lines and spaces. Many (though not all) lines can be joined together just fine in Python, e.g. a = something(); frobincate(a); return quux and if condition: react() are single line each. And n indentation levels needs only n spaces, not n * 4 spaces.
Mar
12
comment How do I handle having so many SQL queries?
Even with an ORM, you still need the moral equivalent to queries (e.g. a bunch of LINQ operations), and they're not necessarily simpler. Better than embedding SQL in strings in the source code, but as the logic doesn't magically become non-trivial, it's still important where you put them. In that sense, you don't really answer the question.
Mar
12
comment Would Python be too slow for client-side use in Browsers?
@Profpatsch From the state of it last time I looked at, it doesn't even implement very large parts of the Python language. Conveniently, among the unimplemented features are those that are hard implement well atop of JavaScript. To paraphrase one of the PyPy authors: It's easy to make a nontrivial subset of Python fast, full Python is where it becomes hard.
Mar
12
comment What's the next level of abstraction?
@Giorgio (Arguably) True, yes, but neither really relevant here nor contrary to anything that has been said, so I don't get why you stress the point so much.