Software Professionals- Do you have a naming convention for your code at work?

Page 2 - Seeking answers? Join the AnandTech community: where nearly half-a-million members share solutions and discuss the latest tech.

Jumpem

Lifer
Sep 21, 2000
10,757
3
81
Originally posted by: purbeast0
i hate you guys :(

i just graduated and am STILL looking to find a software developing job somewhere. heck, atleast I wanna just find an entry level programming job doing SOMETHING! just be happy you all are working because in 3 months, I haven't found anything yet :(

Did you do any internships while in school?

It took me a year to find my first internship. Now I'll have a year and a half of Java, C/C++, C#, SQL, HTML, ASP, JS, XML/XSLT experience when I graduate.
 

dullard

Elite Member
May 21, 2001
26,044
4,690
126
I'm not trained in programming, but much of what I do for my job is programming (Company is too small to be able to afford a programmer). I and a collegue of mine who do all the programming have worked together, and generally have followed simple naming conventions. Nothing fancy, and nothing using symbols that make things horrible to read. For example, all our work is mathematical, thus we have lots of long equations. That said, this randomly typed equation (letters don't mean anything and I always use descriptive words, but you get the point):

a_c=d_c_f_r-g_h_w-g_h_Y-R-d-q_a

is far, far harder to read than this equivalent equation:

ac = dcfr - ghw - ghY - R - d - qa

Especially when you have 10 screenfulls of equations all one after another, then the underscore really screws up my eyes.
 

DrPizza

Administrator Elite Member Goat Whisperer
Mar 5, 2001
49,601
167
111
www.slatebrookfarm.com
Originally posted by: dullard
I'm not trained in programming, but much of what I do for my job is programming (Company is too small to be able to afford a programmer). I and a collegue of mine who do all the programming have worked together, and generally have followed simple naming conventions. Nothing fancy, and nothing using symbols that make things horrible to read. For example, all our work is mathematical, thus we have lots of long equations. That said, this randomly typed equation (letters don't mean anything and I always use descriptive words, but you get the point):

a_c=d_c_f_r-g_h_w-g_h_Y-R-d-q_a

is far, far harder to read than this equivalent equation:

ac = dcfr - ghw - ghY - R - d - qa

Especially when you have 10 screenfulls of equations all one after another, then the underscore really screws up my eyes.


I only occasionally write little programs for myself... I can't stand trying to read code with underscores in it. And, when I'm looking at code for doing something mathematical, I agree with dullard on his above example. gahhhhhh, my eyes!
 

DrPizza

Administrator Elite Member Goat Whisperer
Mar 5, 2001
49,601
167
111
www.slatebrookfarm.com
Oh, but I used to use my own naming convention... but, I never worked on a team. I never re-used local variable names... always a different name. But, at the beginning of the code, in a comment, I listed every variable I used, it's type, what and where it was used. I'd just stick them into the comment as I created them. It made debugging code a piece of cake, especially if I was working with tons of variables, because even I would forget what some of them did.