Refactoring #2

In this post let us look at a piece of code that was written by senior devs trying to consolidate the code. Since I cannot post the code as it is, lets look at portions of the code. The Codebase Say the codebase is common and shared between variants of the app that can be […]

Refactoring Code – #1

A lot of things have happened since the last time I wrote a post which seems to be around August 2018 here. The post was inspired from a Swift class I was teaching. At the time it was Swift 4.2 and now we have Swift 5.3. During this time, I worked for a few organizations […]

Making a simple Game using Enums

This idea stemmed from the fact that majority of developers create an UI in Interface Builder without an issue, but the real struggle comes when they have to write the code and it was difficult for me to believe at first that writing code or structure is really difficult, so I decided to write these […]

Advanced Usage of Functional Methods

In the last post at reducing-code-for-readability-and-speed which took you through using functional methods instead of loops. The issue was that in some of these functions you might require the index and therefore pushed one back to using loops instead.

Reducing code for readability and speed

In a conversation a couple of days ago, somebody mentioned that they needed to determine the missing digit(checksum) of an ISBN-10 number. This was interesting, specially because this was a perfect example for reducing the lines of code written to resolve this. The specification of ISBN-10 checksum The final character of a ten-digit International Standard […]

Swift Extensions

WWDC 2018 recently concluded and though there was no new hardware, no talk about the HomePod, etc. There was a special emphasis on Developers – both Code and Tools. Swift is now becoming the defacto language for Apple. However it has come to a point where there are many core Objective-C devs that feel Swift […]

Parsing command line options using Swift

There is a higher chance that you might have stayed away from the terminal or the command line, after all the GUI is so much better and easier to use. However if you are like me or Old School, then you might love the command line. In most cases the command-line like a function requires […]

Build your own command extension for OpenTerm

Open Source projects are fun because there are a lot of amazing developers that spend time and effort and create something that all can use. What is more fun is the fact that other amazing talented developers add functionality and features to these open source projects. There is one such project called OpenTerm (was called […]

Add Numbers to get a value so Attitude = 100

You must have come across this little fun stuff that does the rounds on Social Media that adds the alphabets in a word to get a value. This is generally used for Motivational purposes or to prove points. For example, ATTITUDE = 100, BULLSHIT = 103, you get the idea. Let us use Swift to […]