|
Well, I mean the guy who wrote it must have been using a Hex editor and the link break was just another two bytes to him, as he could only see "0D 0A" which looks normal, to him...
-Spacix
All your skynet questions[ ^] belong to solved
I dislike the black-and-white voting system on questions/answers.
|
|
|
|
|
Recently came across this gem.
<br />
protected void Foo()<br />
{<br />
PreProcess(arg);<br />
}<br />
<br />
<br />
private void PreProcess(string arg)<br />
{<br />
try<br />
{<br />
return;<br />
}<br />
catch(Exception ex)<br />
{<br />
}<br />
}<br />
But fortunately we have the nanny-state politicians who can step in to protect us poor stupid consumers, most of whom would not know a JVM from a frozen chicken. Bruce Pierson Because programming is an art, not a science. Marc Clifton
|
|
|
|
|
Future extension?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
probably the coder wants the program to do nothing..
.....
|
|
|
|
|
Spunky Coder wrote: probably the coder wants the program to do nothing
probably the coder do nothing wants to program.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Spunky Coder wrote: probably the coder wants the program to do nothing..
Just because it does nothing doesn't mean nothing can go wrong!
Steve
|
|
|
|
|
This is to catch the possibility of that the function failed to return.
The code in the catch should then be
protected void Foo()
{
PreProcess(arg);
}
private void PreProcess(string arg)
{
try
{
return;
}
catch(Exception ex)
{
main();
}
}
codito ergo sum
|
|
|
|
|
Yeah there are many exceptions that can be thrown by the return instruction...
|
|
|
|
|
The function will ALWAYS return. The try{ return; } are the first 3 lines in the method & where the PreProcess() is called is already wrapped in a try..catch block.
But fortunately we have the nanny-state politicians who can step in to protect us poor stupid consumers, most of whom would not know a JVM from a frozen chicken. Bruce Pierson Because programming is an art, not a science. Marc Clifton
|
|
|
|
|
like it...
try to return... if you fail, catch the exception and return...
if you can...
(yes|no|maybe)*
|
|
|
|
|
I cannot begin to imagine how the person who wrote this code thinks...
|
|
|
|
|
MarkBrock wrote: I cannot begin to imagine how the person who wrote this code thinks...
A couple of judicious edits and, voila:
"I cannot imagine the person who wrote this code thinks."
|
|
|
|
|
Don't be so hard on the programmer. There might be couple of reasons for this. May be code skeleton was written to be filled later. Maybe there was function body was well but over time it was removed but function itself was not removed.
-Saurabh
|
|
|
|
|
Saurabh.Garg wrote: it was removed but function itself was not removed
Don't you think that's a little dangerous?
At best it's careless & sloppy. I don't want careless, sloppy devs on my team - do you?
But fortunately we have the nanny-state politicians who can step in to protect us poor stupid consumers, most of whom would not know a JVM from a frozen chicken. Bruce Pierson Because programming is an art, not a science. Marc Clifton
|
|
|
|
|
I agree that it shows carelessness but how is it dangerous? Actually since I knew nothing about code base and its history I was giving benefit of doubt to the developer.
-Saurabh
|
|
|
|
|
Saurabh.Garg wrote: since I knew nothing about code base
Granted. Suffice it to say that this code forms part of a banking simulator.
Dangerous in that it sets a precedent. This kind of sloppy code shouldn't be checked back into source control. Seriously, if the dev who wrote this was too lazy to clean this up there's a real danger that he'll take shortcuts in other places too. This in itself is already bad & poses a danger to our product as a whole.
So yeah... In my book that's dangerous
But fortunately we have the nanny-state politicians who can step in to protect us poor stupid consumers, most of whom would not know a JVM from a frozen chicken. Bruce Pierson Because programming is an art, not a science. Marc Clifton
|
|
|
|
|
least there isn't a performance hit. It could have been throwing exceptions
protected void Foo()
{
PreProcess(arg);
}
private void PreProcess(string arg)
{
try
{
throw new Exception("Still being worked on..");
}
catch(Exception ex)
{
}
return;
}
|
|
|
|
|
|
<br />
<br />
string drinkType = tbDrinkType.Text;<br />
<br />
if (drinkType != "")<br />
{<br />
tbDrinkType.Text = drinktype;<br />
}<br />
<br />
|
|
|
|
|
Funny.
He/she still keeps on coding?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
|
He should be a Technical Lead now.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
Definitely.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Not technical lead, but management.
|
|
|
|
|