All Questions
3 questions
18
votes
3
answers
2k
views
Should wrappers compare as equal using the == operator when they wrap the same object?
I'm writing a wrapper for XML elements that allows a developer to easily parse attributes from the XML. The wrapper has no state other than the object being wrapped.
I am considering the following ...
12
votes
11
answers
13k
views
Examples of operator overloading, which make sense [closed]
While I learning C#, I found that, the C# supports operator overloading. I have problem with good example which:
Make sense (ex. adding class named sheep and cow)
Is not an example of concatenation ...
2
votes
3
answers
436
views
C# Duplicated usage of an if/else condition and a ternary operator. A good practice?
I had a debate with a work mate regarding the following code as to which one of it would be the better practice:
My code (in pseudo):
var A = <precondition either TRUE or FALSE>;
var B;
if(A)
{
...