Skip to main content

3 posts tagged with "guide"

View All Tags

Best Practices and Coding Style in StelLang

· One min read
Mahesh
Admin/Owner of Stel-lang

By Mahesh

Writing clean, maintainable code is important. Here are some best practices for StelLang.

Naming Conventions

  • Use descriptive names for variables and functions
  • Follow snake_case for variables and functions

Code Structure

  • Keep functions short and focused
  • Use modules to organize code

Comments and Docstrings

  • Comment why, not just what
  • Use docstrings for functions and modules

Error Handling

  • Handle exceptions gracefully
  • Validate inputs

Consistency

  • Stick to a consistent style throughout your project

Good code is readable, reliable, and reusable. Follow these tips to write your best StelLang code!

Debugging and Troubleshooting in StelLang

· One min read
Mahesh
Admin/Owner of Stel-lang

By Mahesh

Every developer encounters bugs. Here’s how to debug and troubleshoot effectively in StelLang.

Common Errors

  • Syntax Errors: Check for typos and missing brackets.
  • Type Errors: Use gradual typing to catch mistakes early.
  • Runtime Exceptions: Read error messages carefully—they’re designed to help!

Debugging Tools

  • Print Statements: Use print() to inspect variables.
  • Exception Handling: Use try/catch blocks to handle errors gracefully.
  • Testing: Write tests with stel test to catch bugs before they reach production.

Tips

  • Break problems into smaller pieces
  • Reproduce bugs with minimal code
  • Ask the community for help if you’re stuck

Debugging is part of the journey. StelLang’s tools and community are here to help you succeed!

Getting Started with StelLang: A Beginner's Guide

· One min read
Mahesh
Admin/Owner of Stel-lang

By Mahesh

Welcome to StelLang! This guide will help you set up your environment and write your first StelLang program.

Step 1: Install Rust and Git

Make sure you have Rust and Git installed.

Step 2: Clone the StelLang Repository

git clone https://github.com/MaheshDhingra/StelLang
cd StelLang

Step 3: Build StelLang

cargo build

Step 4: Run Your First Program

Create a file called hello.stel:

print("Hello, StelLang!")

Run it:

cargo run hello.stel

Next Steps


Happy coding with StelLang! If you have questions, reach out on Discord or GitHub.