Upload
yopeso
View
248
Download
2
Embed Size (px)
Citation preview
Who am I?
❖ Anghelov Oleg
❖ iOS Team Lead
❖ YOPESO
❖ I love board games and rope jumping
Today we’ll talk about…
Healthy mind in a healthy code
A story about beautiful functions and discipline
What is the plan?
❖ Why and how to clean methods
❖ Demo
❖ Q/A
Methods are essential in our job, lets take care of them
Names!
+ (CGRect)firstRectangleForCrossWithRect:(CGRect)rect lineThickness:(CGFloat)thickness
- (void)scheduleFadeoutRespectingMinimumDisplayDuration
What bother us deep inside?
Family life is hard. You are not alone anymore :(
Algorithms are thoughts
❖ Readable❖ Clear❖ Structured
One more thing… But what is “one”?
Our code gets divided in different levels of abstractions
Extract till the last drop!
Demo
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