- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Does it compile or not ?
Admin
I'm still not sure I get what the developer was trying to accomplish. I think he wanted a kind of attribute (since it is an encapsulated class) which is used several times, and some of those times the value can be updated, and other times, not (hence, the derived class which is updateable).
IF that is the case, then it should have been done as such: class RecordBase { public class DateTimeAbstract { public foo { get; } public bool set()... }
};
Yes, I know my syntax is off - but hopefully you get the point.
Admin
So, that's an article on the Website of a Newspaper that has the name of a Morse code sending machine and it's in the paper's Tv and radio section.
Admin
Of course! How else do you send Morse code except by TV or radio?
Admin
More often than not, "yellow snow" is no longer "snow" but solid re-frozen slush. Sometimes hard as a brick. It depends on the temperature!
Admin
WRONG.... It should be a NotSupportedException(). NotImplemented is designed specifically to be used by development so there are valid semantic placeholders for functionality that has not yet been implemented.
Proper pre-release testing should include a solid scan to ensure that there are NO instances of NotImplemented!
Admin
Dedicated landline.
Admin
Correct me if I'm wrong, but that appears to be Java. And if that is Java, then you can't reliably use '==' on strings. It needs the equals() method.
So it's even more wrong.
Admin
He's AFAIK devoted church-goer.
Admin
It makes a patch of yellow snow an excellent weapon for poking out the eyes of husky-thieves. The act of urination (particularly canine, being close to the ground makes the stream more collimated) forms a sort of solid yellow ice-cone with a more-or-less sharp tip.
Admin
Did anyone else think of BuildMaster when they saw "Alex" blaming "invisible" people for the dodgy code?
Admin
If this is C# its soooo easy....
Admin
Sorry, but private set is causing much problems if not used correctly.
Admin
Everything. It tells you that something broke, but not why, or what you can do to fix it. The message is a completely redundant. The mere fact that this would cause an exception indicates that you can't perform that operation, so the message is not telling you anything that you don't already know.
Admin
Admin
hmm... does this code fall into that category
public void SetAnyPrivateFieldYouKnowTheNameOf(object target, string fieldName, object value) { var t = target.GetType(); var f = t.GetField(fieldName, BindingFlags.NonPublic | BindingFlags.Instance);
Admin
Because in C# classes are sealed (aka final in java) by default, subclasses wouldn't be able to override the setter. My solution would be:
This still allows the classes themselves to set Prop, because it has a protected setter, but doesn't allow the consumer of the API to set Prop when the subclass doesn't shadow Prop and implements set (a property with a different name would work the same, of course). It depends on whether or not you're designing an API.
Admin
Thank you for providing codes. Very much appreciate!
Admin