|
Or just give the method a decent name, like DeepCopyIfNeeded .
|
|
|
|
|
Manfred R. Bihy wrote: Looks like the coder should have thrown a NotImplementedException[^] here instead.
One of the most underused exceptions when developing software. I use it all the time when I am scoping out classes, but not ready to implement the inner code yet.
I wasn't, now I am, then I won't be anymore.
|
|
|
|
|
It's a great way to detect that something isn't quite done yet.
Cheers!
"With sufficient thrust, pigs fly just fine."
Ross Callon, The Twelve Networking Truths, RFC1925
|
|
|
|
|
Yes, but if he used a NotImplementedException then it wouldn't be a coding horror. Unless, of course, it was still there when released to customers.
Just because the code works, it doesn't mean that it is good code.
|
|
|
|
|
Coincidentally, we just found exactly this yesterday in our latest release.
Release was pretty much a complete rewrite of the software, so this is a "TODO that didn't get to did", not something malicious. Oops.
Now off to the old code to figure it out and design a solution in the new architecture.
|
|
|
|
|
Manfred R. Bihy wrote: Looks like the coder should have thrown a NotImplementedException[^] here instead.
Rather a
NotImplementedHereSoGoOnException
(yes|no|maybe)*
|
|
|
|
|
Horrible!!! It's not even a copy, it's just the same object passed back to the caller.
|
|
|
|
|
Perhaps he means "Deep" in some Buddist-type sense, with a more profound meaning, like a copy of something is the same thing as the original or something. Actually, if this is the case the methdod should have been called ProfoundCopy
|
|
|
|
|
PlatonicCopy: A material copy that is merely a flawed and incomplete projection of the immaterial class.
Giraffes are not real.
|
|
|
|
|
|
In other cultures that's referred to as a Zen copy. You have become one with the object.
Chris Meech
I am Canadian. [heard in a local bar]
In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]
posting about Crystal Reports here is like discussing gay marriage on a catholic church’s website.[Nishant Sivakumar]
|
|
|
|
|
If this was C++, see my sig.
Software Zen: delete this;
|
|
|
|
|
Code like this is probably one reason why
is not a standard xml comment.
No one would want to own up to that.
|
|
|
|
|
Perhaps the coder's name is Dot Stop Period.
Narf.
|
|
|
|
|
This looks like a laid off employee who would like damage the company without the risk of being sued.
"To alcohol! The cause of, and solution to, all of life's problems" - Homer Simpson
|
|
|
|
|
Fabio Franco wrote: This looks like a laid off employee who would like damage the company without the risk of being sued.
Actually, the code was likely written by someone I have worked with previously at another company...
At least I know what to expect
|
|
|
|
|
I'm testing a function that pastes information from the clipboard into several fields in my application. I'm stepping through it in the debugger, and the string returned by Clipboard.GetText() is:
"Clipboard.GetText()" I'm flabbergasted. How the f*** does Clipboard.GetText() return its own name?
...
(minutes of furious mouse clicking and keyboard pounding)
...
Finally I realize the last thing I had done was copied "Clipboard.GetText() " to the clipboard for pasting in my code.
Software Zen: delete this;
|
|
|
|
|
have you tried re-booting the developer?
Panic, Chaos, Destruction. My work here is done.
Drink. Get drunk. Fall over - P O'H
OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre
I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer
Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett
|
|
|
|
|
Reboot in progress; it's 6:38 a.m. here[^], and I'm only on my first cup of coffee.
Believe it or not, but the little red symbol points almost exactly at the location of my cube in the building.
Software Zen: delete this;
|
|
|
|
|
Nagy Vilmos wrote: have you tried re-booting the developer?
FTFY
|
|
|
|
|
That's what you get if you code on an early Monday morning.
"Don't confuse experts with facts" - Eric_V
|
|
|
|
|
Stuff like that can keep me busy for hours!
It's an OO world.
|
|
|
|
|
that's funny. That reminds me of the time my web page kept returning an error when I was trying to view a text file. That is until I realised, the file contained text of a web page error. It must have been a Monday.
|
|
|
|
|
How to generate an ASP.NET menu, if you are an evil genius
First one must define what it is we are to show (apologies for the odd characters, it is badly endoded arabic):
private string memberMenu = @"<table border=0 cellpadding=1 cellspacing=1 width=100% dir=rtl style=font-family:Tahoma;font-size:12px;><tr><td><a href=# onclick=""top.SetLocation(\'\',\'\',\'MembersResearchList.aspx?t=\'+(new Date()).toLocaleTimeString().replace(\':\',\'\'));top.SetTitle(\'ÃÈÍÇË æÏÑÇÓÇÊ\');return false;"" class=""navMenu"">ÃÈÍÇË æÏÑÇÓÇÊ</a></td></tr><tr><td><a href=# onclick=""top.SetLocation(\'\',\'\',\'AddMembersExperience.aspx\');top.SetTitle(\'ÇáÎÈÑÇÊ\');return false;"" class=""navMenu"">ÇáÎÈÑÇÊ</a></td></tr><tr><td><a href=# onclick=""top.SetLocation(\'\',\'\',\'AddMembersAcademicRank.aspx\');top.SetTitle(\'ÇáÑÊÈÉ ÇáÚáãíÉ\');return false;"" class=""navMenu"">ÇáÑÊÈÉ ÇáÚáãíÉ</a></td></tr><tr><td><a href=# onclick=""top.SetLocation(\'\',\'\',\'MemberQualificationList.aspx?t=\'+(new Date()).toLocaleTimeString().replace(\':\',\'\'));top.SetTitle(\'ãÄåá ÇßÇÏíãí\');return false;"" class=""navMenu"">ãÄåá ÇßÇÏíãí</a></td></tr><tr><td><a href=""#"" onclick=""{0}"" class=""navMenu"">ÊÍãíá ÇáÓíÑÉ ÇáÐÇÊíÉ</a></td></tr><tr><td><a href=""#"" onclick=""{1}"" class=""navMenu"" title=""ÌÏæá ÇáãæÇÏ ÇáÊÚáíãíÉ"">ÌÏæá ÇáãæÇÏ ÇáÊÚáíãíÉ</a></td></tr><tr><td><a href=""#"" onclick=""window.open(\'loadEduGate.htm\'); return false;"" class=""navMenu"">ÇáÈæÇÈÉ ÇáÅáßÊÑæäíÉ</a></td></tr><tr><td><a href=# onclick=""top.SetLocation(\'\',\'\',\'MarksMainPage.aspx\');top.SetTitle(\'äÙÇã ÇáÚáÇãÇÊ ÇáÑÓãí áÃÚÖÇÁ ÇáåíÆÇÊ ÇáÊÏÑíÓíÉ ÈÌÇãÚÉ ÇáÈÊÑÇ\');return false;"" class=""navMenu"">äÙÇã ÇÏÎÇá ÇáÚáÇãÇÊ</a></td></tr></table>";
Then one must show it:
lblScript.Text = @"<script type='text/javascript'>document.getElementById('navContent').innerHTML='" + string.Format(memberMenu, @"top.SetLocation(\'\',\'\',\'ListOfMemberCVs.aspx?mid=" + (new FacultyMembers()).GetMemberByUserName(sUserName + "@uop.edu.jo").Rows[0]["membersID"].ToString() + @"&t=\'+(new Date()).toLocaleTimeString().replace(\':\',\'\'));top.SetTitle(\'ÇáÓíÑÉ ÇáÐÇÊíÉ\');return false;", @"top.SetLocation(\'\',\'\',\'../Courseslist/Default.aspx?d=" + ReserveTicketForUser(sUserName, pwd, userType + "," + pwd) + "&mid=" + (new FacultyMembers()).GetMemberByUserName(sUserName + "@uop.edu.jo").Rows[0]["membersID"].ToString() + @"&t=\'+(new Date()).toLocaleTimeString().replace(\':\',\'\'));top.SetTitle(\'My Courses\');return false;") + @"';</script>";
All I wanted to do was to show a link that only the developers could see so we can test a critical system we are migrating to live, this leaves me no opportunity to do so. Some stuff I can put down to bad design decisions, but this I can't explain away.
|
|
|
|
|
In any application I scream a little every time I see a hard coded menu. FFS, it is as easy to parametrise it as it is to hard code and the latter is more extensible. If I caught one of my trained simians doing that it'd be bull-whip time.
Panic, Chaos, Destruction. My work here is done.
Drink. Get drunk. Fall over - P O'H
OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre
I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer
Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett
|
|
|
|