Naming Convention
Naming conventions are a set of rules and guidelines that define how we name elements in a programming language—such as variables, functions, constants, and more. These conventions are not just about style; they help make code more readable, consistent, and understandable, especially when working in teams or writing large programs.
In EasyBite, naming conventions are clear and specific. In this document, we will explain in great detail how to name your functions, variables, constants, and other identifiers correctly according to EasyBite standards. This explanation is aimed at beginners, so we will go step by step and include many practical examples.
Why Naming Conventions Matter
Before diving into the actual rules, it’s important to understand why naming conventions matter:
- Readability – A consistent style makes your code easier to follow.
- Team Collaboration – Everyone follows the same rules, so the code feels familiar.
- Maintainability – Clean and predictable names make it easier to debug and extend programs.
- Self-Documentation – A good name tells you what something does without needing comments.
Now, let’s explore the naming rules in EasyBite.
Function Names
Rule: All lowercase, no underscores, no hyphens — even for multiple words.
EasyBite expects function names to be:
- Written entirely in lowercase letters.
- Do not use underscores (
_
) to separate words. - Do not use camelCase (
calculateArea
) or PascalCase (CalculateArea
). - Instead, use a flat lowercase structure.
Example:calculatearea
Good Examples:
function printmessage()
function getuserinput()
function calculateaverage()
function checkvalidemail()
Bad Examples (avoid):
function print_message() // uses underscore
function getUserInput() // camelCase
function GetUserInput() // PascalCase
function get-user-input() // hyphens not allowed
This style may feel strange at first, especially if you’re used to camelCase or snake_case, but consistency is key in EasyBite.
Variable Names
For variables, the convention is similar to functions but slightly more flexible.
Rule: Use lowercase, can use underscore if needed for clarity.
You can name variables using:
- All lowercase (
total
,index
,userinput
) - Lowercase with underscores for readability (
user_input
,file_path
,count_total
) - Keep names short but descriptive.
Good Examples:
set total to 0
set user_input to input("Enter a value: ")
set temperature to 36.5
set is_valid to true
Bad Examples:
set Total to 0 // Starts with uppercase
set userInput to "hi" // camelCase not recommended
set user-input to "hi" // Hyphens are invalid
While underscores are allowed for variables, it’s a good idea to use them only when they truly make the name easier to understand.
Constant Names
Constants are values that don’t change during program execution.
Rule: Use ALL CAPS with underscores to separate words.
This is a common style for constants in many languages, and EasyBite follows it too.
Examples:
set PI to 3.14159
set MAX_USERS to 100
set DEFAULT_NAME to "guest"
Avoid:
set pi to 3.14159 // Looks like a variable
set MaxUsers to 100 // camelCase is incorrect
set default-name to "guest" // Invalid syntax
Library and Module Names
When importing libraries, always use lowercase names.
Example:
import math
import string
If you alias a library using as
, keep it lowercase:
import string as str
Class and Object Names (if supported)
EasyBite does not currently emphasize object-oriented structures, but if you define structured types or classes in future versions or extensions, it’s best to use PascalCase:
object UserProfile
object ShoppingCart
Summary Table
Type | Style | Example |
---|---|---|
Function | lowercase, no _ | getuserinput() |
Variable | lowercase or snake_case | user_input , total |
Constant | UPPER_CASE | MAX_USERS |
Library | lowercase | import math |
Class | PascalCase (if used) | UserAccount |
Helpful Tips
- Pick meaningful names:
totalprice
is better thantp
. - Never use spaces or hyphens: they’re invalid in names.
- Test your names by reading them aloud—does it sound like what it does?
- Stick to the convention 100% of the time—even for practice code.
Conclusion
Naming conventions might seem like a small detail, but they make a huge difference in the clarity and quality of your code. EasyBite's naming rules are simple, predictable, and beginner-friendly. Just remember:
- Functions:
lowercasewithnospaces
- Variables:
lowercase_or_with_underscore
- Constants:
ALL_UPPERCASE
- Avoid camelCase, PascalCase (for functions/variables), and kebab-case
By consistently using the correct naming style, your EasyBite programs will be easier to read, share, and grow over time.