filmov
tv
Refactoring to single-expression function in Kotlin

Показать описание
In this pair programming session Duncan McGregor navigates me through the refactoring steps from the upcoming "Java to Kotlin" book to convert Kotlin function from block body to a single expression.
-------------------
Timecodes
-------------------
00:00 - Intro
01:27 - Code overview
06:00 - Inline atIndex variable (exploring that fact that we can do it)
Refactoring attempt 1
09:48 - Extract emailAddress() function, convert parse() to single expression
14:20 - Inline require()
17:38 - Convert emailAddress() to single expression
19:22 - Refactoring conclusions, revert
Refactoring attempt 2
21:00 - Convert parse() to single expression using .let()
24:42 - Move require() into .also()
26:40 - Refactoring conclusions, revert
Refactoring attempt 3
27:50 - Another look at what parse() function is doing
30:41 - Extract split() function
32:42 - Covert parse() to single expression using .let()
34:00 - Refactor split()
36:00 - Covert split() to single expression using .let()
37:03 - Rename split() to splitAround(), make it more generic
40:25 - What have we learned?
43:42 - "Java to Kotlin" book
---------
Links
---------
#Refactoring #Kotlin #FunctionalProgramming #PairProgramming #LiveCoding
-------------------
Timecodes
-------------------
00:00 - Intro
01:27 - Code overview
06:00 - Inline atIndex variable (exploring that fact that we can do it)
Refactoring attempt 1
09:48 - Extract emailAddress() function, convert parse() to single expression
14:20 - Inline require()
17:38 - Convert emailAddress() to single expression
19:22 - Refactoring conclusions, revert
Refactoring attempt 2
21:00 - Convert parse() to single expression using .let()
24:42 - Move require() into .also()
26:40 - Refactoring conclusions, revert
Refactoring attempt 3
27:50 - Another look at what parse() function is doing
30:41 - Extract split() function
32:42 - Covert parse() to single expression using .let()
34:00 - Refactor split()
36:00 - Covert split() to single expression using .let()
37:03 - Rename split() to splitAround(), make it more generic
40:25 - What have we learned?
43:42 - "Java to Kotlin" book
---------
Links
---------
#Refactoring #Kotlin #FunctionalProgramming #PairProgramming #LiveCoding
Refactoring to single-expression function in Kotlin
13-Single Expression Function in Kotlin
Kotlin Multi to Single Expression Functions
Learning Kotlin: How to Write a Single Expression Function in Kotlin
Kotlin Tutorial -15: Single Expression Function | Dr Vipin Classes
Refactoring to extension functions in Kotlin
Improve Readability by Having One Return Statement | Refactoring With PhpStorm by Matthew Setter #5
Refactoring your Code with Java 8 Functional Programming to the Rescue
Single Expression functions in kotlin
Refactoring a large and complex Java application to Kotlin by Irwan Syahrir
Clojure Code Refactoring - Tips From a Mentor
Refactoring to Functional Programming in Java - Live-Coding Kata - 'Yatzi' - part 1
CppCon2014: Hyrum Wright 'Large-Scale Refactoring @ Google'
Refactoring LINQ Queries: Convert Dictionary Lookups into a Single Lambda Expression
Refactoring Reflected with Simon Thompson
Lecture 8 Section 1 -- If Refactoring
Pragmatic Functional Refactoring with Java 8 by Raoul-Gabriel Urma
Android Chess 043: Single expression functions of Kotlin
Gilded Rose Refactoring using the Open-Closed Principle
Venkat Subramaniam - Refactoring from Imperative to Functional Style
Crossing the Gap from Imperative to Functional Programming Through Refactoring - Peter Burka
ReSharper C++ Quick Tips: Postfix Completion
Refactoring in the DVT Eclipse IDE - How to Perform Extract to Variable Refactoring
Codemod Crash Course: Automate Refactoring with jscodeshift
Комментарии