Magic Numbers

Magic numbers term refers to using numbers directly in your code. The assumption among some developers is that each number should have a variable name assigned to it. However, the general rule is that only unclear or repeating numbers should be assigned to a constant for readability and maintainability. There is a difference.

A good example would be the greatest number in the whole world – 3.14159265358979323846. You don’t want to use this number each time you need it in your code. Assigning it to a constant would be a much better solution. Your developer buddies will love you to death for doing that.

Continue reading “Magic Numbers”

Magic Numbers

Unwind Segues Effect

As in Mass Effect… anyone? OK, so yesterday on my way home from CodeFellows HQ I was going through the list of things I wanted to read and came across an article I saved a while back called “Unwinding”. The title sounded interesting and since I had nothing better to do on my 40 min bus ride, I decided to give it a read.

Typically when you present a view controller (modally), presenting view controller is set to be the delegate and is responsible for dismissing it when the user is done performing his / her task. While it is possible to dismiss presented view controller from within itself, that’s not the pattern to pursue.

Continue reading “Unwind Segues Effect”

Unwind Segues Effect