This is a collection of programs that showcases basic functionalities in each programming language (that I know of).
Core concepts include*:
- Hello World
- Variables (e.g., int, char, enums, structs, null)
- Input/Output
- Math Operations (e.g., +, -, *, /, %)
- Logical Operators (e.g., and, or, not)
- Conditional Operators (e.g., if, else)
- Loops (e.g., while, for)
- Pointers
- Optionals
- Functions
- String Methods
- Docstrings
- Recursion
- Generics
- Operator Overloading
- Arrays
- Static & Dynamic Arrays
- Array Methods
- Dictionaries
- Tuples
- Sets
- Exception Handling
- Object-Oriented Programming (OOP)
- Classes (constructors & destructors)
- Encapsulation (access modifiers)
- Inheritance (base & derived classes)
- Abstraction (interfaces & abstract classes)
- Polymorphism (virtual classes & functions)
*Note that not all languages support these features. And some languages like SQL operate using their own syntax.
In 2018, I was learning Python and was bombarded with so much info about its syntax. To help me retain all the information, I created how_to_python.py
, a culmination of all the basic Python syntax into one program. I was very proud of the end product that I considered doing something similar to other programming languages. However, I never committed to the idea until a few years later.
Python was a language I would utilize, but not regularly. So, to jog my memory, I would always refer back to how_to_python
. One day when I was stuck at home, I looked back at that program and remembered just how useful it was to have a cheat sheet you could run. I had plenty of free time on my hand, so I finally decided to incorporate multiple languages into this long-overdue project.
Each language is divided into folders, where each folder contains a separate README detailing the backstory of each language and how to run each file. From there, you can learn how each component of a language comes together. Note that this only covers the basics of a language. Please refer to the documentation or take a learning course to thoroughly learn a particular language.
Note: Excluding CSS, HTML, JSON, Markdown, and SQL since they're not typical procedural languages
- C
- C#
- C++
- Dart (compiles ahead-of-time (AOT) for mobile and just-in-time (JIT) for web)
- Go
- Java (compiles to bytecode, then uses a JIT compiler at runtime)
- Kotlin
- Rust
- Scala
- Swift
- TypeScript (compiles to JS)
- JavaScript
- MATLAB
- PHP
- Python
- Ruby
- Shell
- C
- C#
- C++
- Dart
- Java
- MATLAB (to suppress output)
- PHP
- Rust
- MATLAB
- C#
- C++
- Dart
- Java
- Kotlin
- MATLAB
- PHP
- Python
- Ruby
- Scala
- Swift
- TypeScript (JS classes are syntactic sugar for prototypes)
- C++
- MATLAB
- Python
- C#
- C++
- PHP
- Python
- Rust
- Swift
- C
- C#
- C++
- Dart
- Go
- Java
- Kotlin
- Rust
- Scala
- Swift
- TypeScript (but can be dynamic like JS)
- JavaScript
- MATLAB
- PHP
- Python
- Ruby
- Shell
- C
- C#
- C++
- Go
- Rust
- C
- C++
- Go
- Kotlin (when statements)
- MATLAB
- Ruby (case statements)
- Rust (match statements)
- Scala (match statements)
- Swift
- C#
- Dart
- Kotlin
- Rust
- Scala
- Swift
- TypeScript
- C
- C#
- C++
- Dart
- Go
- Java
- JavaScript
- Kotlin
- PHP
- Rust
- Scala
- Swift
- TypeScript
- PHP (less common)
- Python
- Ruby
- Shell
- Python
- Shell