Kotlin
Designed By Hafiz Waleed Hussain

Kotlin

As everyone who is working with Kotlin. They start loving kotlin as I worked in a team with Kotlin Language. I find out more difficulties then easiness and I find out one quote I think from Spider-Man movie. “With great power comes great responsibility.” To me, that is a real use case of this quote.

Expectations from my Kotlin Posts:

Our posts will not be on Kotlin syntax and concepts. Instead, our main focus will be how and where we should use what from Kotlin. Like what is a good use case of let operator.

Java vs Kotlin :

I love both languages. Mostly our argument against Java is, Java is verbose, need to write a lot of code, not idiomatic, etc. But when we started Kotlin reading and writing, we find out we are writing a lot of code in kotlin too. Code is not readable, etc. So all the arguments which we have against Java become useless :(.

Our Mantra “Write less code”:

Write less code. That will be motivation for our Kotlin posts. How we can make that, only we can produce by knowing Kotlin API’s.

Confession:

All our posts will contain my personal opinion. I learn from different sources or experiences. Maybe I will be wrong in some places. So, anyone who feels we can achieve something a better way, please share I am always open to improving myself.

Posts:

Kotlin Collections:

The easiest way to learn Kotlin Collection made your collection. In this series, we will create a class with the name “OurCollection.” That will contain all the methods which are given by Kotlin, but we will implement on our own. So once we will do practice, we will be more comfortable to use these powerful functions. Publish plan of this series as given below:

  1. ourAll, ourAny ( Our Collection API like Kotlin Collection API )
  2. asIterable, asSequence
  3. associate, associateBy, associateByTo, associateTo, associateWith, associateWithTo
  4. average
  5. chunked
  6. component1, component2, component3, component4, component5
  7. contains
  8. count
  9. distinct, distinctBy
  10. drop, dropLast, dropLastWhile, dropWhile
  11. elementAt, elementAtOrElse, elementAtOrNull
  12. filter, filterIndexed, filterIndexedTo, filterIsInstance, filterIsInstanceTo, filterNot, filterNotNull, filterNotNullTo, filterNotTo, filterTo
  13. find, findLast, first, firstOrNull
  14. flatMap, flatMapTo
  15. fold, foldIndexed, foldRight, foldRightIndexed
  16. forEach, forEachIndexed
  17. getOrElse, getOrNull
  18. groupBy, groupByTo, groupingBy
  19. indexOf, indexOfFirst, indexOfLast
  20. intersect
  21. joinTo, joinToString
  22. last, lastIndexOf, lastOrNull
  23. map, mapIndexed, mapIndexedNotNull, mapIndexedNotNullTo, mapIndexedTo, mapNotNull, mapNotNullTo, mapTo
  24. max, maxBy, maxWith
  25. min, minBy
  26. minus, minusElement, minWith
  27. none
  28. onEach
  29. partition, plus, plusElement
  30. random
  31. reduce, reduceIndexed, reduceRight, reduceRightIndexed
  32. requireNoNulls
  33. reverse, reversed
  34. single, singleOrNull
  35. slice
  36. sortBy, sortByDescending, sortDescending, sorted, sortedBy, sortedByDescending, sortedDescending, sortedWith
  37. subtract, sum, sumBy, sumByDouble
  38. take, takeLast, takeLastWhile, takeWhile
  39. toBooleanArray, toByteArray, toCharArray, toCollection, toDoubleArray, toFloatArray, toHashSet, toIntArray, toList, toLongArray, toMutableList, toMutableSet, toSet, toShortArray
  40. union
  41. windowed
  42. withIndex
  43. zip, zipWithNext

要查看或添加评论,请登录

Hafiz Waleed Hussain的更多文章

社区洞察

其他会员也浏览了