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

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.
Dec
12
awarded  Good Answer
Dec
10
awarded  Nice Answer
Dec
6
revised What is ASM.js and what does it mean for everyone?
edited body
Dec
6
revised Why is behavorial subtyping undecidable?
deleted 43 characters in body
Dec
5
awarded  Nice Answer
Dec
5
answered Why is behavorial subtyping undecidable?
Nov
25
comment How harmful is using switch(true) as a way to handle multiple conditional statements?
Why why why would you do this? How is it better than if (iAmAmazing()) { ... } else if (isVariable) { ... } else if (areYouShourt()) { ... } else if ...?
Nov
21
comment Low cost exceptions implementation using metaprogramming
@ddriver About the cost of checking after every function call: While a branch is usually faster than a cache miss, it's still non-trivial, especially if mispredicted. As the branch predictor has only limited capacity, in big programs these checks will take away prediction resources that could instead be used to predict the check the actual program makes. Also, it's more code (especially if you duplicate all functions) which takes more icache space which also hurts performance.
Nov
15
comment Why aren't data structures like BSTs part of the core libraries of more languages?
JavaScript has a famously minimal "standard library", and for a long time wasn't really used for nontrivial algorithmic stuff. Therefore it's not a very instructive example. Java for examples has various trees in its standard library. C++ has std::map and std::set.
Nov
4
awarded  Yearling
Oct
19
comment Is `isNaN`' a bad design or a has-to-be design with tradeoffs?
Nitpick: Division by 0 generally results in +/- infinity. Operations that produce NaN include 0/0 and sqrt(negativeNumber).
Oct
17
comment Gödel's Incompleteness Theorem and Algorithms
@Giorgio There is a relationship but it is very subtle. Too subtle to do it justice in one comment, and I'm not going to write a whole answer that's off-topic and probably wastes on the OP who doesn't seem to have a good grasp of either computability or logic.
Oct
17
comment Gödel's Incompleteness Theorem and Algorithms
In an fixed NP problem, the time to check the solution is bounded above by some fixed polynomial T. Therefore the size of any solution to an instance of this NP problem is also bounded above by a fixed polynomial S. Therefore, for any given input of size n, the space of possible solutions is always finite (roughly 2^S(n) solutions) and can be searched exhaustively. All NP problems are decidable.
Oct
4
comment Is there a specific reason for the poor readability of regular expression syntax design?
@ChrisBordeman That is not what I meant. Groups allow you to name matches, what would be needed for making complex regexes readable would be naming parts of the regex, so that e.g. you could define e-mail address regex as (made up syntax) ${name}@${domain}.