Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (487)
Games in Android Showcase (112)
games submitted by our members
Games in WIP (553)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: 1 [2]
  ignore  |  Print  
  Favourite name for vectors?  (Read 6181 times)
0 Members and 1 Guest are viewing this topic.
Offline NielsJ

Senior Newbie




Java games rock!


« Reply #30 - Posted 2003-04-11 08: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 Ninja


Medals: 16
Projects: 4
Exp: 14 years


Maximumisness


« Reply #31 - Posted 2003-04-11 10: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

Senior Newbie




azerty


« Reply #32 - Posted 2003-04-24 16: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]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

TehJavaDev (17 views)
2014-08-28 18:26:30

CopyableCougar4 (26 views)
2014-08-22 19:31:30

atombrot (39 views)
2014-08-19 09:29:53

Tekkerue (36 views)
2014-08-16 06:45:27

Tekkerue (33 views)
2014-08-16 06:22:17

Tekkerue (22 views)
2014-08-16 06:20:21

Tekkerue (33 views)
2014-08-16 06:12:11

Rayexar (67 views)
2014-08-11 02:49:23

BurntPizza (45 views)
2014-08-09 21:09:32

BurntPizza (36 views)
2014-08-08 02:01:56
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!