I use CAPITALS for constants and prefix types with T and a derivative of Hungarian notation for most variables:
n = Int (Number)
s = String
l = Logical/Boolean (Even though they are still an int)
a = array (as for array of string, an for Array of number)...
etc.
I do not use hungarian notation for field variables if they are public properties; but instead make them SentenceCase. Variables who's type is a user defined "Type", are all lowercase...
Local client:Tclient
Local aliens:Tlist
The only single letter variable I use (and do not adhere to hungarian notation) are x,y,w,h and colours r,g,b.
I use CamelCase for all multipart names and only ever use an underscore in a constant. All functions start with a Capital, and Methods start with a lowercase character.
In all type constructor functions I create variables called "me".
'############################################################
Type Texample
Field name:String
'------------------------------------------------------------
'# Create an example
Function Create:Texample( sName:String )
Local me:Texample = New TExample
me.name = sName
Return me
End Function
End Type
Local variable declaration and return values are indented to the depth of the function, but the function body is indented one deeper (see code above).
I do not indent "Case" statements; I split them with a 40 character comment as follows (Notice the comment on each case too)...
Select EventID()
'----------------------------------------
Case EVENT_APPSUSPEND '# App has lost focus
'# Code indented
'----------------------------------------
Case EVENT_APPRESUME '# Not used
'# Code indented
'----------------------------------------
Case EVENT_APPTERMINATE '# This is processed in updateGameState()
'# Code indented
'----------------------------------------
Case EVENT_KEYDOWN '# Not used
'# Code indented
'----------------------------------------
end select
I seperate methods/functions within a type with a 60 character comment of hyphens, and seperate blocks (variable declaration, game loop, Functions, types, with a 60 character comment of hashes.
There are probably a million ways of coding. The best ways are those that make the code more readable. Not the ones that try to abbrieviate everything. (Why is abbrieviate such a long word)..!