- 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
Admin
Admin
Ban zunesis, please. Seriously.
Admin
The result of an assignment in C# is as if you had chained the value assignment.
int a = 3; int b = a = 5;
b is 5.
int a = 3; return a = 5;
5 is returned.
Admin
But I have work to do:
Admin
Agreed.
The fact that I actually read the entirety of his last post significantly lowered my self-esteem. I no longer feel like anyone could ever love me or that I would deserve it.
I would also like to thank everyone who encouraged him to get this bad.
Admin
Admin
Admin
The TRWTF is that it took the readers of this forum so many tries to get it right. sigh
Admin
Addendum (2011-07-27 13:58): And never realizing that C does operator chaining as well... I thought it returned true on all assignments.
Admin
But I'm sure you knew that...
Admin
But they were each building on what someone else had said previously, as indicated by the quotes and replies.
Admin
On a lighter note, I have thought up some more "punishment" methods:
I Attach a penis-pump on the guy and force him to ejaculate on his mother's face until he dehydrates and dies. Do whatever you want with her.
II When he gets home from work, have his family lined up on the front lawn doused in gasoline. Hide the garden hose and light them up. Make him watch as they scream and burn to death.
III Take a dildo and cover the outside with low-grit sandpaper, grit facing out. 'nuff said.
IV Kidnap with wife (if shes tall and fat enough) and peel off her skin. Wear it like a suit and impersonate her. Initiate lovemaking that night - imagine his surprise when it turns out his wife is a man!
That's all for now.
Admin
Admin
Admin
Let's have some fun with this code:
// I make no guarantees or warranties as to the compilability or accuracy of this post.
Admin
Perhaps it returns true for most assignments, so you never noticed.
Admin
Admin
Admin
Admin
Thank you for posting this. It's pretty much the only comment worth reading. It's proof of what the function does, even though everyone is still arguing about it.
It's called a "bait and switch" because if you do a "GetMaxRetry()" it will return the value of what it is, then set itself to 5. The assignment will be performed after the return.
Take the following code:
I imagine most would be pretty confused when that loop runs 5 times.
Admin
Admin
Admin
Admin
No fair!
You changed the outcome by reading it!
Admin
Admin
Not really sure how that logic is working in your head since the very original thing you quoted (mine) states that it limits the out of scope use (i.e. access to the public member) as being 5, and also in the quote, that this is because the get method is also setting the value. So how many tries did it take? 1.
The third thing you quoted also quite clearly stated that it would set and return the value 5.
Admin
You can have:
Unless I learned incorrectly, this is a fairly standard way of exposing properties publicly using the OOP model. Your style of variable naming can change (I've seen private int _Property1, then public int Property1 used in examples.)
Admin
disagree entirely.
This wtf is about as simple as they come. You'd understand it after the first 2 weeks of a computing degree. There is only one person who didn't understand it and he/she was quickly corrected.
The fact that you or anyone else thinks that we need coded example to explain what a property is in C# shows that you probably don't understand this very well yourself.
Your post makes about as much sense as someone praising an explanation of the difference between an int and a string.
Admin
This.
Today I have lost a lot of confidence in the ability of tdwtf readers. It looks like the coders have been chased away by the trolls.
Admin
How long have you been a C++ programmer again?
Admin
I don't appreciate this. My decision to post the code was inspired by other people demonstrating their lack of understanding and I didn't want the discussion to run any longer over something so simple - they often do and, this time even, still did, showing that it could be helpful.
Admin
For the record, I stand by someone on this. The fact that Matthew singled out his post, said how awesome it was, and still got it wrong pretty much justifies thinking that "we need coded example to explain what a property is" in my mind. At least if you read "we" as "the forum" and not any particular person.
Admin
Or the DotNET 'Micro' version of the framework? http://www.microsoft.com/en-us/netmf/default.aspx
Admin
And it really clarified for me the return value of assignment, which I thought returned true in C/C++ and void in C#.
Admin
Admin
Blimey, that's sick enough to be worthy of Viz.
Admin
To the poster referring to himself as various forms of "Zunesis":
"Zunesis" is a trademarked name of The Zunesis Company (http://www.zunesis.com).
We find your statements here beyond deplorable. We are especially offended that you would use our name to post your horrifying depravity.
If you do not stop making use of our registered trademarks, we will pursue legal action.
Debbie Sweghart Sr. Account Manager
Admin
Admin
I think it would have been faster to just link to something like this: http://www.amazon.com/Beginning-Programming-Dummies-Wally-Wang/dp/0764508350
As far as I could see, there were about 2 people who didn't understand the code and about 10 people posting about how "no-one understands".
I still maintain that anyone who feels a tutorial is required in order to explain how a property works, is far overestimating the complexity of a property.
Admin
What's a "Viz"? I'm afraid to search for it.
Admin
Well, good luck either way. I'm interested to see what zunesis' reaction will be.
Admin
I can tell even just from your wording that nothing worthwhile will come from talking to you. You seem to have no interest in helping people to understand, thus avoiding WTFs, which I though was the point of this site.
Go away now.
Admin
And then of course there was Matthew's work of art later.
Admin
I strongly doubt anyone would confuse his screen-name with your company, seeing as nobody has ever heard of you- so I don't think you have much of a legal leg to stand on. In fact, your threatening legal action over his completely unrelated screen-name creates a far more negative connotation of your company than anything zunesis said.
Captcha: Vindico Lawsuits 'en vindico' never got us anywhere.
Admin
Sure, so lets take this to the next level. We should get a primary school teacher in here to explain what all these long words mean. Then we should get your older brother in to tell you how to turn on your computer.
We could treat everyone like complete morans and explain the most basic of concepts to everyone... or those morans could just stop commenting on things they know nothing about and could learn the basics in their own time.
(Thanks to EvanED for clarifying that there are more people who probably shouldn't be here than I had initially thought.)
Admin
Who should be here and why?
Admin
Ooh, subtle troll there. :)
Admin
Admin
Anyone can be here, but unless you know at least the very basics of programming, you will not find much enjoyment in the codeSODs. I thought that would be common sense.
Such people should be somewhere else learning 'Hello World' and the like. That way, when they come here, we will not have people trying to educate them on programming101.