Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

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

like image 842
bogdan Avatar asked Aug 28 '26 00:08

bogdan


1 Answers

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.

like image 175
High Performance Mark Avatar answered Aug 30 '26 10:08

High Performance Mark