22 giugno 2018
Milan Kotlin Community Conf

Thursday June 14th, Istituto Piero Pirelli: a piece of history has been written.

The first Italian one-day conference about Kotlin happened!

Everything started with the check-in moment where we welcomed attendees and speakers to give them badge, t-shirt, and stickers of Intré, Agile ReloadedMolo17 (the sponsors of the event), Kotlin and Alf.io (big thanks to Celestino for his pleasantness and for helping us during the day: please take a look at Swicket.io for more info about the ticketing system we used)

After the check-in stage, everything was ready and Kotlin conference officially started (as Johan Duque kindly suggest in this picture)!

Keynote and all the talks were held in two different rooms named Elvis ?:D and Lambda {it} (a little Kotlin joke, of course)

Nando has opened the conference telling everyone how this conference was born.

So let’s get started!
Since I’m not a super-hero (I don’t have the ubiquity super power 🙂 ) below I will tell you something about the talks I personally followed.

Multi-platform Kotlin projects

Victor Kropp, software Engineer at JetBrains, talked about the advantages of adopting Kotlin as language in a multi-platform project.

Nowadays for any type of software project we work for, we tend to use different languages for the frontend and the backend, each of these certainly has it’s pros and cons:

  • Android: Java, Kotlin…
  • iOS: Objective C, Swift…
  • Desktop application: C++, C, C#…
  • Backend: Java, Python, Ruby…

Victor says: “Switching between different languages is never easy, what about considering to use only one language for the whole project?”
Kotlin is the answer!

Here is why:

  • It could be used for all platforms
  • The team can speak a same language
  • The team can work for all set of application
  • Fullstack development gets simplified
  • Having the code written in the same language is more maintenable
  • Knowledge transfer process could take less time

Victor explained us how to organize the architecture for a multi-platform project using Kotlin modules module and platform, and last but not least, demo time, a TO-DO list application with some web-server code (get, post, put), html page and error handling. Everything written using Kotlin common modules and libraries:

To recap in three short bullet points:

  • Consider using Kotlin in multi-platform application
  • Reuse business logic and data structure
  • Kotlin is as power as cool!

Thank you Victor!

Functional programming triage

Francesco Sacchi made a wonderful introduction to functional programming, trying to answer two questions: “What is functional programming?” and “Why should I adopt it?”.

Not having any luck finding a good compact definition online, Francesco has made his own: “Functional programming is a style that maximizes readability“.

Readability is a very important aspect of the code we write: our code will necessarily be read by people, even ourselves, in order to fix bugs, add new features, adapt and evolve the code. And often, lot of time is spent reading code, but few time is actually spent writing it. For that reason we, as professional developers, want to increase the readability of our code, so functional programming is a style that helps us with that.

As for the language, Kotlin has a good support for functional programming with some interesting features:

– first class functions
– dsl support
– extension functions
– data classes and typealiases
– tail call optimization

Building DSL in Kotlin for fun and profit

Zan Markan started his talk about Domain Specific Language in Kotlin, showing us the pros:

  • Adapting the language
  • Allowing non-dev to read code
  • Readability
  • Save time on repetitive things (method, class…)

and cons:

  • Learning curve and maintainability
  • Adopting DSL can cause unintended side-effects

What is the difference between internal and external DSL?
An internal DSL live inside the host language while an external DSL depends on your application domain

We have everywhere DSL:

  • grep, wc, ls, sort (text processing in Unix)
  • hamcrest (testing)
  • gradle, make (configuration)

In Kotlin, one of the most popular DSL is Anko (simplify Android application development), or gradle Kotlin DSL for build definition.

Kotlin is not only DSL compliant. It gives us other cool features:

  • Type aliases
  • Extension function
  • Lambda expression
  • Named arguments
  • Default values
  • Infix functions
  • Function literals with receiver
  • Operator overloading

An interesting introduction, but even more interesting live! Zan decided to show us all these features during his demo. Hands on code, he wrote a DSL step by step writing code about type aliases, overloading operators, infix functions and function literals.
It was very funny and interesting, well done Zan!

Kotlin beyond Android

As an Android developer you probably tried Kotlin the day it was announced as supported, then you loved it. Feeling a bit more comfortable with the language, you probably wondered “what else could I do?”.

Guillermo Orellana tried to answer that question.

He started showing us some screenshots of  his first app made in Kotlin, talking about similarities about expectation and excitation, pros and cons of adopting this language.

In his demo, he didn’t want show us a typical TO-DO list (no offence Victor, he was kidding 🙂 ) but another application fully written in Kotlin:

  • Web: Kotlin meet Javascript, Kotlin to Javascript… what about with types? No problem, dynamic keyword resolve the problem!
  • UI: Kotlin meet ReactJs
  • Backend: stop using Node.js, but consider other framework as Vert.x, Spring or Ktor (Kotlin native, easy to use)

