Skip to main content
Code Review

Return to Answer

Commonmark migration
Source Link

#Exception Handling

Exception Handling

MessageBox.Show("[ERROR:53928]");

I've a few issues with this.

  1. That message will mean absolutely nothing to the end user. You should always strive to give end users meaningful, clear, and non-technical messages.
  2. This method shouldn't be responsible for displaying messages to the user anyway. You should be throwing an exception instead. Let the calling code figure out what to do with the error. Most likely, it should pass it off to a logger and maybe display a message. I don't have enough context to actually say what the correct thing would be.

#Naming

Naming

It's standard style to use PascalCase for classes and methods; camelCase for variables and arguments. At no time should there be underscores in your names. It's not a big deal if you will be the only developer to ever touch the code, but if you work on a team or expect to open source the code, it will be important to code in a style that other C# devs expect. For more information, please see The Official Microsoft C# Style Guide.

#Exception Handling

MessageBox.Show("[ERROR:53928]");

I've a few issues with this.

  1. That message will mean absolutely nothing to the end user. You should always strive to give end users meaningful, clear, and non-technical messages.
  2. This method shouldn't be responsible for displaying messages to the user anyway. You should be throwing an exception instead. Let the calling code figure out what to do with the error. Most likely, it should pass it off to a logger and maybe display a message. I don't have enough context to actually say what the correct thing would be.

#Naming

It's standard style to use PascalCase for classes and methods; camelCase for variables and arguments. At no time should there be underscores in your names. It's not a big deal if you will be the only developer to ever touch the code, but if you work on a team or expect to open source the code, it will be important to code in a style that other C# devs expect. For more information, please see The Official Microsoft C# Style Guide.

Exception Handling

MessageBox.Show("[ERROR:53928]");

I've a few issues with this.

  1. That message will mean absolutely nothing to the end user. You should always strive to give end users meaningful, clear, and non-technical messages.
  2. This method shouldn't be responsible for displaying messages to the user anyway. You should be throwing an exception instead. Let the calling code figure out what to do with the error. Most likely, it should pass it off to a logger and maybe display a message. I don't have enough context to actually say what the correct thing would be.

Naming

It's standard style to use PascalCase for classes and methods; camelCase for variables and arguments. At no time should there be underscores in your names. It's not a big deal if you will be the only developer to ever touch the code, but if you work on a team or expect to open source the code, it will be important to code in a style that other C# devs expect. For more information, please see The Official Microsoft C# Style Guide.

Source Link
RubberDuck
  • 31.2k
  • 6
  • 74
  • 176

#Exception Handling

MessageBox.Show("[ERROR:53928]");

I've a few issues with this.

  1. That message will mean absolutely nothing to the end user. You should always strive to give end users meaningful, clear, and non-technical messages.
  2. This method shouldn't be responsible for displaying messages to the user anyway. You should be throwing an exception instead. Let the calling code figure out what to do with the error. Most likely, it should pass it off to a logger and maybe display a message. I don't have enough context to actually say what the correct thing would be.

#Naming

It's standard style to use PascalCase for classes and methods; camelCase for variables and arguments. At no time should there be underscores in your names. It's not a big deal if you will be the only developer to ever touch the code, but if you work on a team or expect to open source the code, it will be important to code in a style that other C# devs expect. For more information, please see The Official Microsoft C# Style Guide.

lang-cs

AltStyle によって変換されたページ (->オリジナル) /