|
etkins wrote: Un-f-ing believable...
You aren't programming for a long time, are you?
etkins wrote: You guys have to start naming the companies and the projects for these things.
Definitely not. This may get you in trouble - in most (all?) companies all code belongs to company. If you show it here, you are basicaly stealing. And it usually doesn't matter that you don't work for them anymore - it's well covered in the contract.
[ My Blog] "Visual studio desperately needs some performance improvements. It is sometimes almost as slow as eclipse." - Rüdiger Klaehn "Real men use mspaint for writing code and notepad for designing graphics." - Anna-Jayne Metcalfe
|
|
|
|
|
No dude, the people I work with aren't novices and don't write crap software.
The snippets you post are something you would see in a high school or college 101 class that's all.
David
|
|
|
|
|
Doing maintenance on a horror inherited from somebody else, or cleaning up after the trouble person, hired for the sole purpose of increasing head count on your team, is the way we run into this sorta code. Any more questions?
Roswell
"Angelinos -- excuse me. There will be civility today." Antonio VillaRaigosa City Mayor, Los Angeles, CA
|
|
|
|
|
Cleaning up c**p code generated by dodgy foreign outsourcing operations becasue your company has decided to cut costs and "do it on the cheap"
|
|
|
|
|
jc.net.com wrote: becasue your company has decided to cut costs and "do it on the cheap"
My company?
I'm on my own actually. I do some contract work, but mostly freelance. So there's no one in MY company but me;)
But i've seen a fair share of these horrors myself, so yes, you are right in the sense that outsourcing is often unreliable, but so is hiring of local programmers of equal "quality". The solution IMHO is to have a decent interview procedure and not rely so much on credentials, as on actual knowledge.
Roswell
"Angelinos -- excuse me. There will be civility today." Antonio VillaRaigosa City Mayor, Los Angeles, CA
|
|
|
|
|
lol, do you have any idea of how much code there is in the world?
Charlie Gilley
Will program for food...
Whoever said children were cheaper by the dozen... lied.
Overheard in a cubicle: "A project is just a bug under development."
Seeking to rise above the intelligence of a one eared rabbit...
Caught in a vortex of weirdness...
|
|
|
|
|
I was debugging code I have written two years ago.
There was a problem with canceling a command execution.
Following is what I have found:
CommandCancelEventArgs e = new CommandCancelEventArgs(this);
if(e.Cancel)
{
return;
}
Obviously the line
OnCommandExecuting(e)
was missing
Thanks,
Georgi
|
|
|
|
|
Georgi Atanasov wrote: Obviously the line
OnCommandExecuting(e)
was missing
Uh, yeah.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
The actual code is a bit different, but the essence was that the developer who wrote it screwed up big time. Converting string to string is a bit useless in my humble opinion
void SaveUserText(string userText) {
string text = userText.ToString();
}
WM.
What about weapons of mass-construction?
"What? Its an Apple MacBook Pro. They are sexy!" - Paul Watson
My blog
|
|
|
|
|
I suprised that there isn't an assert there as well.
void SaveUserText(string userText)
{
string text = userText.ToString();
assert ( text == userText );
}
Chris Meech
I am Canadian. [heard in a local bar]
|
|
|
|
|
Surely that would be
void SaveUserText(string userText)
{
string text = userText.ToString();
assert ( (string)text.ToString() == (string)userText.ToString() );
}
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Oh, but of course!
|
|
|
|
|
I tryed it ....it crashes....why?;P
Russell
|
|
|
|
|
There was some SQL I had to maintain a few years back where the original programmer had done something like ToChar(ToChar(datevalue)) (I forget the exact syntax, it was RDB) several times.
The guy who'd been maintaining said things like: "It's always been like that.", "It ain't broke.", and "He said it wouldn't work otherwise."
I darn well fixed it anyway. With that and some other changes the program ran in ten minutes instead of forty.
|
|
|
|
|
He said "It ain't broke" not "It aint slow"
|
|
|
|
|
Hahaha, FxCop thought otherwise.
WM.
What about weapons of mass-construction?
"What? Its an Apple MacBook Pro. They are sexy!" - Paul Watson
My blog
|
|
|
|
|
In my recent quests to solve an issue with legacy code, I found several places where code blocks are wrapped in
#if NOT_USED
...
#endif
This is confusing to me since if NOT_USED is defined, then the code will be compiled into the project.
Phil
|
|
|
|
|
Indeed, should be #if 0 or #if false or something.
|
|
|
|
|
Sounds like someone's not using version control on the source, or if they are, they are afraid of using the delete key to actually remove the code. I find this to be the least confusing way of ensuring that code is not compiled into a project.
Chris Meech
I am Canadian. [heard in a local bar]
|
|
|
|
|
Don't get technical with your new fangled ways. I'm just surprised he didn't use a hex editor on the compiled code.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
I think the point is that NOT_USED could be defined at some point, and hose things up.
|
|
|
|
|
You're correct and I understood that point. But, I see that my response could be mis-interpreted from that. For me, if I want to ensure that code is not compiled, I prefer to use the delete key and depend upon source control to preserve the code.
Chris Meech
I am Canadian. [heard in a local bar]
|
|
|
|
|
Chris Meech wrote: depend upon source control to preserve the code
Well, as long as it's not VSS.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Yes, delete is good for the soul.
|
|
|
|
|
Actually the point is that there are many other ways to exclude code from being compiled, but using #ifdef NOT_USED creates confusion as to the intentions of the original developer.
I prefer to be perfectly clear if I don't want the code compiled and either comment it out (with an explanation) or delete it entirely.
Phil
|
|
|
|