HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Conventional Return bug exploiters' names (contribute)

01-26-2004, 02:43 PM#1
Vexorian
Let's standarize this to make some permanent names:

this is what we got at the moment

Code:
// The only needed XtoI functions:

function H2I takes handle h returns integer

function B2I takes boolean b returns integer

function StoI takes string s returns integer

function RtoI takes real r returns integer

//The other functions:

function  I2U takes integer i returns unit

function  I2it takes integer i returns item

function  I2D takes integer i returns destructable


function I2W takes integer i returns widget

function I2T takes integer i returns trigger

function I2P takes integer i returns player

//Really special handle types

function I2multiboard takes integer i returns multiboard

function I2multiboarditem takes integer i returns multiboarditem

function I2dialog takes integer i returns dialog

function I2dialogbutton takes integer i returns dialogbutton

function I2timer takes integer i returns timer

function I2timerdialog takes integer i returns timerdialog


This is what I got at the moment, please comment the names if you have objections, add names for missing functions
01-26-2004, 02:45 PM#2
weaaddar
I think we should make them all lowercase only because the natives are capital and it should make sure we don't confuse one of our funcs for a native.
01-26-2004, 02:49 PM#3
Vexorian
Right

The first thing to do is to decide if we'll make them lowercase

I still cannot decide
01-26-2004, 05:14 PM#4
AIAndy
I think this naming system has too many exceptions. Apart from that they are easily confused with the natives.

I propose using:
Handle2Int
Boolean2Int
Str2Int
Real2Int
Int2Unit
Int2Item
Int2Destructable
...

Maybe even make no exception for integer and string so:
Handle2Integer
Boolean2Integer
String2Integer
...
01-26-2004, 05:44 PM#5
KaTTaNa
How about
IndexOfHandle
IndexOfUnit
IndexOfItem
..and..
HandleAtIndex
UnitAtIndex
ItemAtIndex

Would make sense if you don't mind semi-long names.

-EDIT-
Actually I think it would be better with typecasting functions like:
AsUnit(handle h) returns unit
AsBoolexpr(handle h) return boolexpr
etc.

Then only make conversion functions for native types like handles, strings, reals, etc.
01-26-2004, 08:36 PM#6
weaaddar
I think converting to int and then to whatever is better personally.
01-27-2004, 01:20 PM#7
Vexorian
Quote:
Originally posted by AIAndy
I think this naming system has too many exceptions. Apart from that they are easily confused with the natives.

I propose using:
Handle2Int
Boolean2Int
Str2Int
Real2Int
Int2Unit
Int2Item
Int2Destructable
...

Maybe even make no exception for integer and string so:
Handle2Integer
Boolean2Integer
String2Integer
...


The only problem with them is that they are too long
01-27-2004, 02:05 PM#8
AIAndy
Speaking function names are much more important than their length. Also they should be easily distinguishable which 3-4 letter function names usually are not.
01-28-2004, 07:31 PM#9
Starcraftfreak
Quote:
Originally posted by AIAndy
Speaking function names are much more important than their length. Also they should be easily distinguishable which 3-4 letter function names usually are not.

Thats a point.
01-29-2004, 01:23 PM#10
Vexorian
I still think that having long names in overused functions is too problematic, I still suffer from IntegerTertiaryOp
01-29-2004, 02:16 PM#11
Vidstige
I think you are missing a point here... It's not just the length of the function names that decides overall readability, it is also the length of lines (among other things). I am not sure that this really is an issue though. Why not just invent one short name and one long name for them.