23
Who am I? Anghelov Oleg iOS Team Lead YOPESO I love board games and rope jumping

Healthy mind in a healthy code | Oleg Anghelov | CodeWay 2015

  • Upload
    yopeso

  • View
    248

  • Download
    2

Embed Size (px)

Citation preview

Page 1: Healthy mind in a healthy code | Oleg Anghelov | CodeWay 2015

Who am I?

❖ Anghelov Oleg

❖ iOS Team Lead

❖ YOPESO

❖ I love board games and rope jumping

Page 2: Healthy mind in a healthy code | Oleg Anghelov | CodeWay 2015

Today we’ll talk about…

Healthy mind in a healthy code

A story about beautiful functions and discipline

Page 3: Healthy mind in a healthy code | Oleg Anghelov | CodeWay 2015

What is the plan?

❖ Why and how to clean methods

❖ Demo

❖ Q/A

Page 4: Healthy mind in a healthy code | Oleg Anghelov | CodeWay 2015

Methods are essential in our job, lets take care of them

Page 5: Healthy mind in a healthy code | Oleg Anghelov | CodeWay 2015
Page 6: Healthy mind in a healthy code | Oleg Anghelov | CodeWay 2015
Page 7: Healthy mind in a healthy code | Oleg Anghelov | CodeWay 2015

Names!

Page 8: Healthy mind in a healthy code | Oleg Anghelov | CodeWay 2015
Page 9: Healthy mind in a healthy code | Oleg Anghelov | CodeWay 2015

+ (CGRect)firstRectangleForCrossWithRect:(CGRect)rect lineThickness:(CGFloat)thickness

- (void)scheduleFadeoutRespectingMinimumDisplayDuration

Page 10: Healthy mind in a healthy code | Oleg Anghelov | CodeWay 2015

What bother us deep inside?

Page 11: Healthy mind in a healthy code | Oleg Anghelov | CodeWay 2015
Page 12: Healthy mind in a healthy code | Oleg Anghelov | CodeWay 2015
Page 13: Healthy mind in a healthy code | Oleg Anghelov | CodeWay 2015
Page 14: Healthy mind in a healthy code | Oleg Anghelov | CodeWay 2015
Page 15: Healthy mind in a healthy code | Oleg Anghelov | CodeWay 2015

Family life is hard. You are not alone anymore :(

Page 16: Healthy mind in a healthy code | Oleg Anghelov | CodeWay 2015

Algorithms are thoughts

❖ Readable❖ Clear❖ Structured

Page 17: Healthy mind in a healthy code | Oleg Anghelov | CodeWay 2015

One more thing… But what is “one”?

Page 18: Healthy mind in a healthy code | Oleg Anghelov | CodeWay 2015

Our code gets divided in different levels of abstractions

Page 19: Healthy mind in a healthy code | Oleg Anghelov | CodeWay 2015
Page 20: Healthy mind in a healthy code | Oleg Anghelov | CodeWay 2015

Extract till the last drop!

Page 21: Healthy mind in a healthy code | Oleg Anghelov | CodeWay 2015

Demo

Page 22: Healthy mind in a healthy code | Oleg Anghelov | CodeWay 2015

Conclusion

❖ Keep methods as small as possible

❖ Not worry about function call overhead

❖ It saves you and your teammates tons of time

❖ Methods should do only one thing

❖ Extract to last drop

❖ If you can extract one thing from another - do it

Page 23: Healthy mind in a healthy code | Oleg Anghelov | CodeWay 2015

Questions?

[email protected]

❖ Thanks!