Reputation
4,448
Top tag
Next privilege 5,000 Rep.
Approve tag wiki edits
Badges
5 23 43
Newest
 Curious
Impact
~252k people reached

Apr
16
comment I don't understand the arguments against operator overloading
Overloading existing operators and inventing new operators are not the same thing, but +1 from me.
Apr
11
comment Does Go implicitly discourage getters and setters and encourage direct member access?
@RichardTingle If you change the implementation of a setter later on, there is a high risk of silently breaking all your clients, because their assumptions about valid inputs may no longer hold.
Apr
11
comment Does Go implicitly discourage getters and setters and encourage direct member access?
Getters and setters are non-idiomatic in any OO language.
Mar
20
awarded  Curious
Feb
8
comment Is a programming language a set of programs or a set of instructions?
What do you mean "things a compiler will catch at runtime"?
Jan
19
comment Programming language heritage of the word 'field'
That makes sense.
Jan
18
comment Programming language heritage of the word 'field'
Actually, fields aren't called member variables in C++. They're called data members.
Jan
17
comment Exercise in 1.6 C by Kernighan and Ritchie
@Deduplicator C99? In K&R? You gotta be kidding :)
Jan
16
answered Exercise in 1.6 C by Kernighan and Ritchie
Jan
14
comment Why are return values from compare functions in many languages defined loosely?
Note that this approach only works if the type of position is smaller than the return type of the comparison function. For example in Java, Integer.MAX_VALUE is bigger than -1, but Integer.MAX_VALUE - (-1) is negative due to overflow.
Dec
30
comment What is different between the internal design of Java and C++ that lets C++ have multiple inheritance?
@DVK Nowhere are vtables mentioned in the C++ standard either.
Dec
22
comment How could I avoid singletons in this case?
Many programmers seem to think Singletons are better than global variables because they have been told that global variables are bad, whereas Singleton is a Design Pattern, and Design Patterns are good, right? ;)
Dec
22
comment How to define “or” logically
@octatoan Sure, if his language supports that... which I doubt.
Dec
18
awarded  Great Answer
Dec
17
comment How to define “or” logically
Ah, of course. I knew there had to be a deeper reason :)
Dec
17
comment How to define “or” logically
@JensG Agreed in general, but I have stumbled upon one good use case of comparing against false, namely if (someCollection.add(someElement) == false), which means "if adding the element did not work", and it reads a lot more natural to me than negating via !.
Dec
17
comment How to define “or” logically
@BlueHat But then the two returns would be indented differently ;)
Dec
17
comment How to define “or” logically
How about False ||| False = False and _ ||| _ = True instead? :)
Dec
17
comment How to define “or” logically
@Matthew I doubt his language has ?: if it doesn't even have or :)
Dec
16
awarded  Good Answer