News:

PlayBASIC2DLL V0.99 Revision I Commercial Edition released! - Convert PlayBASIC programs to super fast Machine Code. 

Main Menu

Average variable / array or Function Name length be in characters ?

Started by kevin, April 11, 2022, 07:27:20 AM

Previous topic - Next topic

kevin



  So PlayBASIC coders;  What would be your average variable / array or function name length be in characters ? 

  #learntocode    #coding #codinglife  #programming



stevmjon

mine would be 10 average. i usually put 2 names seperated by a _ eg. Player_XPos

does naming length make a difference if too long?
It's easy to start a program, but harder to finish it...

I think that means i am getting old and get side tracked too easy.

kevin

 
Quotedoes naming length make a difference if too long?

   yeah if it does when doing searching for matches.   Ultimately comparing strings is just checking if two sequences of memory are the same really, so the longer the sequence the worst the performance gets. 

   What i'm curious about here is what a good data size might be for strings in saya  text document. 

   Imagine an array of 1000  (eg  Dim Mystrings$(1000)),  now each string can be of any size (memory permitting).   Since each string is of a variable size; they've separate allocations.    What we could do is have a shared cache of strings within one buffer, providing the all the strings are less than some max size.  Say 32 characters.   If long one better bigger;  then it gets it's own buffer or links various 32 character buffers together to store the data.     

   Ideally this would suit those situations where the user needs a text dialog or even text editing or syntax highlighting..