Restored from previous forum. Originally posted by tinman.
Originally posted by geoff
Why do we use Pow(x,y) as in C instead of x^y as in most Basics?
In which case why not allow x++ and x+=1 and other C constructs?
Small details such as this I don't think matter. It is very easy (for a programmer who knows at least one high level language) to look up a reference manaul for both languages to find out what the ^ symbol means, or what a certain operator does.
More important is the concepts behind the language or library commands, which is where handles/pointers vs object numbers fits in. In this case you are trying to figure out the best system to be able to reference things you create (such as gadgets, menus etc).
Either way is fine for portability as long as you do not try to do anything fancy with the handles/pointers such as peeking into them or using API calls. The same goes for object numbers though, as there will usually be the option of getting the handle/pointer behind it if you really want to break portability.
The other issue is handling the references to the things. With handles and pointers you only need store a variable for each one if you want/need to. PureBasic would surely maintain an internal list of all handles. This is also true for object numbers - PureBasic would need to maintain an internal list. You get the advantage of being able to use variables or constants for the object numbers although you would need to do this for all things. Making object numbers optional would cure that.
In short, there is very little real difference between handles and pointers and object numbers for this stuff. The only real difference is in how quickly a reference to a thing can be changed to access it directly. With object numbers you need an extra step.
I agree with the points about too many optional methods can be a hassle (not much if it is only 2 though - handles or numbers) and that ideally the chosen should be kept to and not changed (e.g. between major version of PB).
--
It's not minimalist - I'm increasing efficiency by reducing input effort.
(Win98first ed. + SP1, PB3.40)