Naming Conventions
Variable names in Rhyme follow specific conventions that make your code readable and consistent.
The Basics
All variables in Rhyme start with a dollar sign $
followed by a descriptive name:
set $user-name = "Alice"
set $total-count = 42
set $is-logged-in = true
Kebab-Case Style
Rhyme uses kebab-case (words separated by hyphens) for variable names:
- ✅
$user-email
- Correct kebab-case - ✅
$first-name
- Clear and readable - ✅
$shopping-cart-total
- Multiple words connected - ❌
$userEmail
- Avoid camelCase - ❌
$user_email
- Avoid underscores
Descriptive Names
Choose names that clearly describe what the variable contains:
// Good - Clear purpose
set $customer-age = 25
set $order-total = 99.99
set $is-premium-member = true
// Poor - Too vague
set $x = 25
set $temp = 99.99
set $flag = true
Boolean Variables
For true/false values, start with words like “is”, “has”, or “can”:
set $is-active = true
set $has-permission = false
set $can-edit = true
System Variables
System variables provided by Rhyme are in ALL CAPS:
.text "Today is $TODAY"
.text "Current time: $NOW"
.text "App version: $VERSION"
Remember: Good variable names make your app easier to understand and maintain!