Useless...
-
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) { // failed to return, run (fake restart) the program again main(); } }
codito ergo sum
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 -
Recently came across this gem.
protected void Foo() { //... PreProcess(arg); //... } private void PreProcess(string arg) { try { return; } catch(Exception ex) { //.... } }
:doh: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 -
Recently came across this gem.
protected void Foo() { //... PreProcess(arg); //... } private void PreProcess(string arg) { try { return; } catch(Exception ex) { //.... } }
:doh: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 CliftonI cannot begin to imagine how the person who wrote this code thinks...
Mark Brock Click here to view my blog
-
probably the coder wants the program to do nothing..:)
.....
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
-
I cannot begin to imagine how the person who wrote this code thinks...
Mark Brock Click here to view my blog
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."
Deja View - the feeling that you've seen this post before.
-
Recently came across this gem.
protected void Foo() { //... PreProcess(arg); //... } private void PreProcess(string arg) { try { return; } catch(Exception ex) { //.... } }
:doh: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 CliftonDon'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
-
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 -
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 CliftonI 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
-
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 -
Recently came across this gem.
protected void Foo() { //... PreProcess(arg); //... } private void PreProcess(string arg) { try { return; } catch(Exception ex) { //.... } }
:doh: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 Cliftonleast there isn't a performance hit. It could have been throwing exceptions :-D
protected void Foo()
{
//...
PreProcess(arg);
//...
}private void PreProcess(string arg)
{
try
{
throw new Exception("Still being worked on..");
}
catch(Exception ex)
{
//....
}
return;
}
-Spacix All your skynet questions[^] belong to solved
-
least there isn't a performance hit. It could have been throwing exceptions :-D
protected void Foo()
{
//...
PreProcess(arg);
//...
}private void PreProcess(string arg)
{
try
{
throw new Exception("Still being worked on..");
}
catch(Exception ex)
{
//....
}
return;
}
-Spacix All your skynet questions[^] belong to solved
:-O