Kotlin is a powerful language, but it also comes with its traps and pitfalls. This presentation is about uncovering the very nice features and strange particularities that the language has to offer.
Kotlin is a JVM language developed by Jetbrains. Its version 1.0 (production ready) was released at the beginning of the year and made some buzz within the android community. This session proposes to discover this language, which takes up some aspects of groovy or scala, and that is very close to swift in syntax and concepts. We will see how Kotlin boosts the productivity of Java & Android application development and how well it accompanies reactive development.
Develop your next app with kotlin @ AndroidMakersFr 2017Arnaud Giuliani
Kotlin is a fully interoperable programming language for building Android and multiplatform applications. It is statically typed, concise, and designed to interoperate seamlessly with Java. Kotlin aims to combine the best of both object-oriented and functional programming, and provides features to write safer and more concise code compared to Java, such as null safety, type inference, and extension functions. The document provides an overview of Kotlin's features and how it compares to other languages like Java and Swift, and demonstrates how to set up a Kotlin project using Gradle build system.
The Jetbrain's Kotlin language cheat sheet, created by ekito and launched for the Toulouse's devfest - https://www.ekito.fr/people/kotlin-cheat-sheet/
This paper helps you keep the main feature of the Kotlin language, under the hand. Just download it & print it !
Kotlin for Android - Vali Iorgu - mRreadyMobileAcademy
Kotlin is a programming language that runs on the Java Virtual Machine and is fully interoperable with Java. It aims to combine object-oriented and functional programming features and to improve developer productivity. Some key features of Kotlin include null safety, extension functions, inline functions and lambdas, and support for coroutines. It provides painless Java interoperability so existing Java code and libraries can be used from Kotlin.
The document outlines an agenda for a workshop on developing a weather app with Kotlin. The schedule includes introductions to Kotlin, a project presentation and setup, and two hands-on sessions. There will be a coffee break in between the introductory and hands-on portions. Attendees will learn about Kotlin features like type inference, null safety, collections, and Android extensions and apply them by developing the weather app.
This document provides an introduction and overview of the Kotlin programming language. It covers key Kotlin concepts and features such as properties, null safety, classes, interfaces, extensions, and collections. It also includes Kotlin's timeline, development tools, and basic data types. The agenda outlines topics like String templates, OOP concepts, lambdas, and infix notation that are explained further in the document.
3 kotlin vs. java- what kotlin has that java does notSergey Bandysik
This document discusses Kotlin functions and lambda expressions. It explains that lambda expressions can be passed immediately as expressions or defined separately as functions. It also discusses that using higher-order functions can introduce runtime overhead which can be eliminated by inlining lambda expressions. Finally, it provides an example of an inline fun that demonstrates inlining and non-inlining of lambda expressions.
Kotlin advanced - language reference for android developersBartosz Kosarzycki
StxNext Lightning Talks - Mar 11, 2016
Kotlin Advanced - language reference for Android developers
This presentation contains the second talk on Kotlin language we had at STXNext. We try go deeper into language specifics and look at the positive impact new syntax can have on boilerplate removal and readability improvement.
Kotlin really shines in Android development when one looks at “Enum translation”, “Extension functions”, “SAM conversions”, “Infix notation”, “Closures” and “Fluent interfaces” applied to lists. The talk, however, compares language-specifics of Java & Kotlin in terms of “Type Variance”, “Generics” and “IDE tools” as well.
We present real-world example based on Stx-Insider project written in Kotlin which incorporates Dagger 2, Kotterknife, Retrofit2 and is composed of 5+ Activities.
Full agenda
Live templates
Enum translation
Calling extension functions from Kotlin/Java
Constructors with backing fields
Warnings
F-bound polymorphism
Variance (Covariance/Contravariance)
Variance comparison in Kotlin/Java/Scala
Annotation processing - KAPT
SAM conversions
Type equality
Lambda vs Closure
Reified generics
Fluent interfaces
Infix notation
Static extension methods in Kotlin
Generic types
Sealed classes
Dokka - documentation in Kotlin
J2K converter
Real-world example
Reflection
Presentation is accompanied with an example project (StxInsider):
https://github.com/kosiara/stx-insider
Kotlin is a JVM language developed by Jetbrains. Its version 1.0 (production ready) was released at the beginning of the year and made some buzz within the android community. This session proposes to discover this language, which takes up some aspects of groovy or scala, and that is very close to swift in syntax and concepts. We will see how Kotlin boosts the productivity of Java & Android application development and how well it accompanies reactive development.
Develop your next app with kotlin @ AndroidMakersFr 2017Arnaud Giuliani
Kotlin is a fully interoperable programming language for building Android and multiplatform applications. It is statically typed, concise, and designed to interoperate seamlessly with Java. Kotlin aims to combine the best of both object-oriented and functional programming, and provides features to write safer and more concise code compared to Java, such as null safety, type inference, and extension functions. The document provides an overview of Kotlin's features and how it compares to other languages like Java and Swift, and demonstrates how to set up a Kotlin project using Gradle build system.
The Jetbrain's Kotlin language cheat sheet, created by ekito and launched for the Toulouse's devfest - https://www.ekito.fr/people/kotlin-cheat-sheet/
This paper helps you keep the main feature of the Kotlin language, under the hand. Just download it & print it !
Kotlin for Android - Vali Iorgu - mRreadyMobileAcademy
Kotlin is a programming language that runs on the Java Virtual Machine and is fully interoperable with Java. It aims to combine object-oriented and functional programming features and to improve developer productivity. Some key features of Kotlin include null safety, extension functions, inline functions and lambdas, and support for coroutines. It provides painless Java interoperability so existing Java code and libraries can be used from Kotlin.
The document outlines an agenda for a workshop on developing a weather app with Kotlin. The schedule includes introductions to Kotlin, a project presentation and setup, and two hands-on sessions. There will be a coffee break in between the introductory and hands-on portions. Attendees will learn about Kotlin features like type inference, null safety, collections, and Android extensions and apply them by developing the weather app.
This document provides an introduction and overview of the Kotlin programming language. It covers key Kotlin concepts and features such as properties, null safety, classes, interfaces, extensions, and collections. It also includes Kotlin's timeline, development tools, and basic data types. The agenda outlines topics like String templates, OOP concepts, lambdas, and infix notation that are explained further in the document.
3 kotlin vs. java- what kotlin has that java does notSergey Bandysik
This document discusses Kotlin functions and lambda expressions. It explains that lambda expressions can be passed immediately as expressions or defined separately as functions. It also discusses that using higher-order functions can introduce runtime overhead which can be eliminated by inlining lambda expressions. Finally, it provides an example of an inline fun that demonstrates inlining and non-inlining of lambda expressions.
Kotlin advanced - language reference for android developersBartosz Kosarzycki
StxNext Lightning Talks - Mar 11, 2016
Kotlin Advanced - language reference for Android developers
This presentation contains the second talk on Kotlin language we had at STXNext. We try go deeper into language specifics and look at the positive impact new syntax can have on boilerplate removal and readability improvement.
Kotlin really shines in Android development when one looks at “Enum translation”, “Extension functions”, “SAM conversions”, “Infix notation”, “Closures” and “Fluent interfaces” applied to lists. The talk, however, compares language-specifics of Java & Kotlin in terms of “Type Variance”, “Generics” and “IDE tools” as well.
We present real-world example based on Stx-Insider project written in Kotlin which incorporates Dagger 2, Kotterknife, Retrofit2 and is composed of 5+ Activities.
Full agenda
Live templates
Enum translation
Calling extension functions from Kotlin/Java
Constructors with backing fields
Warnings
F-bound polymorphism
Variance (Covariance/Contravariance)
Variance comparison in Kotlin/Java/Scala
Annotation processing - KAPT
SAM conversions
Type equality
Lambda vs Closure
Reified generics
Fluent interfaces
Infix notation
Static extension methods in Kotlin
Generic types
Sealed classes
Dokka - documentation in Kotlin
J2K converter
Real-world example
Reflection
Presentation is accompanied with an example project (StxInsider):
https://github.com/kosiara/stx-insider
Presented on 27th September 2017 to a joint meeting of 'Cork Functional Programmers' and the 'Cork Java Users Group'
Based on the Kotlin Language programming course from Instil. For more details see https://instil.co/courses/kotlin-development/
This document provides an introduction and overview of the Kotlin programming language. It begins with an agenda and quote about Kotlin being a good choice for Spring applications. The remainder of the document covers what Kotlin is, its main features like type inference, functional programming support, interoperability with Java, and language concepts like properties, classes, inheritance, interfaces, functions, collections and more. Code examples are provided to illustrate many of the language features. Resources for learning more about Kotlin are listed at the end.
Next Insurance was founded in the beginning of 2016 and first lines of our production code started accumulating in May 2016. In the beginning I have started writing in Java and experimenting with Kotlin, which saw its 1.0 release two months earlier. 6 months later, the development of our backend services has totally shifted to Kotlin. We still keep a few classes in Java just to make sure that the integration remains seamless but the vast majority of our codebase is written in Kotlin. In this talk I will cover the language features and why I think it is awesome, from null safety to smart casts and data classes. We will also look into the future with 1.1 async/await feature and more.
All Aboard The Scala-to-PureScript Express!John De Goes
Many Scala programmers have embraced functional programming, but the syntax and semantics of programming languages in the Haskell family remains a mystery. In this talk, Scala developers (and to some extent, Java developers) will see how the types, data structures, traits / interfaces, packages, and so forth translate into their PureScript counterparts.
The document discusses the Kotlin programming language. It highlights that Kotlin is a modern, pragmatic language that provides good tooling and interoperability with Java. It has grown significantly in popularity since its initial release. The document then discusses various features of Kotlin like its concise and readable syntax, null safety, support for lambdas and extensions, and how it can be used for multi-platform projects. Kotlin aims to be an improvement over Java by making code more concise, safe, and expressive while maintaining interoperability with existing Java code and libraries.
Kotlin is a statically typed programming language that is 100% interoperable with Java. It aims to combine object-oriented and functional programming features and to be more concise than Java. Some key features of Kotlin include type inference, properties that replace getter/setter methods, higher-order functions, lambdas, and coroutines. Using Kotlin can increase developer productivity through less code, fewer errors, and clearer syntax. It also allows existing Java code to remain unchanged while new features are developed in Kotlin. Integrating Kotlin into a project requires adding dependencies and plugins, setting up tooling, and initially targeting a small component for parallel development in both languages.
Kotlin Bytecode Generation and Runtime Performanceintelliyole
In this talk, we'll dive into the details of how various language features supported by Kotlin are translated to Java bytecode. We'll use the JMH microbenchmarking tool to study the relative performance of various constructs and to understand how we can ensure top performance of the Kotlin code that we write.
Well-architected libraries for functional programming are at once immensely beautiful and practical. They are simple but extraordinarily powerful, helping users solve their problems by snapping together Lego-like building blocks, each of which has just one purpose. Yet, there is a surprising dearth of material on how developers can construct their own well-architected functional code. Many functional programming tutorials talk discuss type safety and making illegal states unrepresentable, but few speak on the subject of good functional interface design.
In this presentation, John A. De Goes takes to the stage to discuss a nebulous and underrated tool in the arsenal of every functional programmer. Called *orthogonality*, this tool allows programmers to craft the building blocks of their functional code at "right angles", so so they can be reasoned about simply and composed predictably to solve complex problems. John introduces the concept of orthogonality, looking at its geometric and algebraic origins, presents a way to measure orthogonality, and then walks through a number of interface examples, comparing non-orthogonal designs with orthogonal ones.
By the end of the session, attendees should have a newfound appreciation for how important orthogonality is to constructing good functional interfaces, and they should develop the early stages of an intuition about how to slice up a complex problem into core, single-purpose, composable building blocks.
The document introduces the Kotlin programming language developed by JetBrains. It provides an overview of Kotlin's motivation, features, syntax and tooling. Key points include Kotlin being a statically typed JVM language intended for industrial use, its focus on common sense features from other languages, and full interoperability with Java.
Android Developer Group Poznań - Kotlin for Android developers
STXInsider example project in Kotlin:
https://github.com/kosiara/stx-insider
Kotlin - one of the popular programming languages built on top of Java that runs on JVM. Thanks to JetBrains support and excellent IDE integration, it’s an ideal choice for Android development. 100% Java compatibility, interoperability and no runtime overhead is just the beginning of a long list of strengths. Kotlin is supposed to be a subset of SCALA, has clear benefits for developers on one hand and keeps short compile times on the other.
As a mobile team we got interested in Kotlin a few months before its final release which gave us time to test it thoroughly before production use. The language has some clear advantages for an Android programmer - it enables migration from Java projects that have been under development for some time already. Java&Kotlin coexistence simplifies Kotlin introduction as only new functionality is written in JetBrain’s new language leaving all the legacy code untouched.
Transitioning gives the developer an opportunity to use lambdas, new syntax for data objects, extension functions to easily expand Android SDK’s classes functionality and infix notation to write DSL-like structures. Almost all the libraries you use today will work with Kotlin thanks to 100% Java compatibility. The same is true for Android SDK classes - all of them will seamlessly work with the new programming language. Kotlin gives you more choice when it comes to reflection, creating documentation and being null-pointer safe. Android works great with it out of the box so you won’t need to change your development habits.
Our production project in Kotlin turned out to be a success after 4 months of development. We had 0 bugs related to Kotlin as a programming language. Our code footprint is almost 30% smaller thanks to JetBrain’s, we benefit from nullpointer safety, closures, translated enums, data objects and use infix notation for logging and displaying Snackbars.
===========
In this presentation you'll find basic use cases, syntax, structures and patterns. Later on Kotlin is presented in Android context. Simple project structure, imports and Kotlin usage with Android SDK is explained. In the end cost of Kotlin compilation is presented and the language is compared to SCALA and SWIFT.
We look at the positive impact new syntax can have on boilerplate removal and readability improvement.
Kotlin really shines in Android development when one looks at “Enum translation”, “Extension functions”, “SAM conversions”, “Infix notation”, “Closures” and “Fluent interfaces” applied to lists. The talk, however, compares language-specifics of Java & Kotlin in terms of “Type Variance”, “Generics” and “IDE tools” as well.
StxNext Lightning Talks - Feb 12, 2016
Kotlin - one of the popular programming languages built on top of Java that runs on JVM. Thanks to JetBrains support and excellent IDE integration, it’s an ideal choice when it comes to Android development. 100% Java compatibility, interoperability and no runtime overhead is just the beginning of a long list of strengths. Kotlin is supposed to be a subset of SCALA, on one hand covering major advantages for developers and on the other - keeping short compile times.
This presentation is a Developer Starter - a set of hand-picked information allowing a person with no knowledge of Kotlin to start writing basic Android activities and set up an Android-kotlin project. It starts with language background, reasons for its creation and advantages. Then presents basic use cases, syntax, structures and patterns. Later on Kotlin is presented in Android context. Simple project structure, imports and Kotlin usage with Android SDK is explained. In the end cost of Kotlin usage is presented and the language is compared to SCALA and SWIFT.
Kotlin provides a lot of features out of the box even though those are not supported by JVM. Have you ever wondered how Kotlin does it? If yes, then this presentation is for you.
Kotlin compiler tweaks our code in such a way that, JVM can execute it. this deck goes through lots of Kotlin features and explains how it looks at runtime for JVM compatibility. Of course we are not going to look into bytecode, instead we will look into the decompiled version of the bytecode generated by Kotlin compiler.
NOTE: This was presented at DevFest Kolkata 2019.
Introduction to functional programming using Ocamlpramode_ce
The document provides an introduction to functional programming concepts using Ocaml as the teaching language. It outlines the workshop plan which will cover Ocaml syntax, important functional programming concepts, and understanding the functional paradigm through Ocaml. It then discusses Ocaml background, where Ocaml is used, the Ocaml REPL, function definition, type inference, recursion, tail calls and TCO, higher order functions, algebraic data types, pattern matching, immutability, and more.
Introduction to kotlin for android app development gdg ahmedabad dev fest 2017Hardik Trivedi
The presentation was given in Ahmedabad GDG DevFest 2017. It has introduction to Kotlin for Android App Development.
Talk will is specially designed for beginners, who has heard about Kotlin but couldn’t explore it till date. The talk will take attendees to the journey where they can know Kotlin as a programming language. What Kotlin offers for Android? How to start the development using Kotlin, Features of Kotlin, Some of the disadvantages of Kotlin.
I will be discussing about following topics
- What’s Kotlin
- Why Kotlin
- Setting up Kotlin
- Features of Kotlin
- Syntax crash course
- Classes
- Features of function programming like Lamdabs and Higher order functions
- Usage of Anko
- Migrating from Java project to Kotlin
- Future of Kotlin
- Disadvantages of Kotlin
The document provides idiomatic Kotlin coding style guidelines and best practices for expressions, classes, functions, and the standard library. Some key recommendations include using 'when' and 'try' as expression bodies, avoiding classes just for functions, extracting non-essential APIs to extensions, using data classes, type aliases, and destructuring declarations, and leveraging functions like 'apply', 'filterIsInstance', and 'groupBy' from the standard library. Overall the document advises organizing code in a concise and functional way that fully utilizes Kotlin language features.
eMan Dev Meetup: Kotlin - A Language we should know it exists (part 02/03) 18...eMan s.r.o.
This document provides an overview of the Kotlin programming language. It defines Kotlin as a statically typed language that targets the JVM and JavaScript, is 100% interoperable with Java, and was created by JetBrains as a better alternative to Java. The document then covers 10 features of Kotlin, including null safety, data classes, extension functions, smart casts, and support for functional programming patterns. It provides code examples to demonstrate how these features work in Kotlin.
C++11 introduced several new features to C++ that support modern programming patterns like lambdas, smart pointers, and move semantics. Lambdas allow for anonymous inline functions, which improve code readability and eliminate the need for functor classes. Smart pointers like unique_ptr and shared_ptr make memory management safer and more straightforward using features like move semantics and RAII. C++11 also aims to bring C++ more in line with modern hardware by supporting multi-threading and higher level abstractions while maintaining performance.
The Easy-Peasy-Lemon-Squeezy, Statically-Typed, Purely Functional Programming...John De Goes
Maybe you've played around with functional programming before, but don't consider yourself a functional programmer. Or maybe you program functionally, but only in a dynamically-typed programming language. Or MAYBE you just like workshops with really long, ridiculously-sounding titles!
No matter, this workshop that teaches the super hot programming language PureScript is guaranteed to cure what ails you!
Come, learn about functions, learn about types, learn about data, and learn about how to smash them all together to build beautiful programs that are easy to test, easy to combine, and easy to reason about.
Become the functional programmer you were born to be!
These are the outline slides that I used for the Pune Clojure Course.
The slides may not be much useful standalone, but I have uploaded them for reference.
The document outlines a lecture plan for object oriented programming. It covers topics like structures and classes, function overloading, constructors and destructors, operator overloading, inheritance, polymorphism, and file streams. It provides examples to explain concepts like structures, classes, access specifiers, friend functions, and operator overloading. The document also includes questions for students to practice these concepts.
The document discusses various Kotlin language features and how they are compiled down to bytecode. It explains concepts like lowering, de-sugaring, and decompiling Kotlin programs. Specific language features summarized include free functions, nested functions, extension methods, data classes, object declarations, companion objects, and lambdas with receivers. The document shows how each feature compiles by decompiling example Kotlin code.
Presented on 27th September 2017 to a joint meeting of 'Cork Functional Programmers' and the 'Cork Java Users Group'
Based on the Kotlin Language programming course from Instil. For more details see https://instil.co/courses/kotlin-development/
This document provides an introduction and overview of the Kotlin programming language. It begins with an agenda and quote about Kotlin being a good choice for Spring applications. The remainder of the document covers what Kotlin is, its main features like type inference, functional programming support, interoperability with Java, and language concepts like properties, classes, inheritance, interfaces, functions, collections and more. Code examples are provided to illustrate many of the language features. Resources for learning more about Kotlin are listed at the end.
Next Insurance was founded in the beginning of 2016 and first lines of our production code started accumulating in May 2016. In the beginning I have started writing in Java and experimenting with Kotlin, which saw its 1.0 release two months earlier. 6 months later, the development of our backend services has totally shifted to Kotlin. We still keep a few classes in Java just to make sure that the integration remains seamless but the vast majority of our codebase is written in Kotlin. In this talk I will cover the language features and why I think it is awesome, from null safety to smart casts and data classes. We will also look into the future with 1.1 async/await feature and more.
All Aboard The Scala-to-PureScript Express!John De Goes
Many Scala programmers have embraced functional programming, but the syntax and semantics of programming languages in the Haskell family remains a mystery. In this talk, Scala developers (and to some extent, Java developers) will see how the types, data structures, traits / interfaces, packages, and so forth translate into their PureScript counterparts.
The document discusses the Kotlin programming language. It highlights that Kotlin is a modern, pragmatic language that provides good tooling and interoperability with Java. It has grown significantly in popularity since its initial release. The document then discusses various features of Kotlin like its concise and readable syntax, null safety, support for lambdas and extensions, and how it can be used for multi-platform projects. Kotlin aims to be an improvement over Java by making code more concise, safe, and expressive while maintaining interoperability with existing Java code and libraries.
Kotlin is a statically typed programming language that is 100% interoperable with Java. It aims to combine object-oriented and functional programming features and to be more concise than Java. Some key features of Kotlin include type inference, properties that replace getter/setter methods, higher-order functions, lambdas, and coroutines. Using Kotlin can increase developer productivity through less code, fewer errors, and clearer syntax. It also allows existing Java code to remain unchanged while new features are developed in Kotlin. Integrating Kotlin into a project requires adding dependencies and plugins, setting up tooling, and initially targeting a small component for parallel development in both languages.
Kotlin Bytecode Generation and Runtime Performanceintelliyole
In this talk, we'll dive into the details of how various language features supported by Kotlin are translated to Java bytecode. We'll use the JMH microbenchmarking tool to study the relative performance of various constructs and to understand how we can ensure top performance of the Kotlin code that we write.
Well-architected libraries for functional programming are at once immensely beautiful and practical. They are simple but extraordinarily powerful, helping users solve their problems by snapping together Lego-like building blocks, each of which has just one purpose. Yet, there is a surprising dearth of material on how developers can construct their own well-architected functional code. Many functional programming tutorials talk discuss type safety and making illegal states unrepresentable, but few speak on the subject of good functional interface design.
In this presentation, John A. De Goes takes to the stage to discuss a nebulous and underrated tool in the arsenal of every functional programmer. Called *orthogonality*, this tool allows programmers to craft the building blocks of their functional code at "right angles", so so they can be reasoned about simply and composed predictably to solve complex problems. John introduces the concept of orthogonality, looking at its geometric and algebraic origins, presents a way to measure orthogonality, and then walks through a number of interface examples, comparing non-orthogonal designs with orthogonal ones.
By the end of the session, attendees should have a newfound appreciation for how important orthogonality is to constructing good functional interfaces, and they should develop the early stages of an intuition about how to slice up a complex problem into core, single-purpose, composable building blocks.
The document introduces the Kotlin programming language developed by JetBrains. It provides an overview of Kotlin's motivation, features, syntax and tooling. Key points include Kotlin being a statically typed JVM language intended for industrial use, its focus on common sense features from other languages, and full interoperability with Java.
Android Developer Group Poznań - Kotlin for Android developers
STXInsider example project in Kotlin:
https://github.com/kosiara/stx-insider
Kotlin - one of the popular programming languages built on top of Java that runs on JVM. Thanks to JetBrains support and excellent IDE integration, it’s an ideal choice for Android development. 100% Java compatibility, interoperability and no runtime overhead is just the beginning of a long list of strengths. Kotlin is supposed to be a subset of SCALA, has clear benefits for developers on one hand and keeps short compile times on the other.
As a mobile team we got interested in Kotlin a few months before its final release which gave us time to test it thoroughly before production use. The language has some clear advantages for an Android programmer - it enables migration from Java projects that have been under development for some time already. Java&Kotlin coexistence simplifies Kotlin introduction as only new functionality is written in JetBrain’s new language leaving all the legacy code untouched.
Transitioning gives the developer an opportunity to use lambdas, new syntax for data objects, extension functions to easily expand Android SDK’s classes functionality and infix notation to write DSL-like structures. Almost all the libraries you use today will work with Kotlin thanks to 100% Java compatibility. The same is true for Android SDK classes - all of them will seamlessly work with the new programming language. Kotlin gives you more choice when it comes to reflection, creating documentation and being null-pointer safe. Android works great with it out of the box so you won’t need to change your development habits.
Our production project in Kotlin turned out to be a success after 4 months of development. We had 0 bugs related to Kotlin as a programming language. Our code footprint is almost 30% smaller thanks to JetBrain’s, we benefit from nullpointer safety, closures, translated enums, data objects and use infix notation for logging and displaying Snackbars.
===========
In this presentation you'll find basic use cases, syntax, structures and patterns. Later on Kotlin is presented in Android context. Simple project structure, imports and Kotlin usage with Android SDK is explained. In the end cost of Kotlin compilation is presented and the language is compared to SCALA and SWIFT.
We look at the positive impact new syntax can have on boilerplate removal and readability improvement.
Kotlin really shines in Android development when one looks at “Enum translation”, “Extension functions”, “SAM conversions”, “Infix notation”, “Closures” and “Fluent interfaces” applied to lists. The talk, however, compares language-specifics of Java & Kotlin in terms of “Type Variance”, “Generics” and “IDE tools” as well.
StxNext Lightning Talks - Feb 12, 2016
Kotlin - one of the popular programming languages built on top of Java that runs on JVM. Thanks to JetBrains support and excellent IDE integration, it’s an ideal choice when it comes to Android development. 100% Java compatibility, interoperability and no runtime overhead is just the beginning of a long list of strengths. Kotlin is supposed to be a subset of SCALA, on one hand covering major advantages for developers and on the other - keeping short compile times.
This presentation is a Developer Starter - a set of hand-picked information allowing a person with no knowledge of Kotlin to start writing basic Android activities and set up an Android-kotlin project. It starts with language background, reasons for its creation and advantages. Then presents basic use cases, syntax, structures and patterns. Later on Kotlin is presented in Android context. Simple project structure, imports and Kotlin usage with Android SDK is explained. In the end cost of Kotlin usage is presented and the language is compared to SCALA and SWIFT.
Kotlin provides a lot of features out of the box even though those are not supported by JVM. Have you ever wondered how Kotlin does it? If yes, then this presentation is for you.
Kotlin compiler tweaks our code in such a way that, JVM can execute it. this deck goes through lots of Kotlin features and explains how it looks at runtime for JVM compatibility. Of course we are not going to look into bytecode, instead we will look into the decompiled version of the bytecode generated by Kotlin compiler.
NOTE: This was presented at DevFest Kolkata 2019.
Introduction to functional programming using Ocamlpramode_ce
The document provides an introduction to functional programming concepts using Ocaml as the teaching language. It outlines the workshop plan which will cover Ocaml syntax, important functional programming concepts, and understanding the functional paradigm through Ocaml. It then discusses Ocaml background, where Ocaml is used, the Ocaml REPL, function definition, type inference, recursion, tail calls and TCO, higher order functions, algebraic data types, pattern matching, immutability, and more.
Introduction to kotlin for android app development gdg ahmedabad dev fest 2017Hardik Trivedi
The presentation was given in Ahmedabad GDG DevFest 2017. It has introduction to Kotlin for Android App Development.
Talk will is specially designed for beginners, who has heard about Kotlin but couldn’t explore it till date. The talk will take attendees to the journey where they can know Kotlin as a programming language. What Kotlin offers for Android? How to start the development using Kotlin, Features of Kotlin, Some of the disadvantages of Kotlin.
I will be discussing about following topics
- What’s Kotlin
- Why Kotlin
- Setting up Kotlin
- Features of Kotlin
- Syntax crash course
- Classes
- Features of function programming like Lamdabs and Higher order functions
- Usage of Anko
- Migrating from Java project to Kotlin
- Future of Kotlin
- Disadvantages of Kotlin
The document provides idiomatic Kotlin coding style guidelines and best practices for expressions, classes, functions, and the standard library. Some key recommendations include using 'when' and 'try' as expression bodies, avoiding classes just for functions, extracting non-essential APIs to extensions, using data classes, type aliases, and destructuring declarations, and leveraging functions like 'apply', 'filterIsInstance', and 'groupBy' from the standard library. Overall the document advises organizing code in a concise and functional way that fully utilizes Kotlin language features.
eMan Dev Meetup: Kotlin - A Language we should know it exists (part 02/03) 18...eMan s.r.o.
This document provides an overview of the Kotlin programming language. It defines Kotlin as a statically typed language that targets the JVM and JavaScript, is 100% interoperable with Java, and was created by JetBrains as a better alternative to Java. The document then covers 10 features of Kotlin, including null safety, data classes, extension functions, smart casts, and support for functional programming patterns. It provides code examples to demonstrate how these features work in Kotlin.
C++11 introduced several new features to C++ that support modern programming patterns like lambdas, smart pointers, and move semantics. Lambdas allow for anonymous inline functions, which improve code readability and eliminate the need for functor classes. Smart pointers like unique_ptr and shared_ptr make memory management safer and more straightforward using features like move semantics and RAII. C++11 also aims to bring C++ more in line with modern hardware by supporting multi-threading and higher level abstractions while maintaining performance.
The Easy-Peasy-Lemon-Squeezy, Statically-Typed, Purely Functional Programming...John De Goes
Maybe you've played around with functional programming before, but don't consider yourself a functional programmer. Or maybe you program functionally, but only in a dynamically-typed programming language. Or MAYBE you just like workshops with really long, ridiculously-sounding titles!
No matter, this workshop that teaches the super hot programming language PureScript is guaranteed to cure what ails you!
Come, learn about functions, learn about types, learn about data, and learn about how to smash them all together to build beautiful programs that are easy to test, easy to combine, and easy to reason about.
Become the functional programmer you were born to be!
These are the outline slides that I used for the Pune Clojure Course.
The slides may not be much useful standalone, but I have uploaded them for reference.
The document outlines a lecture plan for object oriented programming. It covers topics like structures and classes, function overloading, constructors and destructors, operator overloading, inheritance, polymorphism, and file streams. It provides examples to explain concepts like structures, classes, access specifiers, friend functions, and operator overloading. The document also includes questions for students to practice these concepts.
The document discusses various Kotlin language features and how they are compiled down to bytecode. It explains concepts like lowering, de-sugaring, and decompiling Kotlin programs. Specific language features summarized include free functions, nested functions, extension methods, data classes, object declarations, companion objects, and lambdas with receivers. The document shows how each feature compiles by decompiling example Kotlin code.
Writing code that writes code - Nguyen LuongVu Huy
“The Pragmatic Programmer” admonished us all to “write code that writes code”: use code generators to increase productivity and avoid duplication. The language communities have clearly caught on, as more and more frameworks generate code at compile time: Project Lombok, Google Auto, and more.
This session reviews these approaches including examples of how and why we’d want to do this.
We will see newest Java language tools, write our own AST tranform and look at some amazing libraries based on these techniques.
Bio: Nguyen Luong is a senior java technical lead at Ekino Vietnam. He likes to research new technologies and solve security challenges.
“The Pragmatic Programmer” admonished us all to “write code that writes code”: use code generators to increase productivity and avoid duplication. The language communities have clearly caught on, as more and more frameworks generate code at compile time: Project Lombok, Google Auto, and more.
This session reviews these approaches including examples of how and why we’d want to do this.
We will see newest Java language tools, write our own AST tranform and look at some amazing libraries based on these techniques.
Bio: Nguyen Luong is a senior java technical lead at Ekino Vietnam. He likes to research new technologies and solve security challenges.
Kotlin is a statically typed programming language that runs on the Java Virtual Machine and is fully interoperable with Java. It was developed by JetBrains as an alternative to Java for Android development, with improvements like null safety, lambdas, and concise syntax. Kotlin aims to be a safer language than Java by eliminating NullPointerExceptions and adding features like data classes, extensions, and higher-order functions. These features allow for more readable, concise code compared to Java.
This full day course will give you a hands-on, deep dive into React Native. In this course, you will learn how to build cross-platform mobile applications from scratch using Facebook's React Native.
This document discusses object-oriented principles and design best practices in C++. It begins with an overview of OOP concepts like inheritance vs composition and templates vs inheritance. It then covers the SOLID principles and design patterns. The document emphasizes best practices like favoring composition over inheritance, avoiding virtual calls from constructors, preventing confusing overloads, and following safe overriding to prevent versioning problems. Overall it provides guidance on applying OOP principles and avoiding common pitfalls in C++ design.
C++ is an object-oriented programming language that is an extension of C. It was developed in the early 1980s by Bjarne Stroustrup at Bell Labs. C++ supports concepts like inheritance, polymorphism, and encapsulation that make it suitable for large, complex programs. Inheritance allows classes to inherit properties from parent classes. Polymorphism is the ability to process objects of different types in the same way. Encapsulation combines data and functions that operate on that data within a single unit, hiding implementation details. File input/output in C++ can be handled through streams like ifstream for input and ofstream for output.
Operator overloading allows operators like +, -, *, etc. to be used with user-defined types by defining specific method implementations. It enables operations on user-defined classes to behave similarly to built-in types. The document provides examples of overloading unary and binary operators in C# classes to change the sign of a number and add two calculator objects respectively. It also discusses the different operators that can and cannot be overloaded and how to define the operator overloading methods with the correct return types and parameters.
CSharp presentation and software developementfrwebhelp
This document provides an overview of key concepts in C#, including similarities to Java, common C# language features, classes vs. structs, interfaces, abstract classes, and class internals like fields, properties, modifiers, and conversion operators. Some key points:
- C# and Java share similarities like all classes being objects, a similar compilation/runtime model using a virtual machine, and heap-based allocation using "new".
- C# supports common features like namespaces, classes, structs, enums, interfaces, and control statements. Classes are reference types while structs are value types.
- Interfaces define contracts without implementation, while abstract classes can contain some implementation but cannot be instantiated.
This document provides an overview of key object-oriented programming concepts including classes and objects, inheritance, encapsulation, polymorphism, interfaces, abstract classes, and design patterns. It discusses class construction and object instantiation. Inheritance is described as both exposing implementation details and potentially breaking encapsulation. Composition is presented as an alternative to inheritance. The document also covers method overriding, overloading, and duck typing as forms of polymorphism. Finally, it briefly introduces common design principles like SOLID and patterns like delegation.
The document discusses how the Kotlin compiler fakes or lies about certain Kotlin language features by decompiling the bytecode produced by the Kotlin compiler. It provides examples of how free functions, nested functions, primary constructors, extension methods, destructuring, object declarations, companion objects, enumerations, delegated properties, lambdas with receivers, and more are implemented under the hood by the compiler through bytecode tricks and deception. The document is intended to look under the hood of the Kotlin compiler and Java bytecode to understand how certain Kotlin features are implemented that don't have a direct mapping to Java.
JCConf 2020 - New Java Features Released in 2020Joseph Kuo
The document discusses new features in Java releases from JDK 13 to JDK 15, including syntax changes like switch expressions and text blocks, API changes like helpful NullPointerExceptions and reimplementing sockets, and improvements to garbage collectors like ZGC and NUMA-aware memory allocation for G1. It provides code examples to demonstrate the new features and explains their motivations and impacts.
This document provides a summary of an introduction to the Clojure programming language. It discusses what Clojure is, its timeline and adoption, functional programming concepts, concurrency features using Software Transactional Memory, the Lisp ideology it is based on including homoiconicity and its macro system. It also provides an overview of getting started with Clojure including using the REPL, basic syntax like symbols and keywords, data types, sequences, functions, and Java interoperability. Resources for learning more about Clojure are also listed.
Clojure and Swing – a new productivity sweet spot? discusses how Clojure, a Lisp dialect that runs on the JVM, can be used to develop graphical user interfaces (GUIs) using Java Swing in a more productive way than plain Java. It presents several advantages of Clojure for Swing development, such as reducing boilerplate code, easier definition of actions and event bindings, and increased flexibility and reusability through functional programming techniques. Examples are provided of common Swing programming tasks implemented more concisely and readably in Clojure compared to Java. The document concludes that Clojure is a powerful and flexible language that offers opportunities to apply Lisp concepts to Swing GUI development
This document provides an overview of key concepts in the Java programming language, including:
- Java is an object-oriented language that is simpler than C++ and supports features like platform independence.
- The Java development environment includes tools for compiling, debugging, and running Java programs.
- Java programs work with basic data types like int and double, as well as user-defined classes, variables, and arrays.
- The document explains operators, control structures, formatting output, and the basics of classes and objects in Java.
Java is an object-oriented programming language created by James Gosling at Sun Microsystems in 1995. It is platform independent, meaning programs written in Java can run on any system that supports Java without needing to be recompiled. The document provides an overview of Java, including its history and development, basic concepts like classes and objects, and how to write simple Java programs. It also discusses Java's advantages like being simple, object-oriented, portable, multithreaded, and secure.
The Kotlin compiler provides many features of Kotlin that do not exist natively in the JVM by generating bytecode that emulates these features. It uses various techniques like generating additional classes and methods, passing implicit parameters, and implementing functional interfaces to achieve this. The summary decompiles some Kotlin code examples to Java bytecode to illustrate how specific Kotlin features are implemented under the hood.
The document discusses the history and architecture of Microsoft's .NET framework and C# programming language. It provides an overview of key .NET concepts like assemblies, application domains, and interoperability. It also summarizes major features of C# like namespaces, control flow, iterators, properties, attributes, delegates and events, LINQ, structs and constructors.
Similar to Kotlin - The Swiss army knife of programming languages - Visma Mobile Meet-up 2018 - Vilnius (20)
Introduction- e - waste – definition - sources of e-waste– hazardous substances in e-waste - effects of e-waste on environment and human health- need for e-waste management– e-waste handling rules - waste minimization techniques for managing e-waste – recycling of e-waste - disposal treatment methods of e- waste – mechanism of extraction of precious metal from leaching solution-global Scenario of E-waste – E-waste in India- case studies.
Literature Review Basics and Understanding Reference Management.pptxDr Ramhari Poudyal
Three-day training on academic research focuses on analytical tools at United Technical College, supported by the University Grant Commission, Nepal. 24-26 May 2024
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesChristina Lin
Traditionally, dealing with real-time data pipelines has involved significant overhead, even for straightforward tasks like data transformation or masking. However, in this talk, we’ll venture into the dynamic realm of WebAssembly (WASM) and discover how it can revolutionize the creation of stateless streaming pipelines within a Kafka (Redpanda) broker. These pipelines are adept at managing low-latency, high-data-volume scenarios.
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...University of Maribor
Slides from talk presenting:
Aleš Zamuda: Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapter and Networking.
Presentation at IcETRAN 2024 session:
"Inter-Society Networking Panel GRSS/MTT-S/CIS
Panel Session: Promoting Connection and Cooperation"
IEEE Slovenia GRSS
IEEE Serbia and Montenegro MTT-S
IEEE Slovenia CIS
11TH INTERNATIONAL CONFERENCE ON ELECTRICAL, ELECTRONIC AND COMPUTING ENGINEERING
3-6 June 2024, Niš, Serbia
International Conference on NLP, Artificial Intelligence, Machine Learning an...gerogepatton
International Conference on NLP, Artificial Intelligence, Machine Learning and Applications (NLAIM 2024) offers a premier global platform for exchanging insights and findings in the theory, methodology, and applications of NLP, Artificial Intelligence, Machine Learning, and their applications. The conference seeks substantial contributions across all key domains of NLP, Artificial Intelligence, Machine Learning, and their practical applications, aiming to foster both theoretical advancements and real-world implementations. With a focus on facilitating collaboration between researchers and practitioners from academia and industry, the conference serves as a nexus for sharing the latest developments in the field.
Understanding Inductive Bias in Machine LearningSUTEJAS
This presentation explores the concept of inductive bias in machine learning. It explains how algorithms come with built-in assumptions and preferences that guide the learning process. You'll learn about the different types of inductive bias and how they can impact the performance and generalizability of machine learning models.
The presentation also covers the positive and negative aspects of inductive bias, along with strategies for mitigating potential drawbacks. We'll explore examples of how bias manifests in algorithms like neural networks and decision trees.
By understanding inductive bias, you can gain valuable insights into how machine learning models work and make informed decisions when building and deploying them.
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsVictor Morales
K8sGPT is a tool that analyzes and diagnoses Kubernetes clusters. This presentation was used to share the requirements and dependencies to deploy K8sGPT in a local environment.
4. About me
• Senior Mobile Developer @ Visma e-conomic
👨💻📱
• Passion for UX and design 👨🎨
• Romanian 🇷🇴 living in Copenhagen 🇩🇰
• I ❤ emojis
• 🐈 person
7. Agenda for today 📋
• Intro 👶
• Optionals?
• Data Classes vs POJOs vs Structs
• Standard functions
• Unlock the functional power ⚡
• Delegation 🤝
• Sealed classes
• Glimpse into the future 🔮
9. Kotlin
• Statically typed programming language
• Runs on the Java virtual machine
• Can be compiled to JavaScript source code
• Also can be compiled to native binaries that run
without any VM (more on that later…)
14. Kotlin’s solution
• Integrate nullability in the type system
• Equivalent to Optionals in Swift
• Introduces the notion of Safe calls and Safe
casts
21. POJO vs Data Class
data class Person(var name: String, var age: Int)public class Person {
private String name;
private int age = 0;
public Person(String name, int age) {
this.name = name;
this.age = age;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
22. Data Class
Advantages
• The compiler automatically derives
members from properties
• Support destructuring declarations so it’s
convenient to destructure an object into
a number of variables
fun equals()
fun hashCode()
// will output "User(name=John, age=42)";
fun toString()
// functions corresponding to the properties in their
order of declaration;
fun componentN()
// for when we need to copy an object altering some of
its properties, but keeping the rest unchanged.
fun copy(name: String = this.name, age: Int = this.age)
= User(name, age)
// destructing declarations
val jane = User("Jane", 35)
val (name, age) = jane
println("$name, $age years of age") // prints "Jane, 35
years of age"
23. Data Class
Requirements
• The primary constructor needs to have at least one parameter;
• All primary constructor parameters need to be marked as val or var;
• Data classes cannot be abstract,open,sealed or inner;
25. Swift Struct
• A value type is a type whose value
is copied when it’s assigned to a variable or
constant,or when it’s passed to a function.
• All structures and enumerations are value
types in Swift.
• This means that any structure and enumeration
instances you create—and any value types they
have as properties—are always copied when
they are passed around in your code.
From the Swift Docs
26. Data Class
• From the name,it’s a class
• Java manipulates objects by reference,and all object
variables are references. Only primitives are assignable.
• But we have the generated copy() method right? 🤔
From the Kotlin Docs
32. /**
* Standard.kt
*/
public inline fun <T, R> T.let(block: (T) -> R): R
public inline fun <T> T.also(block: (T) -> Unit): T
public inline fun <T> T.apply(block: T.() -> Unit): T
public inline fun <R> run(block: () -> R): R
public inline fun <T, R> T.run(block: T.() -> R): R
public inline fun <T, R> with(receiver: T, block: T.() -> R): R
} Unwrapping
variables
34. Standard Functions Cheat Sheet
Function Receiver (this) Argument (it) Result
let this@Class String(“…”) Int(13)
also this@Class String(“…”) String(“…”)
run String(“…”) N A Int(13)
run* this@Class N A Int(13)
apply String(“…”) N A String(“…”)
with* String(“…”) N A Int(13)
* those functions are not extension methods, they need to be called the old-fashioned way
Taken from Tomek Polański's blog post
https://bit.ly/2MtqPOg
39. Delegation pattern
• has proven to be a good alternative to
implementing inheritance
• supported natively
• no boilerplate code
40. Delegated properties
lazy()
val lazyValue: String by lazy {
print("Computed ")
"Hello!"
}
fun main(args: Array<String>) {
println(lazyValue) // Prints "Computed Hello!"
println(lazyValue) // Prints "Hello!"
}
41. Delegated properties
observable()
class User {
var name: String by observable("<no name>") {
prop, old, new ->
println("$old -> $new")
}
}
fun main(args: Array<String>) {
val user = User()
user.name = “first" // <no name> -> first
user.name = “second" // first -> second
}
42. Delegated properties
map()
class User(map: Map<String, Any?>) {
val name: String by map
val age: Int by map
}
val user = User(
mapOf(
"name" to "Tudor",
"age" to 27
)
)
fun main(args: Array<String>) {
println(user.name) // Prints "Tudor"
println(user.age) // Prints 27
}
46. • Used for representing restricted class hierarchies
• An extension of enum classes
• Can contain state
What are they?
47. • Filtering on collections can be done using the query string
parameter filter
• A filter is made up of a set of predicates,and follows a syntax
inspired by mongoDB.
• A predicate is made up of a property name,an operator
and a value.
e-conomic API - FilteringUse case
54. Kotlin/Native
• Compiling Kotlin to native binaries that run without any VM.
• It comprises a LLVM-based backend for the Kotlin compiler and a native
implementation of the Kotlin runtime library.
• Primarily designed to allow compilation for platforms where virtual
machines are not desirable or possible (such as iOS,embedded targets) or
to produce a reasonably-sized self-contained program that does not
require an additional runtime.
From the Kotlin Docs
55. Kotlin/Native
• Windows (x86_64 only at the moment)
• Linux (x86_64,arm32,MIPS,MIPS little
endian)
• MacOS (x86_64)
• iOS (arm32 and arm64)
• Android (arm32 and arm64)
• WebAssembly (wasm32 only)
From the Kotlin Docs