Using methods.

BlitzMax Forums/BlitzMax Beginners Area/Using methods.

tonyg(Posted 2007) [#1]
What reasons are there for not using a method directly?
e.g. tplayer.move(n) or move_player(tplayer,n)
I notice BRL tend to use a function that calls a method while other 'externalise' the methods to be called directly.
Both make sense to me but I'm just wondering if using methods is frowned upon in programming circles.


CS_TBL(Posted 2007) [#2]
Are you referring to those wrapper functions for e.g. Maxgui? (like, a CreateBank function instead of a 'New TBank' etc.)

If so, I'd say it's done to make BMax look more uniform with the older Blitzes. Lower learning threshold perhaps for those without OO experience.


tonyg(Posted 2007) [#3]
You're probably right.
It just seems more user friendly though to give a command to do something.
Plus, with methods, it seems to advertise the internal workings a bit.
Probably thinking about it too much.
I've got Code Complete so I'm sure it'll explain in there somewhere just like to know thoughtsspecific to Bmax's implementation.


H&K(Posted 2007) [#4]
I agree with CS_TBL most of the functions in the base mods seem to be there to have made it easier for us to move from B3B or B+ to BMax.
Also, I think it was easier to do that than write a good ide with as you said code completion. It does make it annoying that the Docs are tied to the Fucntions rather than the Methods.


FlameDuck(Posted 2007) [#5]
Both make sense to me but I'm just wondering if using methods is frowned upon in programming circles.
No. I'm fairly certain that the Function wrappers are only there to placate the whining childish hatemongers.


Brucey(Posted 2007) [#6]
whining childish hatemongers.

Surely that's just a figment of your over-active imagination, Mr Duck :-)