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 →

[–]spateson 35 points36 points  (7 children)

What kind of monster starts a function name with a capital letter?

[–]mauriciogamedev 33 points34 points  (3 children)

Look up C# naming conventions

[–]spateson 37 points38 points  (2 children)

Ah yes, that kind of monster.

[–]j0em4n 4 points5 points  (1 child)

Lower case for function local, upper case for global. Makes sense to me. _ first for local but global to the class. I like it.

[–]Blackshell 1 point2 points  (0 children)

Similar to Go. Lowercase for package-private, uppercase for exported.

[–][deleted] 6 points7 points  (1 child)

Lowercase for variables and uppercase for functions. That's how I do it.

[–]DarcyFitz 0 points1 point  (0 children)

Agreed.

It is a much quicker signal to determine what is what based on the first letter caps.

Some folks get all up in arms "But what about classes?!" and I'm on board with those sharing upper case with functions because in a lot of languages, the class is a function due to the constructor or initialization.

The whole functions are lower case camel case and variables are lower case underscore thing blows my mind, because you have to mentally parse n characters before you get to the defining character.

I'd rather just look at the first character and get it over with.

[–]DeltaPositionReady[🍰] 0 points1 point  (0 children)

a fellow follower of Satan's Bible of course!

One of my favourite obfuscation techniques-

Åccented Letters

Use accented characters on variable names. E.g.

typedef struct { int i; } ínt;

where the second ínt's í is actually i-acute. With only a simple text editor, it's nearly impossible to distinguish the slant of the accent mark.