PureBasic Syntax Question (for EVERYBODY)

Everything else that doesn't fall into one of the other PB categories.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Danilo.

Hello !!

Thats a gerneral question about
the PureBasic-Syntax.

I want to know how *you* like
new commands if i write a new
Library.
(The libraries are *for you*)

Given is a command "XYZ" which has
some "subfunctions".

Which Syntax do you like ??

1.) XyzCreate, XyzAdd, XyzDelete

or

2.) CreateXyz, AddXyz, DeleteXyz


I dont care much about it, but i think

XyzCreate
XyzAdd
XyzDelete

looks a little bit better, because
you can see easier which main-command
is used.

Better example:

Code: Select all

>   SystrayCreate
>   SystrayAdd
>   SystrayDelete
>------------------- 
>   CreateSystray
>   AddSystray
>   DeleteSystray
Which Syntax is better ??

Thanks,
...Danilo

(registered PureBasic user)
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by PB.
Which Syntax is better ??
I prefer NAMExyz instead of xyzNAME, because it's easier to find the commands
in an index that way, and they stay grouped. Otherwise, the commands are
"split up" and are not always immediately obviously related to each other.


PB - Registered PureBasic Coder
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Danilo.

Thanks PB, but that wasnt clear at all :wink:

Do you like
SystrayAdd
SystrayDelete
SystrayCreate

or

CreateSystray
AddSystray
DeleteSystray

Thanks,
...Danilo

(registered PureBasic user)
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by PB.
SystrayAdd
SystrayDelete
SystrayCreate
I like this version, because the commands can be grouped together in the docs,
alphabetically.


PB - Registered PureBasic Coder
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by preacher.

SystrayAdd
SystrayDelete
SystrayCreate

I like this too, looks best and is more "readable".


[Preacher]
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by blueb.

Happy New Year!

Personally I like the makers of functions and DLL's
to use the form: maker_function

e.g. my company uses BP_Add
BP_Delete, etc.

The reason for this is when you have to use DLL's, etc from
4 different developers, there is no confusion, as there can
be many functions that "Add" something.
e.g. BP_Add 'Bare Point Systems Add function
EZ_Add 'EZGUI Software's Add function
PB_Add 'Pure Basic's Add function

Just a thought,
--Bob
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by fred.

As you could have see it, I personnaly prefer the other form (AddSystray, Remove Systray) because it does the code easier to read (more 'human'). The other strange looks a bit strange... If SystrayAddIcon().. Just my point of view tough.

Happy new year !

Fred - AlphaSND
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Ralf.

do you post a link to get these libraries when they are ready ?
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Andre.

Hi!

Like Fred said - I also like more the "human" form of command names, e.g. CreateSystray(), AddGadget(),...

The should be no problem to find the searched commands, because:

1. All commands of a library are grouped together (see the Reference Manual)
2. Alphabetical order is available via the Commandindex.html
(3. An additional command index with FIRSTLY sorted by library, and SECONDLY sorted by command, should be no real problem with an updated version of the DocMaker tool... Fred ?)

Ciao
Andre
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Danilo.

Thanks for all the answers.

I will follow the PureBasic-Way
and use the commands

CreateCoolbar
UpdateCoolbar
AddCoolBar
DeleteCoolbar
etc...

Thanks,
...Danilo

(registered PureBasic user)
Post Reply