techscript

Best Practices for TechScript Developers

This document highlights guidelines for writing clean, optimized, and secure TechScript code.


📐 1. Variable Assignments vs Constants

# Good
const SERVER_PORT = 8080

# Bad (mutable variable unnecessarily)
server_port = 8080

🔀 2. Lexical Scoping and Variable Shadowing

Minimize shadowing of variables from outer scopes to improve code readability:

# Confusing
x = 10
do calc()
    x = 5 # Shadows outer x
    send x
end

Keep scope footprints narrow by declaring variables only when they are needed.


🔒 3. FFI Safety


🧱 4. Designing Classes and Traits