Learn Kotlin with the Kotlin Team: Advent of Code 2020 #8

preview_player
Показать описание
Let's learn some Kotlin by solving Advent of Code 2020 puzzles!
Today we’re solving the eighth Advent of Code challenge in idiomatic Kotlin. We will be simulating, diagnosing, and fixing a small, made-up game console! If you have ever wanted to implement your own virtual machine or emulator for an existing system like a game console or a retro computing device, you’ll find this issue particularly interesting!

As usual, a number of Kotlin features will help us achieve that goal, like sealed classes, sequences, and immutability.

Day 8: Handheld halting
Apply sealed classes and lambdas to represent instructions, apply Kotlin sets to discover loops in the program execution, use sequences and the sequence { } builder function to construct a lazy collection, and try the experimental 'measureTimedValue' function to check performance metrics.

* Used with the permission of Advent of Code (Eric Wastl)

#Kotlin #Idiomatic #Tutorial #AdventOfCode #AdventOfCode2020 #AdventOfСodeInKotlin #Day8
Рекомендации по теме
Комментарии
Автор

Immutability is great to scale application with all compile time safety against mistakes, and not to mention easy testability

vikrantghadge
Автор

Perfect video. Well delivered. Kudos to ya'll.

Also, I am a mutability freak. To hell with perf

andy_lamax
Автор

I wish kotlin compiler could optimize copy method of data classes to smartly predict and mutate the source object instead of creating new one if source object is known to be collected, this will reduce gc overhead w/o sacrificing code safety

vikrantghadge