Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Take your Kotlin to the next step, abandon what you’ve learned (in Java)

Take your Kotlin to the next step, abandon what you’ve learned (in Java)

Often Kotlin developers have a Java background. For many of us, that is actually the reason why we love Kotlin so much.

But although we know and like the new features Kotlin gives us, we often hold on to concepts from the Java world. What’s once learned is not easily forgotten. To go Kotlin all the way, we need to unlearn some of those things. But how do we actually learn things and can unlearn what we need to? Let's dive all the way into Kotlin spiced with a bit of Neuroscience.


Danny Preussler

October 17, 2020

More Decks by Danny Preussler

Other Decks in Technology


  1. Embrace change Abandon what you’ve learned @PreusslerBerlin

  2. https://www.thecut.com/2018/01/how-to-conquer-your-fear-of-trying-new-things.html From an evolutionary standpoint, trying new things, for much

    of human history, could have been dangerous
  3. Dean Burnett, Neuroscientist, author We have a threat-detection system that

    [..] tags anything unusual or unknown [..], That's what's kept us alive for millions of years

  5. fixed-mindset prevent them from evolving in the acquisition of skills

    … outside their comfort zone. “Mindset”, Dr. Carol Dweck
  6. growth-mindset certain amount of curiosity, ease and perseverance in solving

    difficult problems “Mindset”, Dr. Carol Dweck
  7. None
  8. None
  9. we learn new knowledge by reference to those we already

    know. We focus on the points of similarity between them to select the information that reaches the brain. http://www.anewya.co.in/why-learn-unlearn-relearn
  10. None
  11. What got you here won’t get you there. Book title

    by Marshall Goldsmith
  12. © Christina Lee, KotlinConf 2019

  13. It is not the strongest of the species that survives,

    not the most intelligent [..] It is the one that is the most adaptable to change. Charles Darwin
  14. Pascal

  15. C/C++

  16. Java

  17. Kotlin

  18. The illiterate of the 21st century will not be those

    who cannot read and write, but those who cannot learn, unlearn, and relearn. Alvin Toffler, Author, Futurist

  20. Constants In Java: static final In Kotlin: const val But

  21. Constants

  22. Constants

  23. Constants

  24. Constants

  25. https://twitter.com/PreusslerBerlin/status/1305565623867633666 Constants


  27. .. is not about forgetting. It’s about the ability to

    choose an alternative mental model or paradigm. https://hbr.org/2016/11/why-the-problem-with-learning-is-unlearning
  28. The process of unlearning: 1.) Recognize that the old mental

    model is no longer relevant or effective. This is a challenge because we are usually unconscious of our mental models https://hbr.org/2016/11/why-the-problem-with-learning-is-unlearning
  29. The process of unlearning: 2.) Find or create a new

    model that can better achieve your goals. Careful, you will probably see this new model through the lens of the old. https://hbr.org/2016/11/why-the-problem-with-learning-is-unlearning
  30. The process of unlearning: 3.) Ingrain the new mental habits


  32. Get functional

  33. Get functional

  34. The tools we use have a profound (and devious) influence

    on our thinking habits, and, therefore, on our thinking abilities. Edsger W. Dijkstra

  36. Operators Thinking of … ? a + b a.plus(b) a

    > b a.compareTo(b) > 0 a in b b.contains(a) a..b a.rangeTo(b)
  37. Operators

  38. Operators

  39. Operators

  40. Developing an original and creative idea requires the simultaneous activation

    of two [..] perhaps even contradictory -- networks University of Haifa 2015 https://www.sciencedaily.com/releases/2015/11/151119104105.htm

  42. Understanding Understanding Source Code with Functional Magnetic Resonance Imaging University

    of Passau, University of Magdeburg, Carnegie Mellon, Georgia Tech, Leibniz Institute for Neurobiology, Metop Research Institute, 2014 http://www.cs.cmu.edu/~ckaestne/pdf/icse14_fmri.pdf Studying programming in the neuroage: just a crazy idea? Chemnitz University of Technology, 2020 https://dl.acm.org/doi/10.1145/3347093 Studies
  43. To our surprise, we could not observe any activity in

    the direction of mathematical or logical thinking, ... https://medicalxpress.com/news/2020-06-language-brain-scans-reveal-coding.html
  44. The image data clearly showed activation in the test subjects'

    left brain areas, which are mainly associated with speech comprehension. https://medicalxpress.com/news/2020-06-language-brain-scans-reveal-coding.html
  45. NAMES

  46. COBOL variable names [..] can use any of the uppercase

    alphabet characters, the digits 0 through 9, and the hyphen (but not as a starting character).
  47. Kotlin Something inside us cringe

  48. social missteps activate regions in the brain, [..] that have

    been previously associated with physical pain. University of Michigan, University of Colorado, Boulder, Columbia University, New York Psychiatric Institute, https://sciencephenomena.wordpress.com/2015/05/10/the-neurological-aspect-of-cringing/
  49. When people express opinions that differ from yours, take it

    as a chance to grow. Be curious, not defensive. http://www.anewya.co.in/why-learn-unlearn-relearn
  50. Practicing unlearning will make it easier and quicker to make

    the shifts as your brain adapts. https://hbr.org/2016/11/why-the-problem-with-learning-is-unlearning

  52. Properties

  53. Properties

  54. Properties

  55. Properties

  56. Properties

  57. Properties

  58. Properties


  60. Property Delegates

  61. Property Delegates

  62. Property Delegates

  63. Property Delegates

  64. Property Delegates

  65. Property Delegates

  66. Property Delegates

  67. Property Delegates

  68. Property Delegates

  69. Property Delegates

  70. Property Delegates

  71. Property Delegates

  72. Property Delegates

  73. Property Delegates


  75. Extension functions

  76. Extension functions

  77. Conceptual Affinity. Certain bits of code want to be near

    other bits. They have a certain conceptual affinity. The stronger that affinity, the less vertical distance there should be between them. (Clean Code, Robert Martin)
  78. Extension functions

  79. Extension functions

  80. Extension functions

  81. Property Delegates

  82. Property Delegates

  83. Think outside the box!

  84. Think outside the box!?

  85. When you look at the neuroscience of creativity, you see

    that it’s physically impossible for your brain to “Think outside the box.” http://www.jaredvolle.com/why-thinking-outside-the-box-is-completely-wrong/
  86. That’s simply not how the brain is wired. It’s like

    asking your brain to fire a neuron that doesn’t exist. http://www.jaredvolle.com/why-thinking-outside-the-box-is-completely-wrong/
  87. There is nothing outside of “the box” except for more

    boxes. [..] the trick is to think between boxes. http://www.jaredvolle.com/why-thinking-outside-the-box-is-completely-wrong/

  89. Generics • Kotlin generics offer some new changes • Don’t

    be afraid if reified syntax
  90. Generics

  91. Generics

  92. Generics

  93. Generics


  95. Habits • Habits are the brain’s internal drivers • brain

    forms neuronal connections based on what you do repeatedly in your life — both good and bad. • Every time you act in the same way, a specific neuronal pattern is stimulated and becomes strengthened in your brain.
  96. None
  97. How to get there - Unlearn: build new models w/o

    looking through old lenses - Connect the boxes - Practise - Change habits
  98. Nothing so needs reforming as other people’s habits Mark Twain

  99. You tell me, I forget. You teach me, I remember.

    You involve me, I learn Benjamin Franklin
  100. When your brain expects a reward even [..], you are

    more likely to pursue the new routine and stick to it. https://medium.com/swlh/to-break-bad-habits-you-really-have-to-change-your-brain-the-neurosci ence-of-change-da735de9afdf
  101. None
  102. None
  103. Thank you • World’s largest open audio platform • Founded

    in 2007 • 200 million tracks, 25 million creators • What’s next in music is first on SoundCloud
  104. Further reads • https://medicalxpress.com/news/2020-06-language-brain-scans-reveal-coding.html • https://www.makeuseof.com/tag/how-programming-affects-brain/ • https://medium.com/swlh/to-break-bad-habits-you-really-have-to-change-your-brain-the-neuroscience-of-chang e-da735de9afdf •

    https://www.sciencedaily.com/releases/2015/11/151119104105.htm • http://www.jaredvolle.com/why-thinking-outside-the-box-is-completely-wrong/ • https://www.thecut.com/2018/01/how-to-conquer-your-fear-of-trying-new-things.html • https://hbr.org/2016/11/why-the-problem-with-learning-is-unlearning • https://thriveglobal.com/stories/unlearning-to-learn/ • https://proandroiddev.com/keep-your-interfaces-simple-e025d515e3b9 • https://www.youtube.com/playlist?list=PLQ176FUIyIUY6SKGl3Cj9yeYibBuRr3Hl&app=desktop
  105. Thank you @PreusslerBerlin