views:

29

answers:

2

This is maybe a silly question but what should be the proper naming for the exit code variable?

  • exit_code
  • exit_status
  • return_code
  • ...something else?

I'm referring to both application or function exit codes.

I know that all of them are synonyms but it would be nice to have a single one, just for consistency.

Which one should be, and why?

+1  A: 

Use the same name as the other developers in your team. If that's not obvious, agree one with them.

Then get on with programming and don't sweat this sort of stuff.

High Performance Mark
+1  A: 

In our latest application we are using ReturnCode. For some of us the word "Exit" brought up a feeling that something went wrong in the method call. Return is more neutral and it can be used naturally to represent both the positive and negative results.

Overall I think that you can choose anything you want, as long as you are consistent.

Mikael Koskinen