Are functions with long names ok ?

Blitz3D Forums/Blitz3D Beginners Area/Are functions with long names ok ?

RemiD(Posted 2013) [#1]
Hello,

I am trying to restructure my code in a way that i can code with words on my tablet and only add the blitz3d code later on my laptop pc.

So the idea is to use many functions, with long names, like questions (for checks), and sentences (for instructions)

Is this ok to have functions with long names ?
I am aware that this is not an optimised way , but i don't care, i have 66ms to use each frame, so one more ms spent doing more tests is, i think, not a big deal.

Your thoughts ?
Thanks,


Yasha(Posted 2013) [#2]
Long names should be fine. If they aren't, it's a bug in the compiler (some old C compilers didn't bother to read past 32 letters... can't imagine why anyone would make that mistake nowadays though) - certainly I've had no problem with names longer than those. It's just a matter of how much you're willing to type out. If you get IDEal, it has autocomplete, which makes this more or less a non-issue.

(I do have to wonder why you're bothering with an ElseIf to check for False when the If checked for true though. You can actually go one better by ditching the variable as well and just testing the function's result directly. This should be a lot clearer.)


Hardcoal(Posted 2013) [#3]
LOL I make Names that are soo long.
Who cares..! better then wondering later what this should do no?

Also writing stupid remarks as stupid as the may seems helps.

Function RotateImage(Image) 'I dont like this function Its stupid.
End Function

This remarks and worse you can find in my code.
wonderingly (<-- lol nice word wasnt sure it exsists) it may help in weird ways..


jfk EO-11110(Posted 2013) [#4]
your function names are looking totally ok to me. better a long name than a cryptical acronym that doesn't explain anything. just make shure it fits on the screen.


RemiD(Posted 2013) [#5]
Ok, thanks for the feedback.

The function with the longest name so far is :
Ent_IsThereEnoughEmptySpaceToReachTargetWithProjectile()



If they aren't, it's a bug in the compiler (some old C compilers didn't bother to read past 32 letters... can't imagine why anyone would make that mistake nowadays though)


And a way to know this is, i guess, to compile and test if everything seems to work correctly ?


Hardcoal(Posted 2013) [#6]
Define..

Type Entity
Field Check:entitycheck= New entitycheck
End Type

Type EntityCheck
Function xsize(entity)
Return xsize(entity)
End function
End Type

Use..

Entity.check.xsize(entity)


Besides.. if there is a limitation a naming.
The editor will surly inform you.

A way to write orginized long functions


Hardcoal(Posted 2013) [#7]
Define..

My way to write orginized long functions

Type Entity
Field Check:entitycheck= New entitycheck
End Type

Type EntityCheck
Function xsize(entity)
Return xsize(entity)
End function
End Type

Use..

Entity.check.xsize(entity)

If there were limitation in name size. The editor will surly inform you