Reputation
9,679
Top tag
Next privilege 10,000 Rep.
Access moderator tools
Badges
2 41 59
Newest
 Nice Answer
Impact
~799k people reached

Apr
23
awarded  Nice Answer
Mar
31
comment Should I check for software on a users machine via a web browser?
“How do sites verify you have certain things then?” — They don’t. Do you have an example of this happening? For instance, what exactly is Nvidia checking for?
Feb
29
comment Difference between hash and dictionary
@runrig “About the only reason to use a hash function is to build a hash table to map values” — No. And even if — they’d still be two different things. If you dislike dict and map then you’re really not in any position to argue for the much less accurate hash.
Feb
27
comment Difference between hash and dictionary
@runrig I’m sorry but that’s nonsense. You have to balance concerns, and hash clearly doesn’t do that. If you want to have a short word, use dict or map. hash almost universally refers to a hash function (or its result). It’s definitely a poor name for a data structure.
Nov
19
awarded  Guru
Nov
17
comment Difference between hash and dictionary
@nawfal There’s a difference between everyday usage of a term and technical jargon. In computer science jargon, this is simply unambiguous: dictionary does not indicate order. “Map” is broadly a synonym of this, although the term “map” also has other meanings in computer science which, to make matters worse, overlap to some extent. So using “map” always carries the risk of confusion.
Nov
2
comment Is there any reason to use C++ instead of C, Perl, Python, etc.?
@martinkunev If you don’t think it’s a strong enough reason then you probably work in a domain where that’s true. If, however, you work in a domain where a strong and finely tuned algorithms library is necessary, believe me, this is a good enough reason — I work in bioinformatics, and it’s crucial here.
Oct
31
comment Is there any reason to use C++ instead of C, Perl, Python, etc.?
@martinkunev I agree with some things you’ve said, except that it simply doesn’t apply here. Every function call obviously represents an abstraction, and leaky abstractions are fundamentally unavoidable. Regarding sort, I’ve encountered situations where the difference was non-negligible, and your suggestion to write your own general-purpose sort function is utterly impractical: writing a fine-tuned sort is really, really hard. You don’t do this. You use a proven implementation. — And yes, std::list is terrible. But the standard library algorithms aren’t.
Oct
3
awarded  Nice Answer
Oct
2
comment Should I use the new C++11 'auto' feature, especially in loops?
@Ptolemy I entirely agree. The only thing I disagree with its that I think auto improves clarity (in most cases) and helps making code simpler and more obviously correct. I'm not against explicit type annotations in general, incidentally (on the contrary). But in function local context I've rarely found them helpful.
Oct
2
comment Should I use the new C++11 'auto' feature, especially in loops?
@Ptolemy You're admitting that you're working on code that you don't fully understand. That is the real problem, not the use of auto.
Oct
2
comment Should I use the new C++11 'auto' feature, especially in loops?
@Ptolemy That is only true if you are in the highly convoluted situation that you don’t know what begin returns but you do know what std::vector<>::iterator is. And you need to use a bad programming tool that cannot give you this information trivially. This is highly convoluted. In reality, you either know both begin and iterator or neither, and you should be using an IDE or editor that can readily make the relevant information available to you. Every modern IDE and programming editor can do that.
Oct
2
comment Should I use the new C++11 'auto' feature, especially in loops?
@Ptolemy All these arguments are just as true when using auto. It’s trivial to see what operations x supports from context. In fact, the type gives you no additional information: in either case you need some secondary (IDE , documentation, knowledge/memory) to tell you the set of supported operations.
Oct
2
comment Should I use the new C++11 'auto' feature, especially in loops?
@Ptolemy And my point is: in the other two codes you also don’t know (generally) what to put next: T is as opaque to the user as auto. Yet one is supposed to be fine and the other not?! That doesn’t make sense. In the case of OP, T is a stand-in for an arbitrary type. In real code, it may be the use of templates (for typename std::vector<T>::iterator…) or a class interface. In both cases, the actual type is hidden from the user, and yet we routinely write such code without issues.
Sep
18
comment Why would it ever be possible for Java to be faster than C++?
It’s a moot point. Do you need the functionality? Then you write the code, and it doesn’t matter one lick whether you use methods or operators. Neither will be more efficient. Deadlines are really, really irrelevant for that. And to maintain/debug the code, I’d prefer the code using operators a thousand times over that using methods. And so do most other developers, considering that even Java gurus (e.g. Josh Bloch) consider the lack of operator overloading a major flaw in the language.
Sep
17
awarded  Yearling
Sep
13
awarded  Nice Answer
Aug
21
comment What did Bjarne Stroustrup mean by his characterization of C and C++?
@PravasiMeet As I’ve written: “by removing the need for … pointers in most situations”.
Jul
12
awarded  Good Answer
Jun
22
awarded  Notable Question