• Kipper

    v0.12.1
  • Downloads

  • Docs

  • Playground

  • Changelog

  • Kipper

    v0.12.1
    • Downloads

    • Docs

    • Playground

    • Changelog

      • latest /
      • Comments
    Kipper Docs
    • next
    • latest
    • 0.11.0
    • 0.10.4
    • 0.9.2
    • Overview

    • Quickstart

    • Goals for Kipper

    • Supported platforms

    • Usage Examples

      • Overview

      • Type Consistency

      • Runtime Type Casting

      • Strict Compiler Inspection

      • Integrated Runtime Library

    • Variables

      • Overview

      • String Type

      • Number Type

      • Boolean Type

      • Void Type

      • Null Type

      • Undefined Type

      • Array Type

      • Overview

      • Tangled Expression

      • Arithmetic Expression

      • Assignment Expression

      • Conditional Expressions

      • Logical Expressions

      • Bitwise Expression

      • Relational Expressions

      • Convert Or Cast Expression

      • F-String Expression

      • Member Access Expression

      • Function Call Expression

      • Lambda Expression

      • Matches Expression

      • Overview

      • Expression Statement

      • If Statement

      • While Loop

      • Do-While Loop

      • For Loop

      • Compound Statement

      • Jump Statement

    • Functions

    • Interfaces

    • Classes

    • Comments

    • Built-in Functions

      • Overview

      • Compiler Setup

        • Overview

          • index

          • compiler

          • errors

          • logger

          • utils

          • config

          • index

          • index

        • Overview

        • new

        • run

        • compile

        • help

        • version

      • latest /
      • Comments
    • latest /
    • Comments

    Edit page

    Comments

    A comment is a special string, which is processed differently from other code elements, as it is ignored by the parser and has no effect on the behaviour of a program. Comments are therefore best suited for describing code functionality and informing the reader of important info.

    Syntax

    • Single Line Comment:
    // CONTENT
    • Block Comment:
    /* CONTENT */

    Function Comments

    Function comments are special comments, which are placed directly above a function definition. They are used to describe the functionality of a function and its parameters, and should be used whenever a function is not self-explanatory.

    Function comments are written in the following format:

    /**
     * DESCRIPTION
     * @param PARAMETER_NAME DESCRIPTION
     * @returns DESCRIPTION
     */
    def FUNCTION_NAME(...) -> ... {
      ...
    }

    This is a best-practise for any large code and library, as it allows the user to quickly understand the functionality of a function, without having to read the entire function body. Especially also using IDEs this is essential for quick and easy development.

    Examples

    One-Line Comment

    // Greet the user
    print("Hello user!");

    Multi-Line Comment

    /*
     * We have a lot to say.
     * This is a very long comment.
     * It spans multiple lines.
     */
    print("Hello user!");
    print("This is a very long comment.");
    print("It spans multiple lines.");

    Function Comment

    /**
     * Calculates the sum of all numbers in the list 'val'.
     * @param val The list of numbers.
     * @returns The sum of all numbers.
     */
    def sum(val: Array<num>) -> num {
      var sum: num = 0;
      for (var i: num = 0; i < call len(val); i++) {
        sum += i;
      }
      return sum;
    }
  • Developed at:

    • Releases
    • GitHub
    • Security
    • Issue Tracker
    • License
  • Copyright © 2021-2025 Luna Klatzer, 2024-2025 Lorenz Holzbauer & Fabian Baitura.
    Kipper is licensed under the GPL-3.0-or-later license.