Skip to main content
Code Review

Return to Answer

replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link

This Stack Overflow Q&A This Stack Overflow Q&A describes some good ways to deal with errors and return values.

This Stack Overflow Q&A describes some good ways to deal with errors and return values.

This Stack Overflow Q&A describes some good ways to deal with errors and return values.

replaced http://codereview.stackexchange.com/ with https://codereview.stackexchange.com/
Source Link

But as others have said as others have said this is nit-picking: consistency is king. Writing professional code is writing code that nicely blends into the existing code base, because it doesn't use a different bracing or spacing style. And it's consistently consistent.

As for the actual implementation, as already mentioned as already mentioned returning early is never a bad idea; it removes the noise and lets you focus on the "clean" execution path:

But as others have said this is nit-picking: consistency is king. Writing professional code is writing code that nicely blends into the existing code base, because it doesn't use a different bracing or spacing style. And it's consistently consistent.

As for the actual implementation, as already mentioned returning early is never a bad idea; it removes the noise and lets you focus on the "clean" execution path:

But as others have said this is nit-picking: consistency is king. Writing professional code is writing code that nicely blends into the existing code base, because it doesn't use a different bracing or spacing style. And it's consistently consistent.

As for the actual implementation, as already mentioned returning early is never a bad idea; it removes the noise and lets you focus on the "clean" execution path:

added 147 characters in body
Source Link
Mathieu Guindon
  • 75.5k
  • 18
  • 194
  • 467

Arguably since the number of iterations is known from the start, a for loop would have been more appropriate than a while(1) infinite loop.

Arguably since the number of iterations is known from the start, a for loop would have been more appropriate than a while(1) infinite loop.

Source Link
Mathieu Guindon
  • 75.5k
  • 18
  • 194
  • 467
Loading
lang-c

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