Guillermo also showed us some examples of promise implementation in Kotlin, and last but no least, a live demonstration of  doku, a module that deploy an application just pushed via git.

Funny, rousing and interesting talk, Guillermo!

From Java to Kotlin beyond Alt+Shift+Cmd+K

Do you need to convert your Java code to Kotlin code?
Using Android Studio, the magic happens with the simple Alt + Shift + Cmd + K combination.
But the new syntax is just the beginning, using Kotlin we can improve our code making it more readable and simpler to write.
That’s what Fabio Collini is about to share with us!

Starting from a classic Java code that create a list and make some operations of its data, Fabio has converted into the equivalent Kotlin listOf<T> using map, filter, distinct, sortedBy, joinToString methods.
The code was more readable, shorter (line of codes) and less complex compared with the equivalent written in Java8 using Stream.
What if you want add\remove\modify data of a list in Kotlin? Simply use MutableList<T> instead of listOf<T>.
And what about map? Fabio showed us how to add key;value into map using x to y where to is an example of infix function.

Fabio covered other interesting topics like:

  • companion objects, properties in a Kotlin class that can be compared to static properties obtained  in Java using keyword static
  • Kotlin coroutines: difference between sleep method used in Java and delay method used in Kotlin; example of thread management in Kotlin
  • delegates

It was a very interesting talk, Fabio shared with us not only technical info but his passion for Kotlin 🙂

Kotlin in legacy apps

Federico Oldrini talked about his experience on adopting Kotlin in a legacy project.
What’s the best way to prove it? Show your code, Federico! So he decided to do this using a class of an Android project he worked for.

The first step was to convert the Java code in the equivalent in Kotlin using the feature provided by the Android Studio IDE.
The worst is yet to come…the converted code was full of errors related to wrong import, old method calls.
These kind of errors are easy to resolve, but technical debt remains.
Why?

  • Classes written along years, written by different people
  • Old API’s used in classes
  • Code written to respond to big feature requests

Fighting against the “monster” of technical debt is never easy, but Kotlin is a powerful weapon.
Federico proved that writing a classic Java class that describe a person: attributes, getter and setter.
Some lines of code.
In Kotlin? One unique row.

Thanks Federico, we’ll win the war, and Kotlin will give us a great help!

Everyone can build a REST service with Kotlin

Andrea Maglie spent his time to explain us how to organize the architecture to build a REST service for a Google assistant application.
The architecture is composed by DialogFlow, a Google-owned developer of human–computer interaction technologies based on natural language conversations, webhook, a Backend and a database.

DialogFlow is a good solution because it’s free, and it’s integrated into Google Platform. It analyzes a phrase, or question, to get the most important word, or keys. These keys needs to be sent to something that “queries” a database.
How to do that? With webhooks.
After that, the webhook communicates with the back-end that realizes the communication with the database.

Why should we choose Kotlin for our back-end instead of Javascript or Node.js?
Because Kotlin is easy to use and for its short learning curve when adopted to implement a REST server.
Andrea explained how to implement the back-end using Spark framework, showing us a simple web-server Kotlin code that exposes a simple “hello” endpoint.
From this simple code, Andrea showed us an example of POST request and than Ngrok to test our web-server.
Before leaving, Andrea talked a little about mockk.io, a Kotlin library for unit testing.

Interesting talk, we all now a little bit how to write a DialogFlow application using Kotlin. Thanks Andrea!

Closing remarks

It was an exciting journey, lot of code and nice people. Before leaving Fabio, a business partner of Intré and chairman of Italian Agile Movement spent some words to thank all the sponsors that make this conference possible, the first agile venture event.
It’s time to go back home guys!
I hope every attendees and readers enjoy this article but…wait a moment! Everybody in Elvis room for ruffle time!


Damiano (with me in this picture) used his Kotlin written program to give some prizes to the lucky present attendees (using one simple rule: who leaved, leaved. Who remained, can partecipate to the lottery).

Prizes were:

  • Kotlin books
  • Kotlin e-books
  • JetBrains All Products Pack licenses

 

After this funny moment, it was really time to go.
We want to thank you all again for made this event possible, and remember that for attendees there is 40% discount: ctwkotlinconf18 (thanks to Manning).

Tag
Intré Camp – 26 Giugno 2018

Racconto del camp aziendale svoltosi all'agriturismo La Camilla

Agile Venture Prato 2018

Il racconto della giornata della prima edizione di un agile venture in quel di Prato.

A reactive programming example
Milan Kotlin Community Conf

The first Kotlin related Italian conference made from the community to the community!

Let's see how was it...

DroidCon IT, Turin, 19 & 20 April 2018: our report
Milan Kotlin Community Conference

