Android Question Has anyone come up with naming conventions for B4x apps?

Widget

Well-Known Member
Licensed User
Longtime User
Has anyone written conventions for naming applications, procedures, variables, classes and modules for B4x? Or is it still a a wide open town where anything goes? o_O

I come from a Delphi background so using a naming convention makes the code more readable, especially when distributing source code to others. I'm wondering if B4A programmers have some recommendations or would like to share their ideas on this subject?

TIA
 

Widget

Well-Known Member
Licensed User
Longtime User
I have the worst convention ever .
It is called (JustMakeCodeWorkAsSoonAsPossible ) :D

I think some programmers do this deliberately so the next programmer that takes over the project can't understand what the heck is going on and the company is forced to call in the original programmer to act as a highly paid consultant. Maybe there is a program that will strip out all of the comments, screw with the indentation, swap variable names around, then add complex but useless routines and then call them throughout the program so no one can understand the logic flow. The code won't look like it was obfuscated on purpose because it will still look like code at first glance with the same/similar variable names and procedure names but in the wrong places. The program will still run because the new code that was added won't actually do anything so the old code runs normally but will be impossible to understand. Hmmm. I feel an app coming on. I'll call it "SaveMyProgrammingA$$". :p
 
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
Maybe because I have very little memory, but some things help the programmer who created the code to understand it (when I read my code 2 weeks after I wrote it, I need help :p).

I can understand better when I read m[VarName] in my code that this is a module variable, not a local one (you can have a long routine and I should search where it was defined; well, F7 helps, in these cases, "fortunately").

If I define a variable as clsXXXX I know this is a my class.

Once upon a time...
someone who used to add a prefix to variable names to highlight their type.
Good times!
 
Upvote 0

somed3v3loper

Well-Known Member
Licensed User
Longtime User
I think some programmers do this deliberately so the next programmer that takes over the project can't understand what the heck is going on and the company is forced to call in the original programmer to act as a highly paid consultant. Maybe there is a program that will strip out all of the comments, screw with the indentation, swap variable names around, then add complex but useless routines and then call them throughout the program so no one can understand the logic flow. The code won't look like it was obfuscated on purpose because it will still look like code at first glance with the same/similar variable names and procedure names but in the wrong places. The program will still run because the new code that was added won't actually do anything so the old code runs normally but will be impossible to understand. Hmmm. I feel an app coming on. I'll call it "SaveMyProgrammingA$$". :p
I wish I was this type but sometimes when asked to provide source code, I use more brain power to make it readable :D
 
Upvote 0

inakigarm

Well-Known Member
Licensed User
Longtime User
Three prefix letter for views and meeaning full variables and Subs (obviously, try to Comment,Comment and Commen code)
 
Upvote 0

Eme Fibonacci

Well-Known Member
Licensed User
Longtime User
I try to use the vb.net naming convention when possible. And I try to follow recommended in CLEAN CODE book.
 
Last edited:
Upvote 0
Top