I have been a "newbie" for a lot of years. I get started, then for some reason, I start other things besides programming again.
So, I am starting over during these stay at home times.
Can someone point me to a discussion or article about naming conventions that people use in LiveCode. i.e. calling a button something like "btnNext" or for local variables "varMyVariable", or global variables "gVar". I know that I can create my own but it makes more sense for me to not reinvent.
Thanks,
Linda
Naming conventions
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- VIP Livecode Opensource Backer
- Posts: 10049
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: Naming conventions
This document covers the most commonly used conventions in our community, with some of the background behind them:
http://fourthworld.com/embassy/articles ... style.html
Please reply if there's anything you're looking for not covered there.
http://fourthworld.com/embassy/articles ... style.html
Please reply if there's anything you're looking for not covered there.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Naming conventions
Hi.
What Richard said. But in the end, you have to weigh what floats your boat, versus a convention that might be more familiar to others to whom you might send your scripts. There is an advantage to the "common" language for sure, when you share code.
I do about half. There can be enormous advantages to naming a button, say, "btn34" (do you see why?). Much depends on what you are up to. In the end, though, you should adopt a consistent schema; it will help you read your own code down the road.
Craig
What Richard said. But in the end, you have to weigh what floats your boat, versus a convention that might be more familiar to others to whom you might send your scripts. There is an advantage to the "common" language for sure, when you share code.
I do about half. There can be enormous advantages to naming a button, say, "btn34" (do you see why?). Much depends on what you are up to. In the end, though, you should adopt a consistent schema; it will help you read your own code down the road.
Craig
[Solved} Re: Naming conventions
I was looking for theory and besides the link above, I found answers under "Tips for Writing Good Code" of the User Guide.
Thank you,
L
Thank you,
L
-
- VIP Livecode Opensource Backer
- Posts: 10049
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: [Solved} Re: Naming conventions
Thanks for that feedback, Linda. The team works hard on the docs, and the community has been helping out. It's especially useful to learn of cases like yours to see how it was able to meet a specific need well.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn