Project Michael Dings Impressum Login

Dings-Coding-Style

I am the Coding-Style for the Dings-System.

Language

For the Program and the Comments only Dings-English is used.

Command-Line-Interface

List-Options

For Options, that accept a List of Values, use Comma without Spaces, for Example:

dings-gpt graph classes 70000225 -type main
dings-gpt graph classes 70000225 -type main,also

The Value all means all possible Values of the Option, for Example:

dings-gpt graph classes 70000225 -type all

When a List-Option filters a Set of Values, the missing Option means all, unless there is a strong Reason for another Default.

A Value prefixed with ! removes this Value from the current List, for Example:

dings-gpt graph classes 70000225 -type all,!main

Use all only as a canonical Convenience-Value. Do not add additional Alias-Values for the same Meaning.

Result-Blocks

When a Command renders multiple top-level Result-Blocks, terminate each Block with a single --- Line, for Example:

# First_Dings (1)

...

---

# Second_Dings (2)

...

---

Variables and Arguments

Case

The Names for Variables use Mixed-Case with Under-Scores, for Example:

Example_Variable = 4711
let Reg_Exp = /\[([^[\]]+)\]\(\d+\.md\)/g
const D_X = Line_X2 - Line_X1
const X_2 = Point_1.X + D_X
Data_List_Fill_with_Names(Data_List, Name_to_Number_Dict_Name, Result_List) {
    this.Data_List_Remove_all_Children(Data_List)
    this[Name_to_Number_Dict_Name] = {}

Running-Variables

Also for Running-Variables use speaking Names), for Example:

for (Index = L; Index >= 0; Index--) {
    this.Dings_Type_Name_Data_List.children[Index].remove()
}

Constants and Enums

Case

Use Upper-Case for Names of Constants use Mixed-Case with Under-Scores, for Example:

EXAMPLE_CONSTANT = 4711
const Mode = Object.freeze({
    FOCUS: "Focus",
    REFERENCES: "References",
    REMOVE_NODE: "Remove_Node",
    REMOVE_EDGE: "Remove_Edge",
    OPEN: "Open",
})

Return-Values

In Case you have to return two Things, use Dictionaries instead of Lists or Tuples, for Example:

--- 300040011.js.orig   2026-04-12 18:45:40.560302288 +0000
+++ 300040011.js        2026-04-12 18:45:41.759698566 +0000
@@ -73,23 +73,26 @@
                this.Name_to_Number_Dict = {}
        }

-       Get_Name_List_and_Name_to_Number_Dict(Result_List) {
+       Get_Name_Data(Result_List) {
                const Name_List = []
-               const Name_to_Number_Dict = {}
+               const Name_To_Number_Dict = {}
                for (const Mapping_Index of Result_List) {
                        const Dings_Number = this.Flex_Index_Global_Mapping[Mapping_Index][0]
                        let Dings_Name = this.Flex_Index_Global_Mapping[Mapping_Index][1]
                        Dings_Name += " (" + Dings_Number + ")"
                        Name_List.push(Dings_Name)
-                       Name_to_Number_Dict[Dings_Name] = Dings_Number
+                       Name_To_Number_Dict[Dings_Name] = Dings_Number
+               }
+               return {
+                       Name_List: Name_List,
+                       Name_To_Number_Dict: Name_To_Number_Dict,
                }
-               return [Name_List, Name_to_Number_Dict]
        }

        Fill_with_Result_List(Result_List) {
-               const [Name_List, Name_to_Number_Dict] = this.Get_Name_List_and_Name_to_Number_Dict(Result_List)
-               this.Name_to_Number_Dict = Name_to_Number_Dict
-               this.Data_List_View.Fill_with_Names(Name_List)
+               const Name_Data = this.Get_Name_Data(Result_List)
+               this.Name_to_Number_Dict = Name_Data.Name_To_Number_Dict
+               this.Data_List_View.Fill_with_Names(Name_Data.Name_List)
        }

        Get_Dings_Number(Dings_Name) {
~

Links and URLs

Case

Use Mixed-Case for Domain-Names in URLs and Lower-Case for the actual real URL, for Example:

- WikiPedia: [Https://En.WikiPedia.Org](https://en.wikipedia.org/wiki/Communication_protocol)
- WikiPedia: [Https://De.WikiPedia.org](https://de.wikipedia.org/wiki/Homebrew_(Paketverwaltung))
- WikiData: [Https://WikiData.Org](https://wikiData.org/wiki/Q132364)
- Holzheu.De: [Https://Holzheu.De](https://holzheu.de)
- YouTube: [Https://YouTube.Com](https://youtube.com/@Learing-While-Doing)

Classes

Naming

Use for Classes always the Suffix “_Class”, for Example:

class Data_List_Class {
    constructor(Data_List_Element) {
        this.Element = Data_List_Element
    }
    ...

Data-Types

Lists

All Variables, that are Lists carry the “_List” Suffix, for Example:

Example_List = [1,2,3]

When Keys for Dictionaries are used in Ontologies, they have the Format <Data_Type>_List, for Example a List of Dings_SM we define …

Dings_SM_List : [A,B,C]

… which means, that A,B,C are of Type Dings_SM.

Functions

The Names for Functions use Mixed-Case with Under-Scores, for Example:

def Example_Function(Example_Parameter: int)

Start Nouns with Upper-Case and all other Words with Lower-Case, for Example:

Data_List_remove_all_Children(Data_List) {
    const Last_Index = Data_List.Options.Length - 1
    for (let Index = Last_Index; Index >= 0; Index--) {
        Data_List.children[Index].Remove()
}

Indentation

For Indentation always Tabs are used, for Exmaple:

def Example_Function(Example_Parameter: int):
    Local_Variable = Example_Parameter

Empty-Lines

All Empty-Lines only contain one single New-Line-Chararacter.

Formatting

V-Form

For several Lines with similar Purpose put longer Lines in front of shorter Lines, for Example:

let Mapping_Index = 0
let Json

Comments

Use short Comments, whenever useful, for Example:

/*
 * Remove all Children from Data_List
 */
Clear_Data_List(Data_List) {
    const Last_Index = Data_List.options.length - 1
    for (let Index = Last_Index; Index >= 0; Index--) {
        Data_List.children[Index].remove()
    }
}

Languages

Java-Script

General

Do not use Semi-Colon as Line-End-Marker.