Skip to main content

iOS First Lessons

One of the items I was most interested in finding out about iOS Development was using Unit Tests. To my great delight, the first "Hello World" app walkthrough that I watched, pointed out that Tests come in the default project when you create a new App Project. So I immediately wanted to try out the Tests and see what they are all about.

As someone that has been learning about TDD practices, it came as a bit of a nice surprise that the default Tests, actually fail when I tried to run them without any code. Based on the TDD mantra of Red, Green, Refactor; you would want your Tests to fail first to ensure that your changes would then fix the broken code into a working system.

Looking into the Test Class, I see some code that looks fairly familiar to what I am used to when I create Unit Tests in .NET. There are setUp and tearDown functions that would be used before and after each test. And a single Test function that appears to be throwing an exception because it has not been modified to pass the test yet. It also appears that within that Exception throw, that a message is being built similarly to a String.Format in .NET.

Another reason for wanting to look into iOS development is the speed at which new technologies are coming out. It seems like .NET has focused on making sure that it is backwards compatible and able to work on code from 20+ years ago. iOS development code could not be more than 6 years old at this point, and I would guess that it probably has to be much newer than that. As Apple has pushed forward with new OSes and Devices, they have left behind the old stuff. I think moving forward and onward with better approaches and practices is generally a good idea, but it can sometimes be difficult to sell that idea if the changes you want to make don't provide any direct benefit to the customer. With iOS, you have a built in benefit to the customer, the old code will not work, we have to upgrade or our App will be broken.

Similarly the Xcode IDE is getting upgraded at a very fast pace. Visual Studio has also been getting upgraded very frequently. However, to get all of the features of Xcode, I need to pay nothing. Where to get the minimum features to be functional in Visual Studio, I need to pay $500 and the price goes up from there as you add more functionality. I completely see the value in Visual Studio and love using it. The value and time you get from the price is well worth it. However, it can sometimes be a struggle to get your company to see that and get you upgraded. With VS seemingly on a path of upgrading once a year or so, that cost is going to get harder and harder to convince others of it worth. With iOS development, you won't have to worry about that. You will have the latest and greatest as soon as it is available, because it is free.

Comments

Popular posts from this blog

Converting a Large AngularJS Application to TypeScript Part 2

In part 1 I was able to take an Angular controller written in JavaScript and convert it to a TypeScript file while doing very little to change the code. In this post I am going to explore transitioning that same controller to actually use the features provided in TypeScript. This is how I left off my controller:
declare var angular: any; (function () { 'use strict'; var controller: any = function($scope){ ... } angular .module('app') .controller('controller', controller); controller.$inject = ["$scope"]; })();
While performing the translation from JavaScript to TypeScript, I would make sure at every step that the functionality I expected still worked, so if anything I did broke the system I would change it back and try again with another approach. Also if something seemed like it worked too easily, I would break it on purpose to make sure I wasn't getting a false result through browser caching a previously working fil…

Converting a Large AngularJS Application to TypeScript Part 1

I work on a project that uses AngularJS heavily. Recently we wondered if using a preprocesser like CoffeeScript or TypeScript for our JavaScript would be beneficial. If our team is going to switch languages, we would need to be able to convert existing code over without much pain and we would have to find enough value in switching that it would be worth the conversion.

I had read an article that stated that because TypeScript is a SuperSet of JavaScript, you could convert a plain JavaScript file to TypeScript by changing the extension to .ts and not much else would need to change. I wanted to test out this claim, so I took a file that I was familiar with, an Angular Controller, and tried to convert it to TypeScript to see how much effort it would take and then try to figure out where we would benefit from using TypeScript.

This is what the controller JavaScript file looked like to start out with:
(function () { 'use strict'; angular .module('app') …

Gamify TDD

I like it when things that would not normally be associated with games add concepts from games as a way to incentives you to accomplish things. Why simply go for a run if you can have an app that will track you and give you a gold star if you do better than you did the last time? Why go to the coffee shop that only gives you coffee if the other one will give you points that you can redeem for free drinks eventually?

I was recently introduced to CodeSchool, an online training system similar to PluralSight, it has video courses and challenges you can take to prove that you retained what the video taught. CodeSchool also adds badges and tracks to your learning, so as you complete a video and its challenges you get a badge. Complete a collection of courses within a specific discipline and you become a master of that discipline.

Some of these incentives are not tangible and really don't mean much in the real world, but they tend to work for me. If I start working towards a large goal a…