Posts

Showing posts with the label kotlin

Functional Programming in Kotlin

Image
Kotlin is an interesting JVM language. Today I want to show some capabilities Kotlin has around Functional Programing. FP is a very interesting way to think and create safe programs. Today we will cover High Orde Functions, Lambdas, and also Class extensions. So today I made a simple video and code POC. Let's get started! The Video The Code https://github.com/diegopacheco/kotlin-playground/tree/master/kotlin-fp-fun Cheers, Diego Pacheco

Generics in Kotlin

Image
Kotlin is an interesting JVM language. Today I want to show some capabilities Kotlin has around Generics. Generics are super important for any language. However, some languages abuse generics and have gaps. Generics are important for code reuse and also to enforce type constraints for safety. Kotlin has some interesting ways to express type constraints. So today I made a simple video and code POC. Let's get started!

Reflection in Kotlin

Image
Kotlin is an interesting JVM language. Today I want to show some capabilities Kotlin has around Reflection. Reflection is needed to perform some generic computations often to reuse code around some metadata processing. Kotlin separates Java and Kotlin classes(KClass) and has utility methods around them. So I made a simple POC and Video. Let's get started!

Strings in Kotlin

Image
Kotlin is an interesting JVM language. Today I want to show some capabilities Kotlin has around Strings. Strings are bread and butter or everyday work of any programing language. Strings are a basic type that can either be simple and pleasure or a nightmare i.e go look at Strings in Erlang.  Strings are pretty easy and cool in Kotlin. So I made a short video and some simple POC going over some String features in Kotlin. Let's get started!

Insert Koin: Fast DI in Kotlin

Image
Dependency Management is the oldest tricky of the book. DI is useful not only to make it easier to configure a system but also to make it more extensible and testable. Koin is a very lightweight DI framework for Kotlin. Koin is fast, minimalistic, simple, and yet powerful. Today I want to show we can use Koin is a kotlin simple code I build and also how we can do Unit Tests using JUnit 5 and Koin. So Let's get started.

Kotlin: With, TakeIf and Let

Image
Kotlin has interesting standard APIs and an eco-system. Today I want to cover 3 interesting features in the kotling language: With, TakeIF, and Let. In order to cover that language features on the std SDK, we will end up touching other concepts such as Sring Interpolation / EL and also one of the biggest and interesting language Design choices in Kotlin: The Elvis Operator. I see lots of influence from Scala and Groovy on Kotlin. 

Kotlin DSL

Image
DSL is an expressive way to declare data and even business rules or configurations.DSLs can either be internal or external. Kotlin has interesting support for building internal and external DSLs. 12 days of Kotlin is a great way to learn more about kotlin-idiomatic solutions. Today I will be exploring the 12 days of kotling posts  in regards to DSL we will understand how they work and what options does kotlin provide to build rich DSLs.  So I recorded a video and also coded the sample of the 12 days of kotling post. So Let's get started.  The Video The Code https://github.com/diegopacheco/kotlin-playground/tree/master/kotlin-dsl-fun Cheers, Diego Pacheco

Kotlin with Maven

Image
Kotlin is a modern language on the JVM. Created by JetBrains . Kotlin got popular with Android and Gradle however I would say it's an interesting solution also well for backend services. Kotlin has some interesting design choices and handy APIs and a good eco-system, which I will be covering in the next posts. Today I want to show how we can get Kotlin working on IntelliJ IDEA using maven as a build system. Most of the examples you will set out there on the web will be Gradle-based. Don't get me wrong Gradle rocks but maven still the dominant build system in Java land.  So we will see how to configure the build plugins and all dependencies needed in order to make no only Kotlin builds but also integration with Junit and unit tests. So Let's get started. The Video The Code https://github.com/diegopacheco/kotlin-playground/tree/master/kotlin-1.4-fun Cheers, Diego Pacheco

Spring-Boot-2 with Kotlin

Image
Kotlin  is a Jetbrains language that has lots of inspiration from Scala. Spring-boot-2 is a popular solution for microservices like Quarkus and Micronaut . Today I want to share a simple video I made so you can get started with Maven, Spring-Boot-2, and Kotlin. If you are new to Kotlin I also recommend seeing my previous post about the language. Okay, let's get started. 

Kotlin 101

Image
Kotlin is a JVM language created by JetBrains in 2011. Google declared the official preferred language for Android in 2019. Kotkin is heavily inspired in Scala . Kotlin claims to have the good parts of scala without having the bad parts. It's also possible to see some Python and Groovy influence as well. Kotlin makes java much less verbose and has awesome support in sense of IDE thanks to IntelliJ. I'm a Scala guy and prefer scala, however, kotling is an interesting choice especially if you are making android native apps. So today I want to share a video I made with a good walkthrough through several features of the language in a Maven project. So Let's get started!