Friday, November 16, 2012

Kotlin


Hadihariri.com

Design
. Java interoperable
. Fast as java
. Concise: without ceremony. Concentrate on value!
. Tooling

http://kotlin.jetbrains.org/

You can build app with any app. The point how many restrictions and frictions the language bring in. 

. Kotlin can target java or JavaScript 
. String interpolation
. Mutable and immutable (val) variable.
. No ; (optional)
. Have functions and classes and traits
. Just one constructor: use optional parameters
. Data classes: a DTO or a class with data and not behavior 
.. Out of the box toString, equal and compare methods
. Delegation is the dependency injection in kotlin
. Too many dependencies on a class it's a sign that the class is doing too much. You may miss an abstraction level.
. Naming is important. Do't use and on naming because it means the class or function is making different things
. Lambda expressions (function literals)
. Inheritance: everything is final unless you write open. The class must then be designed for inheritance
. Type inference
. High order functions
. Singleton objects
. Classes can e extend from trait, open classes or abstract classes
. Null protection: Save operator for java. In kotlin you can't get a nullpoinrtexception (unless you used !!)
. You don't cast, use is operator
. Conventions to override operators
. Sometime you can omit brackets: you can create (Static typed) dsl like in order to be more expressive
. Spek testing library : test business specification! Nice!!!!
. You can call from/to java : completely interoperable on the same project
. Scripting
. Module coming soon

. Vet.x kotlin available https://github.com/alextkachman/vertex-kotlin

Designed to enforce good design practices in real world apps.


No comments:

Post a Comment