Building with Gradle Kotlin DSL 1.0

Big News!  (Aug 2018) After what seems like the longest time, Gradle support for using kotlin to drive gradle builds is now at version 1.0.  This is the best time for anyone to move to gradle.  This page is an introduction to gradle, using kotlin DSL What is a build tool? Which Build Tool? Basic… Continue reading Building with Gradle Kotlin DSL 1.0

Advertisements

Building in Intellij IDEA

This program is relevant for building your first "hello world" and first sample kotlin apps.  However, once you have even hello world running, it is recommended now to move to gradle for building, even when building with Intellij. The topics for this page: Introduction: why use Intellij at all. The Roles on an IDE What… Continue reading Building in Intellij IDEA

self, this + modifiers: private, public, protected, internal, open, final, inline

contents: self vs this this@ external attribute access why bother? python modifiers visibility inheritance: open, final, override inline self vs this Self vs this are not technically modifiers, but they do work in a similar way, to modify that 'self.name' can be different from 'name'. Code inside a class must work without an actual instance… Continue reading self, this + modifiers: private, public, protected, internal, open, final, inline

Python to Kotlin: Variables and Types

Contents: python kotlin boxed objects vs unboxed primitives None, Nothing, Unit and null null safety Python Variables and Types As explained in the background, all values in python are objects stored in dynamic 'heap' memory, and variables are simply references to these objects. This means the only static or stack frame based information for any… Continue reading Python to Kotlin: Variables and Types

Nullable, null, None, Unit, Nothing and void: the many faces of nothing

Python has only one way of saying 'there is nothing here':  None.  Java has the keyword 'void' and the value 'null', kotlin has Unit, Nothing and null.  What is the actual difference in meaning for all of these? Python None Kotlin Unit, null and Nothing Java void and null The concept of 'Nullable' Null Safety… Continue reading Nullable, null, None, Unit, Nothing and void: the many faces of nothing

Extension Functions & Extension Properties

The syntax and rules of extension functions are explained also explained elsewhere,  but this page is more tutorial style, covers the background and  'why do we need extensions'  and 'what is the benefit',  together with simple examples, and even useful examples. The topics are: What are extension functions/properties? What is the advantage of extension functions?… Continue reading Extension Functions & Extension Properties

What is a DSL?

With Kotlin the term ‘Kotlin DSL’ usually refers to DSLs built in Kotlin using specific Kotlin features (as discussed in 'Kotlin DSLs'), this page, however, is about DSLs in general. Introduction: DSL: The general definition DSL vs 'a DSL' The Types of DSL: External DSL Internal Detached DSL Internal Augmentation DSL Detached vs Internal DSL:… Continue reading What is a DSL?