https://kotlinlang.org logo
Join the conversationJoin Slack
Channels
100daysofcode
100daysofkotlin
100daysofkotlin-2021
advent-of-code
aem
ai
alexa
algeria
algolialibraries
amsterdam
android
android-architecture
android-databinding
android-studio
androidgithubprojects
androidthings
androidx
androidx-xprocessing
anime
anko
announcements
apollo-kotlin
appintro
arabic
argentina
arkenv
arksemdevteam
armenia
arrow
arrow-contributors
arrow-meta
ass
atlanta
atm17
atrium
austin
australia
austria
awesome-kotlin
ballast
bangladesh
barcelona
bayarea
bazel
beepiz-libraries
belgium
berlin
big-data
books
boston
brazil
brikk
budapest
build
build-tools
bulgaria
bydgoszcz
cambodia
canada
carrat
carrat-dev
carrat-feed
chicago
chile
china
chucker
cincinnati-user-group
cli
clikt
cloudfoundry
cn
cobalt
code-coverage
codeforces
codemash-precompiler
codereview
codingame
codingconventions
coimbatore
collaborations
colombia
colorado
communities
competitive-programming
competitivecoding
compiler
compose
compose-android
compose-desktop
compose-hiring
compose-ios
compose-mp
compose-ui-showcase
compose-wear
compose-web
connect-audit-events
corda
cork
coroutines
couchbase
coursera
croatia
cryptography
cscenter-course-2016
cucumber-bdd
cyprus
czech
dagger
data2viz
databinding
datascience
dckotlin
debugging
decompose
decouple
denmark
deprecated
detekt
detekt-hint
dev-core
dfw
docs-revamped
dokka
domain-driven-design
doodle
dsl
dublin
dutch
eap
eclipse
ecuador
edinburgh
education
effective-kotlin
effectivekotlin
emacs
embedded-kotlin
estatik
event21-community-content
events
exposed
failgood
fb-internal-demo
feed
firebase
flow
fluid-libraries
forkhandles
forum
fosdem
fp-in-kotlin
framework-elide
freenode
french
fritz2
fuchsia
functional
funktionale
gamedev
ge-kotlin
general-advice
georgia
geospatial
german-lang
getting-started
github-workflows-kt
glance
godot-kotlin
google-io
gradle
graphic
graphkool
graphql
graphql-kotlin
graviton-browser
greece
grpc
gsoc
gui
hackathons
hacktoberfest
hamburg
hamkrest
helios
helsinki
hexagon
hibernate
hikari-cp
hire-me
hiring
hongkong
hoplite
http4k
hungary
hyderabad
image-processing
india
indonesia
inkremental
intellij
intellij-plugins
intellij-tricks
internships
introduce-yourself
io
ios
iran
israel
istanbulcoders
italian
jackson-kotlin
jadx
japanese
jasync-sql
java-to-kotlin-refactoring
javadevelopers
javafx
javalin
javascript
jdbi
jhipster-kotlin
jobsworldwide
jpa
jshdq
juul-libraries
jvm-ir-backend-feedback
jxadapter
k2-early-adopters
kaal
kafka
kakao
kalasim
kapt
karachi
karg
karlsruhe
kash_shell
kaskade
kbuild
kdbc
kgen-doc-tools
kgraphql
kinta
klaxon
klock
kloudformation
kmdc
kmm-español
kmongo
knbt
knote
koalaql
koans
kobalt
kobweb
kodein
kodex
kohesive
koin
koin-dev
komapper
kondor-json
kong
kontent
kontributors
korau
korean
korge
korim
korio
korlibs
korte
kotest
kotest-contributors
kotless
kotlick
kotlin-asia
kotlin-beam
kotlin-by-example
kotlin-csv
kotlin-data-storage
kotlin-foundation
kotlin-fuel
kotlin-in-action
kotlin-inject
kotlin-latam
kotlin-logging
kotlin-multiplatform-contest
kotlin-mumbai
kotlin-native
kotlin-pakistan
kotlin-plugin
kotlin-pune
kotlin-roadmap
kotlin-samples
kotlin-sap
kotlin-serbia
kotlin-spark
kotlin-szeged
kotlin-website
kotlinacademy
kotlinbot
kotlinconf
kotlindl
kotlinforbeginners
kotlingforbeginners
kotlinlondon
kotlinmad
kotlinprogrammers
kotlinsu
kotlintest
kotlintest-devs
kotlintlv
kotlinultimatechallenge
kotlinx-datetime
kotlinx-files
kotlinx-html
kotrix
kotson
kovenant
kprompt
kraph
krawler
kroto-plus
ksp
ktcc
ktfmt
ktlint
ktor
ktp
kubed
kug-leads
kug-torino
kvision
kweb
lambdaworld_cadiz
lanark
language-evolution
language-proposals
latvia
leakcanary
leedskotlinusergroup
lets-have-fun
libgdx
libkgd
library-development
linkeddata
lithuania
london
losangeles
lottie
love
lychee
macedonia
machinelearningbawas
madrid
malaysia
mathematics
meetkotlin
memes
meta
metro-detroit
mexico
miami
micronaut
minnesota
minutest
mirror
mockk
moko
moldova
monsterpuzzle
montreal
moonbean
morocco
motionlayout
mpapt
mu
multiplatform
mumbai
munich
mvikotlin
mvrx
myndocs-oauth2-server
naming
navigation-architecture-component
nepal
new-mexico
new-zealand
newname
nigeria
nodejs
norway
npm-publish
nyc
oceania
ohio-kotlin-users
oldenburg
oolong
opensource
orbit-mvi
osgi
otpisani
package-search
pakistan
panamá
pattern-matching
pbandk
pdx
peru
philippines
phoenix
pinoy
pocketgitclient
polish
popkorn
portugal
practical-functional-programming
proguard
prozis-android-backup
pyhsikal
python
python-contributors
quasar
random
re
react
reaktive
realm
realworldkotlin
reductor
reduks
redux
redux-kotlin
refactoring-to-kotlin
reflect
refreshversions
reports
result
rethink
revolver
rhein-main
rocksdb
romania
room
rpi-pico
rsocket
russian
russian_feed
russian-kotlinasfirst
rx
rxjava
san-diego
science
scotland
scrcast
scrimage
script
scripting
seattle
serialization
server
sg-user-group
singapore
skia-wasm-interop-temp
skrape-it
slovak
snake
sofl-user-group
southafrica
spacemacs
spain
spanish
speaking
spek
spin
splitties
spotify-mobius
spring
spring-security
squarelibraries
stackoverflow
stacks
stayhungrystayfoolish
stdlib
stlouis
strife-discord-lib
strikt
students
stuttgart
sudan
swagger-gradle-codegen
swarm
sweden
swing
swiss-user-group
switzerland
talking-kotlin
tallinn
tampa
teamcity
tegal
tempe
tensorflow
terminal
test
testing
testtestest
texas
tgbotapi
thailand
tornadofx
touchlab-tools
training
tricity-kotlin-user-group
trójmiasto
truth
tunisia
turkey
turkiye
twitter-feed
uae
udacityindia
uk
ukrainian
uniflow
unkonf
uruguay
utah
uuid
vancouver
vankotlin
vertx
videos
vienna
vietnam
vim
vkug
vuejs
web-mpp
webassembly
webrtc
wimix_sentry
wwdc
zircon
Powered by Linen
feed
  • s

    s1m0nw1

    10/03/2019, 7:25 PM
    Learn about one of the most interesting HTTP tools for Kotlin:
    http4k
    :kotlin-flag: https://kotlinexpertise.com/kotlin-http4k/
    👍 4
    ❤️ 2
    j
    • 2
    • 1
  • p

    pablisco

    10/08/2019, 1:03 PM
    We’ve just announced an event about Kotlin in London at the end of November: https://twitter.com/KotlinDay/status/1181550599218880513 Hope to see you there 🙂
    🍻 3
    :kotlin-flag: 1
    s
    s
    • 3
    • 6
  • s

    sashjakk

    10/09/2019, 7:11 AM
    Hey, my first attempt on blogging about code generation with :kotlin: Will be glad to hear about your similar experience 😊 https://link.medium.com/BoaxGjNGD0
    👍 1
    m
    • 2
    • 1
  • t

    TanVD

    10/14/2019, 10:30 AM
    Hi all! Kotless version 0.1.1 was released (https://github.com/JetBrains/kotless) Kotless stands for Kotlin serverless framework, it aims to reduce the routine of serverless deployment creation and generates it straight from the code of the application itself. Right now it supports deployment to AWS of API Gateway, scheduled jobs, granular permissions granting, static resources and so on. Take a look and join the discussion in #kotless
    :kotlin: 8
    🌩️ 1
    🔝 5
    🤩 2
    g
    k
    r
    • 4
    • 5
  • m

    marcinmoskala

    10/21/2019, 8:02 PM
    https://blog.kotlin-academy.com/the-problem-with-extension-functions-dffd22eb5df9
    :kotlin: 1
    ⭐ 1
    👌 1
    🙁 2
    l
    t
    a
    • 4
    • 18
  • l

    louis993546

    10/22/2019, 6:45 AM
    https://medium.com/@louis993546/mental-models-of-jetpack-compose-3-inheritance-composition-and-why-they-matter-9a04dc874511
    👍 1
    c
    • 2
    • 2
  • s

    Simon Schubert

    10/24/2019, 8:28 AM
    Kotlin Mulitplatform - Jetpack Compose/SwiftUI/CLI/Web - Math, Memory, Focus Trainer App 🧠 https://braincup.schubert-simon.de - Web version is free and ios/android app will be free too tomorrow
    m
    s
    b
    • 4
    • 10
  • a

    adrianbukros

    10/28/2019, 10:15 AM
    https://www.kotlindevelopment.com/inline-classes/
    👍 20
    👏🏻 2
    c
    a
    • 3
    • 3
  • h

    Hitanshu Dhawan

    10/30/2019, 1:43 AM
    JsonDSL It is a DSL in Kotlin for creating your JSON in a more easy and readable way. Do check it out! https://github.com/hitanshu-dhawan/JsonDSL
    👍 9
    🤔 5
    👎 3
    c
    d
    • 3
    • 4
  • a

    alex009

    10/30/2019, 4:15 PM
    Hi everyone, We at IceRock have published our MOKO libraries for Kotlin Multiplatform mobile development . Please see the full list of libs on the landing page: https://moko.icerock.dev MOKO includes: • architecture lib - MVVM components; • mobile specific libs - runtime permissions, localization resources, media access; • codegeneration for ktor-client; • composite items for RecyclerView/UITableView/UICollectionView from common code (from ViewModel in our case); • @Parcelize support. We also have a MOKO template project on GitHub (https://github.com/icerockdev/moko-template) for a fast start. In the template project you can see: • kotlin multiplatform project for ios and android with kotlin gradle dsl; • multi-module architecture; • example of two features (form and list of items); • integration of multiplatform library in an ios app via cocoapods. We'll be happy to hear from you on the #moko channel.
    :kotlin: 7
    👍 17
    👏 10
    k
    t
    +3
    • 6
    • 6
  • n

    nfrankel

    11/03/2019, 5:51 PM
    https://blog.frankel.ch/kotlin-operators/
    t
    d
    • 3
    • 3
  • j

    jmfayard

    11/04/2019, 9:01 AM
    Java and Javascript are similar like Car and Carpet are similar.
    I am a backend developer, but two thirds of the job offers I get are Android related. This was getting annoying so I wrote down this simple reminder to clear out the confusion: => Kotlin is not, in fact, the same thing as Android Feel free to use this if you get unsollicited offers to do Android development. https://blog.kotlin-academy.com/kotlin-is-not-android-c96984730c35
    👍 18
    👎 1
    m
    • 2
    • 1
  • d

    Dariusz Kuc

    11/05/2019, 3:20 PM
    Hello! We just published a first story in a series that highlights different parts of
    graphql-kotlin
    library. Post today highlights how
    graphql-kotlin-schema-generator
    can be used to generate your GraphQL schemas directly from your source code - https://medium.com/expedia-group-tech/creating-graphql-schemas-in-kotlin-aaaac0ab0672 Stay tuned for the next posts in the series that will highlight federation and spring server modules!
    👍 6
    s
    • 2
    • 7
  • g

    gaetan

    11/08/2019, 7:18 AM
    https://blog.data2viz.io/post/ktor-vs-axios-vs-for-kotlin-js/
    👍 2
    r
    t
    • 3
    • 6
  • m

    marcinmoskala

    11/12/2019, 11:59 AM
    https://blog.kotlin-academy.com/mastering-kotlin-scoped-and-higher-order-functions-23e2dd34d660
    🤲 1
    👌 17
    g
    • 2
    • 1
  • j

    jmfayard

    11/18/2019, 9:06 AM
    Necessity is the mother of all inventions. I had no MacBook Pro available so I investigated what kind of programming I could do on my Chromebook. Answer: Chromebook can do more than what you think. It's not perfect but there is a lot of potential. You can run all Android apps, Debian Strech or another Linux container, IntelliJ IDEA, Android Studio, Visual Studio Code, .... https://dev.to/jmfayard/coding-on-a-chromebook-4pmp
    👍 2
    s
    s
    +5
    • 8
    • 47
  • s

    s1m0nw1

    11/21/2019, 7:19 AM
    Serverless Kotlin via OpenFaaS, the most popular open-source FaaS framework: https://kotlinexpertise.com/serverless-kotlin/
    👍 5
    🛑 1
    n
    h
    • 3
    • 20
  • m

    marcinmoskala

    11/25/2019, 7:13 AM
    https://blog.kotlin-academy.com/show-download-progress-in-a-recyclerview-with-ktor-client-and-flow-asynchronous-data-stream-9debab3d2cb6
    z
    a
    • 3
    • 2
  • a

    ankushg

    11/26/2019, 5:27 AM
    Just published my blog post about shared code at Quizlet -- and why we're now using Kotlin Multiplatform to power (very specific) business logic for over 50 million learners around the world per month: https://medium.com/tech-quizlet/shared-code-at-quizlet-kotlin-multiplatform-2ee1b57646c?source=friends_link&sk=f7c864464fe94552ed208e96b8a897f5 (Will also be giving a talk with real perf numbers at droidcon SF tomorrow at 3pm for folks who are there!)
    👍 13
    m
    • 2
    • 1
  • p

    pablisco

    11/26/2019, 12:27 PM
    https://twitter.com/KotlinDay/status/1199301795677425665
    :kotlin: 2
    😸 2
    n
    • 2
    • 1
  • k

    kpgalligan

    11/27/2019, 12:08 AM
    https://twitter.com/kpgalligan/status/1199479922663686144?s=20
    🎉 4
    t
    a
    • 3
    • 5
  • m

    marcinmoskala

    11/29/2019, 2:20 PM
    https://blog.kotlin-academy.com/effective-kotlin-printed-version-1076df1607bd
    👏 19
    ❤️ 3
    📖 6
    👍 10
    s
    • 2
    • 1
  • d

    Dariusz Kuc

    12/03/2019, 2:30 PM
    Hello! We just published a third story in a series that highlights different parts of
    graphql-kotlin
    library. Post today highlights how easy it is to create reactive GraphQL web applications in Kotlin using
    graphql-kotlin-spring-server
    -> https://medium.com/expedia-group-tech/creating-a-reactive-graphql-server-with-spring-boot-and-kotlin-54aca7316470 We will be presenting
    graphql-kotlin
    this Thursday @kotlinconf (4:15 GMT+1). You can sign up for the streams at https://kotlinconf.com/
    😒uspend: 2
    :kotlin: 2
    ❤️ 2
    c
    n
    s
    • 4
    • 4
  • j

    Joris PZ

    12/03/2019, 7:37 PM
    https://medium.com/ing-blog/introducing-kotlin-at-ing-a-long-but-rewarding-story-1bfcd3dc8da0
    👍 1
    d
    • 2
    • 2
  • m

    Madalin Valceleanu

    12/04/2019, 8:17 AM
    📚 Android Sample App using modular, clean, scalable, testable Architecture written in Kotlin that presents modern 2019 approach to Android application development, latest tech-stack and best practices. Application is based, apply and strictly complies with each of the following 5 points: • A single-activity architecture, using the Navigation component to manage fragment operations. • Android architecture components, part of Android Jetpack give to project a robust design, testable and maintainable. • Pattern Model-View-ViewModel (MVVM) facilitating separation of development of the graphical user interface. • S.O.L.I.D design principles intended to make software designs more understandable, flexible and maintainable. • Modular app architecture allows being developed features in isolation, independently from other features. For more technical details please check the project readme. Project link: https://github.com/VMadalin/kotlin-sample-app
    💯 3
    👍 7
    m
    • 2
    • 12
  • l

    LeoColman

    12/09/2019, 11:27 PM
    I know not many people need this kind of tool, but... We just released a new version of Fixed Length File Parser! 😄 🎉 https://github.com/GuiaBolso/fixed-length-file-handler/releases/tag/0.3.0
    👍🏻 6
    b
    • 2
    • 3
  • t

    Tim Schraepen

    12/10/2019, 9:58 AM
    Doing #AdventOfCode challenges in Kotlin. Live from the Kunlabora offices! Come help me out! <https://twitch.tv/livecodingwithsch3lp>
    👍 2
    c
    • 2
    • 2
  • m

    Malvin Sutanto

    12/10/2019, 10:08 AM
    <https://medium.com/wantedly-engineering/managing-android-multi-module-project-with-gradle-plugin-and-kotlin-4fcc126e7e49>?
    👏 1
    t
    • 2
    • 1
  • c

    Casey Brooks

    12/10/2019, 4:30 PM
    I’m releasing a major update to Orchid today, which includes significant improvements to its Dokka integration https://twitter.com/OrchidSSG/status/1204433075586949120
    👍 3
    a
    m
    • 3
    • 3
  • n

    nfrankel

    12/15/2019, 6:13 PM
    https://blog.frankel.ch/even-more-readable-code-without-if-else/
    d
    t
    a
    • 4
    • 12
Powered by Linen
Title
n

nfrankel

12/15/2019, 6:13 PM
https://blog.frankel.ch/even-more-readable-code-without-if-else/
d

Daniel

12/15/2019, 7:44 PM
Hi and a huge thanks for your blog! Its a nice exercise but to be honest I would ding it in a code review. The resulting code need in my opinion much more "brain processing power" to unserstand than the simple if else. There is too much happening in the lines of code. Use some private methods
if(..) {
 doSomething()
} else if(...) {
 doSomethingElse()
}
and you are good to go and will understand it even after you were away from the code for some time
💯 5
On top of it you loose a lot of flexibility. You can rewrite the code once there is a case in the future where the signatures of the "do" methods differ
n

nfrankel

12/15/2019, 9:28 PM
Hi and a huge thanks for your blog!
thanks 🙂
You can rewrite the code once there is a case in the future where the signatures of the “do” methods differ
if believe this is pretty clear if you don’t want to go the full way on the opposite, i would advise to start with the full map things, and only then revert one level back if the signatures start diverging
in all cases, i appreciate your input 👍
d

Daniel

12/15/2019, 9:48 PM
Its really nice to talk about this stuff! 🙂 For example the one dimensional mapping ("A" to 1) I find a really great idea. Only once things go beyond this I personally find it hard to grasp. Its really a fine line in programming!
n

nfrankel

12/15/2019, 10:08 PM
Its really a fine line in programming!
yep, i wouldn’t bet any part of my anatomy on it
t

thana

12/16/2019, 7:30 AM
I don't get it. Why would you put your stuff in a map, when, instead, you could easily write
when(input) {
  "A" -> 1
  "B" -> 2
  "C" -> 3
}
? And taking that further, imagine a scenario where you'd be tempted to use a
sealed class
or an
enum
as map keys? Why give up on the exhaustiveness check?
👍 3
a

Alexander Romanov

12/16/2019, 3:10 PM
yeap, it sounds a bit like bringing java tricks into kotlin I was doing similar stuff in C#, but in Kotlin
when
is as expressive, so map doesn’t bring anything to the table
n

nfrankel

12/16/2019, 3:38 PM
i believe it does if you have multiple clauses to check you might try yourself with 2
&&
it’s imho much harder to read
a

Alexander Romanov

12/16/2019, 3:44 PM
when (var1 to var2) {
"a" to "b" -> …
"a" to "c" -> …
}
✔️ 1
👍 1
and of course you are not limited to pair, you can use any other data class. In a domain where this kind of code makes sense, probably there is a better name than Pair for the combination of those two keys
n

nfrankel

12/16/2019, 4:44 PM
ah, ok, you still match on
Pair
i understand
View count: 2