Archive for programming

Bits, Bytes & The iPhone SDK

// September 5th, 2008 // No Comments » // iphone, mac osx, objective-c, programming

So I’ve been toying with the idea of building an application for the iPhone and yesterday I finally decided to download the SDK. After agreeing to give my soul to Apple as stipulated in their Terms & Conditions and 8 hours of downloading later I finally got the full SDK.

I have been trolling through their documentation and it looks like I will have to get my hands dirty in Objective-C. Which, from what I can tell, is a slightly cleaner version of C++ specifically designed for Mac OSX. In case you didn’t know, the iPhone runs on a heavily modified version of the Mac OSX kernel. This has its benefits in that by learning to program for the iPhone I will also slowly become accustomed to writing programs for Mac.

The easiest way to learn a programming language is to remember that they are all essentially the same. Don’t get confused between a programming language and a markup language. I can’t tell you how many times I have read on programmer resum├ęs that HTML is a programming language. HTML is a markup language – a way of describing visual data in a hierarchical textual fashion. A programming language is a set of statements that can be executed sequentially and all procedural programming languages follow a similar set of rules and contain 3 specific constructs:

  1. Variables
  2. Conditional statements
  3. And Loops

With these three constructs it is possible, with great pain I might add, to build any program.

Of course a programming language is of no use if there is no way of interpreting it. Way back in the days before Microsoft and Apple, programs were created on punch cards – pieces of cardboard with rows of holes punched in them. Every hole represented a 1 and every non-hole represented a 0. The punch cards were fed through the computer which would read the rows sequentially and then execute them. Punch cards are so old they were first used back in the 18th century to control weaving looms and were used up until the last century still.

So-called ‘modern’ computers work in much the same way. High-level programming languages such as C++ and Java are compiled by another piece of software, called a compiler and converted to what is known as Assembly Language. Assembly language is a low level language used to program hardware, such as your computer’s CPU. Assembly code is then converted to what is known as Object Code. Object Code is the final sequence of 1s and 0s – the holes and non-holes on punch cards.

Every single computer program you use is constructed in this way. So next time you get the dreaded ‘blue-screen-of-death’ or your e-mail application crashes, just remember how many 1s and 0s are moving through the system. A modern car consists of approximately 12000 parts. Microsoft Windows XP consists of approximately 1 billion lines of code and it works 99% of the time. That is absolutely incredible!

I guess what I am trying to say here is that learning how to program within the iPhone SDK and learning Objective-C is trivial compared to building an operating system like Mac OSX or programming a computer’s CPU. It’s made even easier if we remember that all procedural programming languages are constructed out of similar building blocks and that if we learn and understand the basics of a subject we can go on to learn just about anything.

Post 1: In The Beginning

// September 3rd, 2008 // 1 Comment » // chesscube, fourhourworkweek, programming

OK here goes. This is my first post ever on a blog, so excuse the badly phrased English, terrible punctuation and generally boring parts of my mind. I promise I will get better at this.

I have been listening to the Four Hour Work Week audio book and am now inspired to start something of my own. Something that is fairly automated in terms of generating income but also fun. I am a firm believer in doing something every day that I enjoy and this has to be one of them.

Hey, but wait a sec, perhaps I should start from the beginning. I am 27 years and 345 days old. I was born in Johannesburg, South Africa and now live in Cape Town, South Africa. I went to St. Alban’s College for high school and graduated from the University of Cape Town with an Honours Degree in Computer Science. So yes, I am a programmer/software developer/general technology nerd.

I work for a company called ChessCube. It’s a site for chess enthusiasts. We are a team of 5 developers and the job rocks! Apart from participating in building a highly successful Chess Social Network, I have been involved in some really exciting projects, namely:

  1. ChessCube Cinema
  2. ChessCube Research
  3. Superlecturing
  4. Scaling on Amazon EC2

During the course of writing for this blog I will go into some more details for these projects. The day-to-day technical challenges that we face and how we solve them.

So you’re probably wondering by now why on earth am I looking at doing other work outside of my current job. Well firstly, I feel that I need to create something for myself, something that I can be proud of and something that I ultimately own and from which I can make a little bit of auxilliary income. I also want to learn new things and express myself. So enough of the sappy stuff lets get right into it.