Highlights
- Learn Efficient collection processing
- Use and learn Best practices
- Advanced generics, design Kotlin and Java
- Designing Kotlin for usage from Java
- Designing Java for usage from Kotlin
- Learn Concurrence
- DSL definition - DSL definition in Kotlin
- Use Functional programming in Kotlin
Course Details
-
Safety:
- Limit mutability
- Eliminate platform types as soon as possible
- Do not expose inferred types
- Prefer composition over inheritance
- Make it clear that top-level functions are not member functions
-
Readability:
- Design for readability
- Use operator overloading methods as their names indicate
- Consider naming arguments
- Avoid returning or operating on Unit?
- Specify variable type when it is not clear
- Consider referencing receiver explicitly
-
Reusability
- Do not repeat knowledge
- Do not repeat common algorithms
- Reuse between different platforms by extracting common modules
-
Abstraction design
- Each function should be written in terms of a single level of abstraction
- Define abstractions
- Respect abstraction contract
- Restrict visibility
- Use abstraction to protect code against changes
- Consider wrapping external API
-
Objects creation
- Consider factory functions instead of constructors
- Consider primary constructor with named optional arguments
- Consider defining DSL for complex object creation
-
Class design
- Use data modifier to represent a bundle of data
- Use function types instead of interfaces to pass operations and actions
- Do not use properties to express behavior
- Respect contract of equals
- Respect contract of hashCode
- Respect contract of compareTo
- Respect contract of arithmetic operators
-
Make it cheap
- Avoid unnecessary object creation
- Consider inline modifier for higher-order functions
- Eliminate obsolete object references
- Use tail recursion to achieve efficient recurrence
- Efficient collection processing
- Prefer Sequence for bigger collections with more than one processing step
- Consider Arrays with primitives for performance critical processing
- Consider using mutable collections
Who should attend
Feedback
4.8 out of 5 average
"Lots of useful examples in the presentation slides that was followed up with excellent exercises. My knowledge of Kotlin has been vastly improved by focusing on the best practices in this course and the class design section of the course has made my job far simpler."
NS, Senior Software Engineer, Kotlin Best Practices, May 2021
“JBI did a great job of customizing their syllabus to suit our business needs and also bringing our team up to speed on the current best practices. Our teams varied widely in terms of experience and the Instructor handled this particularly well - very impressive”
Brian F, Team Lead, RBS, Data Analysis Course, 20 April 2022