How, why and what has lead us to the Milan Kotlin Community Conference.

Intré Camp – 13 Febbraio 2018

Racconto del camp aziendale svoltosi a Pontida, agriturimo Polisena

Vert.x – 4o articolo su Mokabyte!

4o articolo sul mondo Vert.x a cura di Marco

Vert.x – 3o articolo su Mokabyte!

3o articolo sul mondo Vert.x a cura di Marco

NoSlidesConf 2017

NoSlidesConf: una conferenza diversa dal solito

Vert.x – 2o articolo su Mokabyte!

2o articolo sul mondo Vert.x a cura di Marco

Vert.x – 1o articolo su Mokabyte!
IAD Urbino 2017 – Conferenza 18 Novembre

Racconto della conferenza presso l'università degli studi Carlo Bo di Urbino

IAD Urbino 2017 – Unconference 17 Novembre

#IAD17: Racconto della giornata di unconference presso l'Università degli Studi Carlo Bo di Urbino

Intré Camp – 5 Ottobre 2017

Racconto del camp aziendale svoltosi all'agriturismo La Camilla

Intré Camp – 18 Maggio 2017

Resoconto del camp aziendale svoltosi all'Oasi di Galbusera Bianca

CloudConf Torino 2017

CloudConf 2017 a Torino. Come è andata?

Mini IAD Vimercate 2017

Il racconto della giornata al Mini Italian Agile Day tenutasi a Vimercate.

Codemotion Milano 2016

Nel week-end del 25-26 novembre 2016 si è svolto il Codemotion Milano 2016.
Francesco Sacchi e Ferdinando Santacroce ci raccontano com'è andata.

Angular Conf 2016

Il racconto della nostra giornata alla Angular Conf 2016 a Torino, sia come spettatori e soprattutto come sponsor.

Intré Camp – 3 Novembre 2016

Un racconto di come è andata la nostra giornata di team building, tra sorrisi e battaglie ;)

Node.Js Italian conference – V edition

Cronistoria sulla nostra partecipazione alla 5^ edizione della Node.Js Italian Conference, con tante belle foto, stickers e...leggete :)

Business24 TV: Fabio Ghislandi presenta Intré

In questo breve intervista viene presentata Intré e il suo innovativo approccio allo sviluppo di software.

Come cambia il mondo dei linguaggi
WebRTC – #1 Video-Chat in javascript

Con la tecnologia WebRTC (Real Time Communication www.webrtc.org) è possibile integrare, all’interno di applicazioni che comprendono javascript, funzionalità di audio e video-chat, registrazione chat, condivisione schermo e signaling.

Future e Promise in Scala

Primo post sulla programmazione in Scala dedicato a future e promise, due costrutti fondamentali per la programmazione concorrente.

Come inviare dati live da un’applicazione C# Desktop al web usando le WebSocket

Questa è una guida passo passo su come esporre dati live da un'applicazione C# console ad un web browser usando le WebSocket. L'esempio è stato testato su Windows 7.

IOS Push notifications iOS 6 con Sencha Touch 2.2

Se state cercando di inviare una Push Notification al vostro iOS6 iPhone/iPad usando Sencha Touch 2.2 probabilmente avrete incontrato diversi problemi. In questo articolo vedremo passo passo come configurare i certificati, impostare il file Sencha package.json ed inviare una push notification con uno script PHP o C#.

Creare una issue in Jira con i sub-task predefiniti

E' possibile programmare script in Atlassian Jira usando Groovy. Questi script possono essere eseguiti allo scattare di un evento come alla creazione di una issue o al suo aggiornamento. Sfruttando questo principio vediamo come creare uno script che crea i sub-task in automatico alla creazione di una Issue.

Lego controllato con Cloudfoundy via WebSockets

Questo è un breve test di come è possibile controllare Lego Mindstorm con Cloudfoundry usando HTML5 e WebSockets.

Beaglebone how-to. Come cambiare lo stato di una pagina web premendo un pulsante con node.js

Questo articolo descrive come intercettare l'interrupt GPIO di una beagle bone e aggiornare, via web sockets, una pagina web usando node.js.

youSCADA presentato al Graphical Web 2012

Come controllare e monitorare i device usando una piattaforma Cloud? La soluzione è stata presentata al Graphical Web 2012 a Zurigo.

Chiamare una REST API con node.js

Node.js sta rivoluzionando il modo di programmare le piattaforme software. Basato sul Google V8 JavaScript Engine permette di scrivere codice lato server in JavaScript.

Top
Ogni nostro Sprint ha l'obiettivo di massimizzare il Valore per l'utente finale
Il tuo browser non è aggiornato!
Aggiornalo per vedere questo sito correttamente.Aggiorna ora

×