Kotlin
Programació en Kotlin: fonaments, col·leccions, coroutines, Compose i aplicacions per a Android i escriptori.
Fonaments
Computació
Kotlin checks the program before running it, and to do so it needs to know the type of every value.
Tipus de dades
In Kotlin every value has a type, and the type decides what you can do with it and when the compiler will let you do it.
Funció
A Kotlin function says what type each parameter is and what type the result is, and the compiler checks it at every call.
Algoritme
Pendent de fer
Function type
Functions can be treated as a data type.
Nul
A null value represents "no value" or "unknown/missing" data.
Llista
In Kotlin you decide when you create a list whether it can be modified, and the type of its elements is part of the type of the list.
Map
A map relates keys to values, and when you ask for a key that isn't there, it gives you back null instead of crashing.
Data
Data is a set of related values managed as a whole, and designing it well is half the job.
Col·lecció
Filtering, transforming and summarizing a collection without writing the loop — what in Python you did with a list comprehension.
Extension Function
Add functions to a class that isn't yours, without modifying it and without inheriting from it.
Desenvolupament
Test
Unit tests are small isolated tests that check whether a method, class, feature, or component correctly implements its business logic.
Gatling
Gatling is a powerful, open-source load-testing tool designed to analyze and measure the performance of web applications.
Kotest
Kotest is a flexible and elegant multiplatform testing framework for Kotlin with extensive assertions and integrated property testing.
Power-assert
El plugin Power-assert mostra els valors intermedis quan un `assert` falla.
IntelliJ IDEA
The JetBrains IDE for programming in Kotlin, and how you have it installed, licensed and configured.
Javascript
Compilar Kotlin a JavaScript i executar-lo al navegador.
Kotlin Toolchain
One `kotlin` command that creates, builds, tests, packages and publishes a Kotlin project, configured in two YAML files instead of Gradle.
dotenv
Treu la configuració del codi i posa-la en variables d'entorn amb un fitxer `.env`.
Logging
Logging is an essential part of any production-ready application.
Kotlin Symbol Processing
KSP is a tool that allows feeding Kotlin source code to processors, which can in turn use this information to generate code, classes, or resources, for instance.
KotlinLLM
A Smart macro is a Kotlin call whose body an LLM writes once, and that runs as ordinary Kotlin forever after.
Input/Output
Coroutine
Corrutines de Kotlin: codi asíncron escrit com si fos seqüencial.
Serialization
Converteix objectes Kotlin a JSON i a l'inrevés amb `kotlinx.serialization`.
File
The computer's file system lets us persist data in secondary memory.
Objectes
Web
Gradle
Gradle is a build automation tool for software development
Docker
Construir i executar imatges Docker des d'un projecte Kotlin.
HTML
The kotlinx.html library provides the ability to generate DOM elements using statically typed HTML builders (and besides JavaScript, it is even available on the JVM target!)
Ktor
Ktor, el framework de JetBrains per escriure servidors i clients HTTP en Kotlin.
Ktorfit
Ktorfit is an HTTP client using KSP and Ktor clients.
Wasm
Kotlin/Wasm has the power to compile your Kotlin code into WebAssembly (Wasm) format.
Koweb
Kobweb is an opinionated framework built on top of Compose HTML.
Spring
Escriure aplicacions Spring en Kotlin, amb el suport de primera classe del framework.
UI
Bases de dades
Exposed
Exposed, la biblioteca SQL de JetBrains per a Kotlin.
Room
Room, la capa de persistència d'Android sobre SQLite.
MongoDB
MongoDB lets you manage document data.
Supabase
Fes servir `supabase-kt` per parlar amb Postgres, autenticar usuaris i pujar fitxers.
Col·leccions
Array
An array groups an arbitrary number of values under one name, with a fixed size.
ArrayList
A list is an ordered, resizable collection — how to build one, read it and change it.
Set
Un conjunt és una col·lecció sense ordre i sense duplicats — i el secret és el codi hash.
Mòbil
Sqldelight
SQLDelight genera codi Kotlin a partir de les teves consultes SQL.
PowerSync
PowerSync és un motor de sincronització per crear aplicacions locals amb interfície d'usuari/UX de resposta instantània i transferència d'estat simplificada. Sincronitza entre SQLite al costat del client i Postgres, MongoDB o MySQL al costat del servidor.
Thread
Threads let you run sections of code in parallel instead of one after another.
Concurrency
Com Kotlin fa diverses tasques alhora, i què separa la concurrència del paral·lelisme.
Time
Des de Kotlin 2.1, `kotlin.time` porta el rellotge del sistema a la biblioteca estàndard.
Datetime
Dates i hores a Kotlin amb `kotlinx-datetime`.
JVM
Instal·la un JDK i entén què hi ha sota un projecte Kotlin a la JVM.
Ktorm
Ktorm, un framework d'accés a bases de dades per a Kotlin amb un DSL de SQL.
Excepcions
Les excepcions de Kotlin: llançar-les, capturar-les i quan no fer-ho.
HTTP
Consumeix una API JSON externa i converteix la resposta en objectes Kotlin.
Kotter
Kotter, una API declarativa i idiomàtica per escriure aplicacions de consola en Kotlin.
Kermit
Kotlin Multiplatform Logging
Compass
Compass is a library location toolkit.
Kilua
Kilua is a Composable web framework for Kotlin/Wasm and Kotlin/JS.
Molecule
Build a StateFlow stream using Compose
Scoped function
The Kotlin standard library contains several functions whose sole purpose is to execute a block of code within the context of an object.
Kotlin - Socket
Talk between two programs over the network with Socket and ServerSocket — an echo server, its client, and one thread per client.
Kover
Mesura quina part del teu codi Kotlin cobreixen els tests amb Kover.
MockK
Mocking library
Postgres
Connecta una aplicació Kotlin amb una base de dades PostgreSQL.