Reputation
5,532
Top tag
Next privilege 10,000 Rep.
Access moderator tools
Badges
9 26
Newest
 Nice Answer
Impact
~215k people reached

Apr
13
comment Should an audit user column be nullable?
This looks like bad security. Ephemeral data which hardly needs protection (TotalViews) side by side with business-critical data (ArticleId)? Any user obviously should be able to change the view count but not the ID.
Apr
12
comment Why does everyone use Git in a centralized manner?
@Wildcard: Merging is no problem at all with trees, why would that be the case? You can't merge between random nodes, of course, just between parent/child.
Apr
11
answered Why does everyone use Git in a centralized manner?
Apr
5
comment Can a programming language by design enforce “clean code”?
@Jules: Sure, Turing completeness includes the ability to compute a particular result, but it is provable that in any Turing-complete language there's never just one way to compute a particular result. In fact, in any Turing-complete language there are an infinite number of ways to do so. And most of them aren't clean by any reasonable definition of clean.
Apr
4
comment Can a programming language by design enforce “clean code”?
Nope, this is not subjective. This is because you can simulate any non-clean language in any Turing-complete language. So, either you deny the existence of non-clean languages (which makes the question trivially irrelevant) or you claim that any Turing-complete language is unclean by definition.
Mar
31
comment Floating point accuracy and conversions
The x87 extended precision format (there are others - IBM uses 128 bits) isn't a power-of-two length, but it's a 16 + 64 bit format. This is no coincidence, the 64 bit significand lends itself to convenient integer operations using 64 bit registers. The next logical size would be 32+64, and there's just not enough reason to have numbers as big as 1.0E+357913941 (!)
Mar
29
comment Should we “balance” the amount of codes between headers and cpp?
@BasileStarynkevitch: My point there wasn't about an actual implementation, I was taking the ISO perspective. From their perspective, #include <vector> does one thing, and that's adding vector to the symbol table of namespace std. This can be extremely fast as the user isn't allowed to specialize it. What mroe should ISO do to make life easy for the toolchain implementors?
Mar
29
comment Should we “balance” the amount of codes between headers and cpp?
@gbjbaanb: It's the ISO C++ committee, literally a global organization. It is onl;y to be expected that their meetings are on average thousands of kilometers away. If you want to campaign for an ABI, don't start with Bjarne but with Microsoft. But note that your argument is a bit weak. There is no fundamental reason why vector has to be 10K lines. it could be one line, __magic vector, and still be conformant.
Mar
29
comment Should we “balance” the amount of codes between headers and cpp?
The "bonus" is actually mandatory and not an advantage. The One Definition Rule requires that functions are defined once, unless defined inline. As headers are usually included more than once, any definition there would violate the ODR if not inline. As for actual inlining, that doesn't require they keyword inline.
Mar
21
answered How is it possible to log a user into a system with billions of similar data without delay?
Mar
21
comment How is it possible to log a user into a system with billions of similar data without delay?
And there are plenty of obvious improvements. Just keeping 26*26 dictionaries for aa to zz will help a lot - it cuts out the first 10 searches or so. (The logic being that this first-level search structure will remain in CPU cache, the 1/3 saving isn't really that worthwhile by itself)
Mar
21
comment How is it possible to log a user into a system with billions of similar data without delay?
Around the turn of the century, I wrote a phone database on CD. Let me tell you, finding a match in a second is a challenge when the disk seek times is measured in hundreds of milliseconds.
Mar
21
comment Why do you have to specify the data type when declaring variables?
@ZevSpitz: Indeed. The type of x dynamically changes from number to string to date. You could even have x = (rand() ==0) ? "string" : 5 and then the type of x will be random (!)
Mar
21
comment Why do you have to specify the data type when declaring variables?
@ZevSpitz: The first kind of system isn't dynamically typed, but not typed at all. Your Javascript example isn't dynamically typed, precisely because the Number type cannot change. In a dynamically typed language, x = ""; changes the type of x to string, even if it was a number previously.
Mar
21
comment How does the C++ standards committee test their design ideas?
@JDługosz: No, it very much wasn't. The real export allowed far more complex instantiations, where you'd recursively instantiate across translation units. That's not just theory, I actually tested this with the EDG compiler in 2002 or so.
Mar
20
comment Why do you have to specify the data type when declaring variables?
The var name = "Ali" style is actually common for modern statically typed languages. In statically typed languages, the type is fixed at creation, but it still can be determined by the initializer. The definition of a dynamically typed language is that types attach to values, not variables. Assigning a value to a variable therefore sets the variables's type as well.
Mar
20
comment How does the C++ standards committee test their design ideas?
Boost acts as the prototype for a large number of library improvements. E.g. boost::shared_ptr => std::shared_ptr.
Mar
16
comment If my IDE is so smart, why do I need to cast “clone()”?
Modern IDE's need a compiler anyway. Code completion hints require that the code before the cursor is parsed. And certainly with generics (or C++ templates) that requires a full compiler, not just a parser.
Mar
6
awarded  Nice Answer
Mar
3
comment Why are eval-like features considered evil, in contrast to other possibly harmful features?
@Telastyn: Which a Javascript program can't do. Or even a C++ program. Javascript runs inside a sandbox (browser) which is itself in another sandbox (ring 3 in x86 speak). The interrupt vector is outside that sandbox, under OS control. And that outer sandbox, ring 3, is CPU-enforced.