Posted: 18th Jan 2011 16:58
We're looking for some feedback with regards to the command structure within App Game Kit (for the scripting side). Currently we're leaning towards something like this:

+ Code Snippet
LoadImage "yourimage.png", 1


It's very similar to the existing structure of DB Pro commands, with the difference being no spacing in the command names. The alternative is more like a DB Pro command with a space being used:

+ Code Snippet
Load Image "yourimage.png", 1


AGK has been written to cope with either method, but it's better to pick one to avoid confusion. What are your thoughts on this? Do you prefer no spacing or spacing in commands?
Posted: 18th Jan 2011 17:04
No spacing just nice and consistent camel case. Pleeease no spacing, or maybe make it optional?
Posted: 18th Jan 2011 17:05
Please NO SPACING!!!!
Posted: 18th Jan 2011 17:05
My personal preference would be for spacing

Can I also ask for a bit more consistency with naming conventions than DBP has please?
For example:
+ Code Snippet
set object wireframe obj, 1
exclude object on obj
show object obj

Might be better as:
+ Code Snippet
set object wireframe obj, 1
set object exclude obj, 1
set object visible obj, 1


Obviously these are 3D and not relevant to the App Game Kit but you get the idea
Posted: 18th Jan 2011 17:06
Consistency of commands is something we have been discussing. We're going through the list making sure it's much better this time round.
Posted: 18th Jan 2011 17:44
Spacing would be nice. Makes for easier reading. Granted some people can adjust to reading non-spaced commands over time but I'm one of those that can't. So spacing would be appreciated it.
Posted: 18th Jan 2011 17:49
Personally, coming from a c# / c++ development back into a BASIC style development, I would prefer the commands to be as in the first example.
Posted: 18th Jan 2011 17:53
No spacing and brackets if you ask me. After a while people will use alot of their own functions (which have brackets) anyway.

+ Code Snippet
LoadImage("yourimage.png",1)

hImage = LoadImage("yourimage.png")


or am I going the wrong way here? o.o
Posted: 18th Jan 2011 18:00
Having done a couple of things in DBPro recently after coming from a C++ background there is one thing I find a little confusing, you can end up with commands looking like this:

+ Code Snippet
point camera object position x(id), 0, 0 


Its not apparent at first glance what is going on, I think no spacing would help with this problem. One step further would be to always use brackets for command parameters but that may be another issue.

EDIT: OK, link beat me to it in the post above.
Posted: 18th Jan 2011 18:15
Just Poppin in and making sure I get this app...
Posted: 18th Jan 2011 18:53
I would say no spaces, even tough I am used to spaces.
Posted: 18th Jan 2011 18:55
Have an overly large number of commands that all do the same just to make sure everyone can use it !

Have:
+ Code Snippet
show object obj,1
showobject obj,1
set object visible obj,1
setobjectvisible obj,1
make object visible obj
makeobjectvisible obj
unhide object obj
unhideobject obj

You can't go wrong ! - And everyone's code, even if they copy other people's projects exactly will still likely be different.
Posted: 18th Jan 2011 19:00
After seeing this:
+ Code Snippet
point camera object position x(id), 0, 0


I have decided to change my vote to NO spaces.
Posted: 18th Jan 2011 19:11
I'd prefer something like functions are in C (no spaces, always bracketed, and returning either a type or 'void'), but with case-insensitivity.

The problem with case-sensitive names is getting the case right - is it rgb, Rgb, or RGB?

Having no spaces, makes it easier to write tools that understand the code, and standardisation on brackets makes that even easier.
Posted: 18th Jan 2011 19:12
matty, the line of code you showed is the main reason why I dislike spaces.
Posted: 18th Jan 2011 19:53
I agree with matty halewood's reason for NO SPACES. It took me a long time when I was learning DBPro (and even now on occasion) to realize that two commands were involved in statements like his example.

Can we make them case sensitive as well so that you must use things like LoadImage (or loadImage) rather than LOADIMAGE or loadimage. It makes a big difference to the readability of some long commands.

[I'm glad Scraggle now agrees with the NO SPACES position. I was beginning to doubt his sanity. ]

Edit (to IanM)

The problem with case-sensitive names is getting the case right - is it rgb, Rgb, or RGB?


Why is that a problem? The same principle applies. The first letter of each word should be capitalised - and RGB is an abbreviation of course.
Posted: 18th Jan 2011 20:03
Although I'm unlikely to use this I also hate spaces in dbpro's commands. Definitely camelCase, and like GG said uppercase commands are less readable. (Just as any text in uppercase) The IDE could auto-correct the case whatever the user types if it's purely for readability.
Posted: 18th Jan 2011 20:20
Can we make them case sensitive as well so that you must use things like LoadImage (or loadImage) rather than LOADIMAGE or loadimage. It makes a big difference to the readability of some long commands.


This is best done at source level through the IDE.
Posted: 18th Jan 2011 20:30
@GG,
In English, it's wrong to do so, but when coding, quite a few professional programmers take abbreviations and capitalise the first letter only, simply because it makes the names easier to read when you have no spaces separating words (which seems to be a common consensus here).

Not too much difference in readability here:
ConvertKMToMiles
ConvertKmToMiles

Big difference here:
RGBToHSV
RgbToHsv

@Kevin,
So you'd go with case-corrected, taking it out of the programmers hands?
Posted: 18th Jan 2011 20:47
So you'd go with case-corrected, taking it out of the programmers hands?


Unless the programmer could choose their preference and the IDE auto-corrected it, best of both worlds