Skip to main content
  1. Have you considered using Operator from MiscUtilOperator from MiscUtil instead of your Calculator?
  2. You should never use general catch. Instead, catch only the specific exception you're expecting.
  3. Since operatorName is used just for the exception, I would consider getting the name from the operator's Method.
  4. _Value probably should be exposed as a read-only property, since the cast is not very discoverable.
  1. Have you considered using Operator from MiscUtil instead of your Calculator?
  2. You should never use general catch. Instead, catch only the specific exception you're expecting.
  3. Since operatorName is used just for the exception, I would consider getting the name from the operator's Method.
  4. _Value probably should be exposed as a read-only property, since the cast is not very discoverable.
  1. Have you considered using Operator from MiscUtil instead of your Calculator?
  2. You should never use general catch. Instead, catch only the specific exception you're expecting.
  3. Since operatorName is used just for the exception, I would consider getting the name from the operator's Method.
  4. _Value probably should be exposed as a read-only property, since the cast is not very discoverable.
Source Link
svick
  • 24.3k
  • 4
  • 52
  • 89

  1. Have you considered using Operator from MiscUtil instead of your Calculator?
  2. You should never use general catch. Instead, catch only the specific exception you're expecting.
  3. Since operatorName is used just for the exception, I would consider getting the name from the operator's Method.
  4. _Value probably should be exposed as a read-only property, since the cast is not very discoverable.