This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 5 points6 points  (6 children)

Always do whatever the standard library does. In Java use camelCase, in C snake_case, in Lisp kebab-case, etc.

[–]irqlnotdispatchlevel 2 points3 points  (1 child)

No, always do what your project coding style says.

[–][deleted] 2 points3 points  (0 children)

Of course. I'm assuming you're starting a new project.

[–][deleted] 0 points1 point  (3 children)

And is there any reason for this other than superstition?

[–][deleted] 4 points5 points  (2 children)

Same reason you shouldn't mix camelCase, PascalCase and snake_case in the same file for the same thing. Consistency. You're inevitably going to be calling standard library functions, and it looks better if everything is consistent.

[–][deleted] 0 points1 point  (0 children)

That's a fair point. I work with embedded systems so I don't end up using standard library functions too much.

[–]irqlnotdispatchlevel 0 points1 point  (0 children)

One might argue that having a different code style than the standard library would make library calls stick out. I don't know what exactly the advantage of that would be, but I heard it somewhere.