Java-Gaming.org Java4K winners: [ by our judges | by the community ]         
Featured games (67)
games approved by the League of Dukes
Games in Showcase (∞)
games submitted by our members



News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: 1 [2]
  Print  
  Favourite name for vectors?  (Read 4474 times)
0 Members and 2 Guests are viewing this topic.
Offline NielsJ

JGO n00b
*

Posts: 16


Java games rock!


« Reply #30 on: 2003-04-11 04:12:05 »

I am with the "block" crowd, much easier to read, esp. since I don't use {'s for on-line ifs

if(b)
 foe(x,y,z);

Mix that with the mis-aligned braces and things gets horribly complicated.

I align variables (both members and local).

I keep members at the beginning of the class and always prefix with "m_" - statics are prefixed with g_ and static final (constants) are all caps. (simple data-classes with no code and public fields don't have the m_)

I use i-prefix for integers (of all sizes), x for fixed point, f for floating points (float and double), a for arrays, v for vectors, s for strings. Other types are not prefixed. I occasionally stray from this (for example when using i, x, y, z etc. in loops and for local variables).

My vector class is an interface called Vec (and Vec2, Vec3 etc. for various impl.)

Upper-case first char in class names, lower case in methods and variables.

I don't use the I and C prefix on Interfaces/classes commonly used in C++ as I don't feel the need for that in Java (besides, my IDE clearly indicates which is what so I don't need it).

Oh, and I prefer grey background in my editor. Comments in dark-grey so they don't clutter the important part - the code Wink ...
Offline erikd

JGO Kernel
*****

Posts: 2561
Medals: 7


Maximumisness


« Reply #31 on: 2003-04-11 06:41:58 »

Quote

I am with the "block" crowd, much easier to read, esp. since I don't use {'s for on-line ifs

if(b)
 foe(x,y,z);

Mix that with the mis-aligned braces and things gets horribly complicated.

I do

if (b) foo(x,y,z);

Again, a lot more compact which makes the code generally easier to understand for me Smiley

Quote
Oh, and I prefer grey background in my editor


I prefer black girls.  Roll Eyes

Ah well, it's all just a matter of personal taste and habit I suppose  Smiley

Offline genepi

JGO n00b
*

Posts: 26


azerty


« Reply #32 on: 2003-04-24 12:50:56 »

Hi,

No one talked about labels  Wink
I'm used to name all of them deCadix, because of the French song http://membres.lycos.fr/chezthal/luismariano/labelledecadix.html  Cheesy

And for other variable names, I follow the Disney characters recommendations from this thread http://forum.java.sun.com/thread.jsp?forum=4&thread=341770. Grin
Pages: 1 [2]
  Print  
 
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.048 seconds with 19 queries.