79098970

Date: 2024-10-17 16:10:04
Score: 0.5
Natty:
Report link

C++ Core Guidelines Per.1: Don't optimize without reason
Reason:

If there is no need for optimization, the main result of the effort will be more errors and higher maintenance costs.

As for me, I will use

std::cout<<is_sqrt ? std::sqrt(i) : i*i;

I feel like this might be slightly faster and doesn't introduce too much complexity.

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: 許恩嘉