Types of Internal Representation of Kotlin code
- 3 minutes to read
- 719 words
- Comments
In this post we will briefly describe different Internal Representations provided by Kotlin compiler. Kotlin compiler requires several stages to parse and preprocess the code. And the main thing that should be done by compiler to process the code is to build proper intermediate representation.
Writing our own compiler plugin for serialization using Kotlin
- 9 minutes to read
- 1688 words
- Comments
Serialization and deserialization - are two sides of the same mechanism for storing (persisting) of objects or sending these objects over the network. There are a lot of different formats used for serialization. In general they can be split into two main groups: binary protocols (pickle, protobuf and many other) and protocols with a string representation like json, toml, yaml, csv, e.t.c. We know a lot of different libraries for the serialization in Java, but in Kotlin it was decided to create a common framework for the serialization called kotlinx.serialization. Let’s have a look how this framework works and try to write our own serializer.
Tricky Java puzzlers (part1)
- 10 minutes to read
- 1840 words
- Comments
In a modern world the developer spends 80% of his time on Code Reading. So it is extremely important for him to read the code from the “whiteboard”. Understanding of the code written by some other author can be more important than to write your own code. That’s why on interviews to “good” companies or on Java certification exam you could be asked to read simple snippets of code and tell what is the code doing. Solving such puzzlers is also useful for your daily routine as this helps you to understand the code more quickly and refreshes your knowledge of core language specifics. And the last but not the least - finally it is fun and trains your brain! So I have collected such puzzlers for you: some of them were created by me, some of them were taken from interviews, and some were taken from the Java OCA exam. Enjoy it! Read the code below and answer what is this code doing.