Compare commits
2 Commits
b6463aa249
...
63ba80b4a6
Author | SHA1 | Date |
---|---|---|
p1ng0ut | 63ba80b4a6 | |
p1ng0ut | 07d0b4945f |
12
README.md
12
README.md
|
@ -21,19 +21,21 @@ export PATH=<path_to_reval_md_bin_path>:$PATH
|
|||
or by adding this path to `~/.profile`. When this is done, you can execute the command:
|
||||
|
||||
```shell
|
||||
reveal-md docs/index.md
|
||||
reveal-md docs/index.md -w
|
||||
```
|
||||
|
||||
## Kotlin Native Build
|
||||
|
||||
To compile this project natively, you have to go to the [current Kotlin release page](https://github.com/JetBrains/kotlin/releases) (currently
|
||||
version 1.8.0) and download the distribution
|
||||
that fits your operating system (you have to scroll down a bit). and download the
|
||||
distribution that fits your operating system (you have to scroll down a bit).
|
||||
To compile this project natively, you have to go to
|
||||
the [current Kotlin release page](https://github.com/JetBrains/kotlin/releases) (currently
|
||||
version 1.8.0) and download the distribution that fits your operating system (you have to scroll
|
||||
down a bit).
|
||||
|
||||
```shell
|
||||
kotlinc-native src/nativeMain/kotlin/Main.kt -o build/Main
|
||||
```
|
||||
|
||||
|
||||
|
||||
[^1]: A tutorial for the installation can be found at
|
||||
the [link](https://nodejs.org/en/download/package-manager/) above.
|
|
@ -1,19 +1,100 @@
|
|||
---
|
||||
title: Dezentrale Kotlin Course
|
||||
separator: <!--s-->
|
||||
verticalSeparator: <!--v-->
|
||||
separator: <!--next_chapter-->
|
||||
verticalSeparator: <!--next_slide-->
|
||||
theme: night
|
||||
revealOptions:
|
||||
transition: 'fade'
|
||||
---
|
||||
|
||||
# Kotlin Course
|
||||
# Kotlinkurs
|
||||
|
||||
---
|
||||
<!--next_chapter-->
|
||||
|
||||
## Kotlin Language Basics
|
||||
## Kotlin die Multiplattform-Sprache
|
||||
|
||||
Kotlin is a...
|
||||
- **JVM**: Java-Code kann in Kotlin eingebunden werden und umgekehrt
|
||||
- **Android**: Ausführung auf verschiedenen Geräten
|
||||
- **JS**: Client-Anwendungen lauffähig im Browser
|
||||
- **Native**: Kompilieren für jedes Betriebssystem (bspw. Windows, Linux, iOS und macOS)
|
||||
|
||||
- multiplatform programming language
|
||||
-
|
||||
<!--next_slide-->
|
||||
|
||||
## Mehrere Programmierparadigmen möglich
|
||||
|
||||
- _imperative_ Programmierung,
|
||||
- _objektorientierte_ Programmierung,
|
||||
- _generische_ Programmierung,
|
||||
- _funktionale_ Programmierung und mehr.
|
||||
|
||||
<!--next_slide-->
|
||||
|
||||
## Etwas Geschichte
|
||||
|
||||
- Kotlin wurde **2011** erstmals vorgestellt und
|
||||
- seit **2010** entwickelt
|
||||
- **2016** wurde Version 1.0 veröffentlicht
|
||||
- **2017** auf Google I/O erstklassiger Support angekündigt
|
||||
|
||||
<!--next_chapter-->
|
||||
|
||||
## Ein Beispielprogramm
|
||||
|
||||
Hello-World, wie üblich (siehe [Main.kt](../src/nativeMain/kotlin/Main.kt)):
|
||||
|
||||
```kotlin
|
||||
fun main() {
|
||||
println("Hello, Kotlin/Native!")
|
||||
}
|
||||
```
|
||||
|
||||
<!--next_slide-->
|
||||
|
||||
## Grundlegende Begriffe (1/2)
|
||||
|
||||
- Ein **Programm** ist eine Folge von Anweisungen, die nacheinander ausgeführt werden.
|
||||
- Eine **Anweisung** ist ein einzelner auszuführender Befehl (drucke den Text),
|
||||
- Ein **Ausdruck** ist ein Codestück, das einen einzigen Wert ergibt (z. B. ist 2*2 ein Ausdruck)
|
||||
|
||||
<!--next_slide-->
|
||||
|
||||
## Grundlegende Begriffe (2/2)
|
||||
|
||||
- Ein **Block** ist eine Gruppe von Anweisungen, in einem Paar geschweifter Klammern `{...}`
|
||||
- Des Weiteren gibt es noch:
|
||||
- **Schlüsselwörter** - Wort mit besonderer Bedeutung in der Programmiersprache
|
||||
- **Bezeichner** - Wort um etwas zu identifizieren
|
||||
- **Kommentare** - Text der beim Ausführen des Programms identifiziert wird
|
||||
|
||||
<!--next_slide-->
|
||||
|
||||
## Variablen deklarieren
|
||||
|
||||
- **val** (für value) deklariert unveränderliche Variable
|
||||
- **var** (für Variable) deklariert eine veränderbare Variable
|
||||
|
||||
Der anschließende, zwingend erforderliche Name darf nicht mit einer Zahl beginnen!
|
||||
|
||||
<!--next_slide-->
|
||||
|
||||
### Beispiel unveränderliche Variable:
|
||||
|
||||
```kotlin
|
||||
val language = "Kotlin"
|
||||
```
|
||||
|
||||
Achtung: Variablennamen sind case-sensitiv:
|
||||
|
||||
language != Language
|
||||
|
||||
<!--next_slide-->
|
||||
|
||||
### Beispiel veränderliche Variable:
|
||||
|
||||
```kotlin
|
||||
var dayOfWeek = "Monday"
|
||||
println(dayOfWeek) // prints Monday
|
||||
|
||||
dayOfWeek = "Tuesday"
|
||||
println(dayOfWeek) // prints Tuesday
|
||||
```
|
||||
|
|
Reference in New Issue