开发者

Naming convention: exit status, exit code or return code?

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

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 it be, and why?


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