Data Science with Kotlin

https://www.safaribooksonline.com/library/view/from-data-science/9781491998205/

Advertisements

Explore Kotlin’s Advanced Functional Programming

Since May 2017 Kotlin released by Google, 12.8% Java developers have converted to Kotlin, yet they still keep to the OO spirit of Java (for Interoperability) , not taking full advantage of FP capability of Kotlin. The OO Design Patterns of Android Java still being used instead of the FP more elegant “Monadic” Design.

1. Interview with Kotlin Designer:

https://www.mappingthejourney.com/single-post/2017/10/26/episode-12-interview-with-andrey-breslav-lead-language-designer-of-kotlin/

2. Android Studio 3.0 Released : https://www.androidauthority.com/android-studio-3-released-810099/

2a. Android Studio v3.0 with Kotlin built-in & many improvements.

(The previous stable v2.3 needs seperate Kotlin plug-in)

https://thenextweb.com/dd/2017/10/27/android-studio-3-0-brings-support-for-kotlin-java-8-and-instant-Features

2c: Gradle upgrade

https://zhuanlan.zhihu.com/p/30722989

3. Inner / Infix Function

http://thetechnocafe.com/more-about-functions-in-kotlin/

4. Test (Mockito)

https://proandroiddev.com/improve-your-tests-with-kotlin-in-android-pt-1-6d0b04017e80

https://proandroiddev.com/improve-your-tests-with-kotlin-in-android-pt-2-f3594e5e7bfd

Kluent library:

https://proandroiddev.com/improve-your-tests-with-kotlin-in-android-pt-3-104e1c9f77cc

5. Function vs Procedure vs MethodKotlin simplifies all 3 into 1 : Function which always returns a value or UNIT.

View story at Medium.com

6. Kotlin has which Java lacks … “with“, “?”, …

https://blog.simon-wirtz.de/kotlin-features-miss-java/

7. Kotlin Operator Overloading aka “Convention”: ‘plus’ / ‘+’

https://blog.simon-wirtz.de/kotlin-conventions-operator-overloading/

8. JVM Byte Code Generation:

https://blog.simon-wirtz.de/kotlin-on-the-jvm-byte-code-generation/

9. Reified Types

https://blog.simon-wirtz.de/kotlin-reified-types/

10. SICP: Sequence as conventional interfaces: eg. flatmap, map, reduce, fold

https://dzone.com/articles/conventional-interfaces-in-functional-programming

11.Kotlin中extensions的用法

https://zhuanlan.zhihu.com/weiweidaolai/27537731

12. Generic : Kotlin入门(11)江湖绝技之特殊函数

https://zhuanlan.zhihu.com/aqi00/28302792

13. Array <String>: Kotlin入门(4)声明与操作数组

https://zhuanlan.zhihu.com/aqi00/27744799

14. ViewPager (Horizontal Swipe)

https://www.raywenderlich.com/169774/viewpager-tutorial-android-getting-started-kotlin

15. Kotlin 1.2 Beta & Multiplatform iOS

https://blog.jetbrains.com/kotlin/2017/11/kotlinconf-keynote-recap/

16. Kotlin Edu ( Android Studio 3.0)

https://www.jetbrains.com/education/kotlin-edu/

17. Kotlin Style Guide

https://android.github.io/kotlin-guides/style.html

18. Android Layout Foundamental – ConstraintLayout

https://developer.android.com/guide/topics/ui/declaring-layout.html

19. Android SDK

https://www.raywenderlich.com/171148/android-sdk-versions-tutorial-2

20. Javalin v1.0 – Web Framework for Java + Kotlin

https://jaxenter.com/javalin-1-0-is-here-138750.html

21. Ten Modern Features (Kotlin, Clojure, Javascript, Swift…)

View story at Medium.com

22. Function literals with receiver

https://blog.simon-wirtz.de/function-literals-with-receiver-quick-introduction/#page

23. Sealed classes: (restricted types no “else”)

https://mindorks.com/course/advance-kotlin/chapter/id/1

24. Android Intent

https://www.raywenderlich.com/171071/android-intents-tutorial-kotlin

Advanced Kotlin Education

Kotlin’s real power is to explore its Functional Programming features, besides the “cosmetic” improvement of concise codes to avoid Java’s annoying boilerplates.

Note: https://www.raywenderlich.com/173352/raywenderlich-com-goes-kotlin-and-needs-tech-editors

* Level of difficulty (* = Simple, ** = Medium, *** = Difficult)

0. What is Functional Programming ?

This Romanian IT expert introduces us to Functional Programming (FP). He has the advices:
1) No need to know deep Category Theory (CT)- but nice to know little bit. (In Romania, the students learn CT in Grade-12 (equivalent JC2);
2) Haskell is the lingua franca of FP. Learn it to understand most FP concepts, even if you later use other FP languages (Kotlin, Scala);
3) Dynamic Type languages (Lisp, Clojure) are not good, because only Static type (eg. Kotlin, Java with “final”) can ensure Immutability which is the essence of FP;

https://alexn.org/blog/2017/10/15/functional-programming.html

1. Sequence over Collection, Sealed Class, Object => new Class

