Reputation
17,760
Top tag
Next privilege 20,000 Rep.
Access 'trusted user' tools
Badges
1 47 70
Newest
 Nice Answer
Impact
~287k people reached

Jan
21
comment Why does integer division result in an integer?
There are several problems with this line of argumentation. First, float arithmetic is also "incorrect" in this sense. Second, many languages that don't have to maintain compatibility with C also haveinteger division. The most radical example is Python 3 (one might argue that Python was originally influenced by C, but version 3.x was definitely not). It did change the / operator to return a float, but at the same time introduced a new operator (//) specifically for integer division. So this operation seems to be useful, regardless of what the CPU does.
Jan
16
comment How useful is C's “true” sizing of variables?
@ThomasOltmann You seem very confused. It's not a pointer to an object that carries a vtable pointer, it's the object itself. I.e., T * is always the same size and the T may contain a hidden field that points to the vtable. And no C++ compiler ever inserted vtables into objects that don't need them.
Jan
16
comment How useful is C's “true” sizing of variables?
@ThomasOltmann Every object that has virtual methods needs a vtable pointer. You can't have the functionality virtual methods without that. Moreover, you explicitly opt into having virtual methods (and hence, a vtable).
Jan
16
comment How useful is C's “true” sizing of variables?
@lxrec RTTI is stored in the vtable, and objects only store a pointer to the vtable. Additionally, types only have RTTI if they already have a vtable because they have a virtual member function. So RTTI never increases the size of any objects, it only makes the binary larger by a constant.
Jan
16
awarded  Enlightened
Jan
16
awarded  Nice Answer
Jan
16
revised Git Bisect found the buggy commit. Now what?
deleted 2 characters in body
Jan
16
answered Git Bisect found the buggy commit. Now what?
Jan
14
comment JIT based on precompiled code templates
@jdm Not making them functions raises other problems though. For one, how do you ensure the code snippet can be used in all places where you want to use them? For example, the snippet needs to read and write local variables, but in many bytecode VMs you need the right register number/stack offset to access locals, and these will vary at each use site. As for directly using JIT compilers: This still has significant engineering challenges. For example, PyPy can't cache its traces to the disk because the traces directly embed many pointers that are only valid for the current process.
Jan
13
comment JIT based on precompiled code templates
I don't see what any of this has to do with the question.
Jan
13
answered JIT based on precompiled code templates
Jan
9
comment Is it odd if Nodes in a LinkedList held references to the List object?
Obviously it makes each node one pointer larger. On the other hand, if you're using a (non-intrusive) linked list you probably don't care about memory or cache or efficiency anyway. (I'm joking. Well, half-joking.)
Jan
6
comment What are the complexities of memory-unmanaged programming?
Funny that you point to Mozilla's bug tracker at one point, because Mozilla has come to a quite different conclusion. Firefox had and continues to have countless security issues coming from memory management mistakes. Note that this is not about how easy it was to fix the error once detected --- usually the damage is already done by the time the developers become aware of the issue. Mozilla is funding the Rust programming language precisely to help prevent such errors from being introduced in the first place.
Dec
27
comment Python's join seems to focus not on the items to join, but on the symbol, as compared to Ruby or Smalltalk, for a design reason?
And even today Python is not even trying to be an OOP language, it's thoroughly multi-paradigm.
Dec
27
comment Python's join seems to focus not on the items to join, but on the symbol, as compared to Ruby or Smalltalk, for a design reason?
OP sort of tries to address this with the module Enumerate section but Python does not work that way, there is no single superclass for all iterators where you could put this method.
Dec
26
comment Should the Vector type inherit from the Array type in an environment where both are first-class objects
@OnTheGoBro I know C++. The presence of these C++ features in a "language that is based on Java" is one of the things that surprises me so much. Explicit references and implementing arrays as just another class shouts "manual memory management", which is in itself very strange in this day and age, and other aspects of your question indicate GC.
Dec
26
comment Should the Vector type inherit from the Array type in an environment where both are first-class objects
As for the question, can you articulate why one should inherit from the other? Why can't they both just implement appropriate interfaces?
Dec
26
comment Should the Vector type inherit from the Array type in an environment where both are first-class objects
I understand that you probably want to keep the rest of the language out of this question, but while reading I had so many WTF moments that I can't help but ask: What is this language calls, and are its semantics and design decisions documented somewhere?.
Dec
23
comment At what point is it taboo to have loops within loops?
@Alternatex That you need 4 loops does not mean they have to be lexically nested. It is quite obvious from the quote that we're talking about how to organize the code, not about the execution.
Dec
23
comment At what point is it taboo to have loops within loops?
Linus is probably not (only) joking in that section, but note that this is only one style guide, and the same style guide stresses that "Kernel coding style is super simple", i.e. more so than other styles.