Click here to Skip to main content
15,890,947 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Oi! Greg Utas! Pin
pkfox29-Mar-21 23:54
professionalpkfox29-Mar-21 23:54 
GeneralWell, I'm way better than yesterday. Pin
OriginalGriff29-Mar-21 21:52
mveOriginalGriff29-Mar-21 21:52 
GeneralRe: Well, I'm way better than yesterday. Pin
pkfox29-Mar-21 22:20
professionalpkfox29-Mar-21 22:20 
GeneralRe: Well, I'm way better than yesterday. Pin
Rage29-Mar-21 23:46
professionalRage29-Mar-21 23:46 
GeneralRe: Well, I'm way better than yesterday. Pin
Rich Leyshon30-Mar-21 0:30
Rich Leyshon30-Mar-21 0:30 
GeneralSome C# code that makes me sick... PinPopular
Super Lloyd29-Mar-21 15:10
Super Lloyd29-Mar-21 15:10 
GeneralRe: Some C# code that makes me sick... PinPopular
honey the codewitch29-Mar-21 19:31
mvahoney the codewitch29-Mar-21 19:31 
AnswerRe: Some C# code that makes me sick... Pin
Super Lloyd29-Mar-21 21:38
Super Lloyd29-Mar-21 21:38 
Because you haven't imagined the horror to its full extent yet!!!
C#
void Method_1()
{
  try {
    Method_2();
  } catch (Exception ex) {
    // logging maybe?
    throw new Exception("Method_2", ex);
  }
}
void Method_2()
{
  try {
    Method_3();
  } catch (Exception ex) {
    // logging?
    throw new Exception("Method_3", ex);
  }
}
void Method_3()
{
  try {
    Something();
  } catch (Exception ex) {
    // logging again?
    throw new Exception("Something", ex);
  }
}

I'd say how about that?
C#
void Method_1()
{
    Method_2();
}
void Method_2()
{
    Method_3();
}
void Method_3()
{
    Something();
}

or that
C#
void Method_1()
{
  try {
    Method_2();
  } catch (Exception ex) {
    // logging perhaps?
    throw new Exception("Method_2", ex);
  }
}
void Method_2()
{
    Method_3();
}
void Method_3()
{
    Something();
}
instead!
A new .NET Serializer
All in one Menu-Ribbon Bar
Taking over the world since 1371!

GeneralRe: Some C# code that makes me sick... Pin
Rage29-Mar-21 23:48
professionalRage29-Mar-21 23:48 
GeneralRe: Some C# code that makes me sick... Pin
Super Lloyd30-Mar-21 0:26
Super Lloyd30-Mar-21 0:26 
GeneralRe: Some C# code that makes me sick... Pin
milo-xml31-Mar-21 10:09
professionalmilo-xml31-Mar-21 10:09 
JokeRe: Some C# code that makes me sick... PinPopular
Sander Rossel29-Mar-21 19:50
professionalSander Rossel29-Mar-21 19:50 
GeneralRe: Some C# code that makes me sick... Pin
Super Lloyd29-Mar-21 21:39
Super Lloyd29-Mar-21 21:39 
GeneralRe: Some C# code that makes me sick... Pin
Member 1488595529-Mar-21 22:17
Member 1488595529-Mar-21 22:17 
GeneralRe: Some C# code that makes me sick... Pin
dandy7230-Mar-21 3:14
dandy7230-Mar-21 3:14 
GeneralRe: Some C# code that makes me sick... Pin
Sander Rossel30-Mar-21 11:08
professionalSander Rossel30-Mar-21 11:08 
GeneralRe: Some C# code that makes me sick... Pin
Dean Allcorn29-Mar-21 20:44
Dean Allcorn29-Mar-21 20:44 
GeneralRe: Some C# code that makes me sick... Pin
Richard Deeming29-Mar-21 21:48
mveRichard Deeming29-Mar-21 21:48 
GeneralRe: Some C# code that makes me sick... Pin
Super Lloyd30-Mar-21 0:29
Super Lloyd30-Mar-21 0:29 
GeneralRe: Some C# code that makes me sick... Pin
Richard Deeming30-Mar-21 0:44
mveRichard Deeming30-Mar-21 0:44 
GeneralRe: Some C# code that makes me sick... Pin
Super Lloyd30-Mar-21 1:07
Super Lloyd30-Mar-21 1:07 
GeneralRe: Some C# code that makes me sick... Pin
dandy7230-Mar-21 3:17
dandy7230-Mar-21 3:17 
GeneralRe: Some C# code that makes me sick... Pin
MSBassSinger30-Mar-21 3:56
professionalMSBassSinger30-Mar-21 3:56 
GeneralRe: Some C# code that makes me sick... Pin
Slacker00730-Mar-21 4:17
professionalSlacker00730-Mar-21 4:17 
GeneralRe: Some C# code that makes me sick... Pin
NightPen31-Mar-21 5:33
NightPen31-Mar-21 5:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.