https://medium.com/@manuelvicnt/kotlin-education-d0b958740d6a

2. Function Literal (Lambda Expression) (**)

https://tech.io/playgrounds/6973/kotlin-function-literal-with-receiver

3. “Either” Monad (**)

hcodesttps://kotlin.link/articles/Exploring-an-Either-Monad-in-Kotlin.html

4. Kotlin “DI” Dependency Injection – the “Reader” Monad vs Java Dagger: (***)

View story at Medium.com

5. Function Memoization (**)

View story at Medium.com

6. Remove all ugly “!!” with these 6 Kotlin techniques (*)

https://android.jlelse.eu/how-to-remove-all-from-your-kotlin-code-87dc2c9767fb

7. Generic Extension Function (aka Polymorphism) (**)

https://dzone.com/articles/kotlin-generic-extension-functions

8. Co-routine (Weather app demo) (***)

https://blog.elpassion.com/create-a-clean-code-app-with-kotlin-coroutines-and-android-architecture-components-f533b04b5431

Co-routine Recipes (***)

https://proandroiddev.com/android-coroutine-recipes-33467a4302e9

9. Free Monads (***)

https://github.com/JorgeCastilloPrz/KotlinAndroidFunctional/pull/6

10. Free monoids and Free Monads (***) – (in Scala codes)

http://blog.higher-order.com/blog/2013/08/20/free-monads-and-free-monoids/

11. Operator Overloading (Antonio’s Chap 11) *

https://dzone.com/articles/operator-overloading-and-conventions-in-kotlin

12. Android UI Fragments in Kotlin

https://www.raywenderlich.com/169885/android-fragments-tutorial-introduction-2

13. Design Patterns in Kotlin

https://www.raywenderlich.com/168038/common-design-patterns-android-kotlin

This is still the old Java O-O spirit with abstract (& complex) Design Patterns brought over to Kotlin (which is FP + OO).
FP should get rid of OO thinking!
https://github.com/volodymyrprokopyuk/kotlin-sdp/blob/master/README.md

14. Static Method (Companion Object)

https://dzone.com/articles/kotlin-static-methods

15. Android Animation

https://www.raywenderlich.com/173345/android-animation-tutorial-with-kotlin

16 Kategory (***)

View story at Medium.com

17. Cross-platform strategies (***)

View story at Medium.com

18 Screenshot Testing (Espresso)

https://github.com/Karumi/KataScreenshotKotlin/blob/master/README.md

Kotlin 1.2 Multi-Platform Project

This language feature of writing only once and run on many platform was promised by Java in 1999 through JVM.

Kotlin, a successor of Java supported officially by Google since May 2017, goes further than Java on ambitious multi-platform, not only through Android’s Delvick JVM (a modified version of Oracle’s JVM), also on JavaScript engine (in supported browsers), and compiled to (future) native codes on Microsoft Windows…

http://kotlinlang.org/docs/reference/multiplatform.html

Kotlin 1.2 Beta Release 30/9/2017:

https://blog.jetbrains.com/kotlin/2017/09/kotlin-1-2-beta-is-out/

Kotlin / Java With Android Studio 2017

Antonio Leiva; Kotlin for Android Developers (Online) – preview

https://academy.antonioleiva.com/courses/kotlin-android-developers/lectures/3155590

Exercises:

https://academy.antonioleiva.com/courses/kotlin-android-developers/lectures/3155595#/questions/1

Kotlin:

https://www.raywenderlich.com/132381/kotlin-for-android-an-introduction

recyclerView

https://www.raywenderlich.com/126528/android-recyclerview-tutorial

ProGuard (Shrink Apps Code Size to remove unnecessary support libraries)

https://developer.android.com/studio/build/shrink-code.html

Java:

How to Start Programming – Lesson 1

Java & Android Studio

https://novicedock.com/learn/computer-science/android-development

Documentation:

https://novicedock.com/learn/computer-science/android-development/project-configuration-screens-and-basic-layouts

Mobile Apps’ 2 Camps: Android Kotlin vs iOS Swift

Today mobile apps world is divided into 2 camps:

  • The original Apple iOS camp with 2000s ObjectiveC (improved version Swift from 2015), and
  • The Google Android with 1997 Java “JVM” (improved version Kotlin from 18 May 2017).

Both improved languages (Swift & Kotlin) use Functional Programming features eg. “Type” = Category Math, Data immutability (can’t change at run-time for safe concurrency), execution by composition of “componentised” Functions, including ‘advanced’ aka ‘higher-order’ functions eg reduce, map, filter, etc… which are Category-Math Functors, ‘Monoids’ and its cousin ‘Monads’ for handling side-effects (printl, update database, error msg…).

From 2018 we see these 2 mobile camps unifying into 1 language independent of vendors like the Fortran/Cobol in early 1970s, but which one ? may be one of the “Grand-Fathers” of the “Pure” Functional Programming Haskell (1993) would be adopted by an independent consortium ala W3C Consortium (WWW).

https://dev.to/sciencesoft/kotlin-vs-swift-are-android-and-ios-moving-towards-creating-a-universal-language?from=timeline