Now that I’ve solidified the concept, I’ve written it fully in a document that helps keep all my thoughts in order. When I get lost in the code, I can return to this document and remind myself what it’s all about.
As I said before, I’m using Xcode 7 for Mac. At first I was going to jump into the books in the library to grab some information, but sadly they’re all for previous versions. I’m sure the content’ll be similar, but it’s best to keep as up-to-date as possible, so it’s to YouTube I go. I’ll be following these tutorials to start with, and possibly branch out to other videos once I get well underway.
In addition, I’ve got the other half helping me. He’s familiar with basic C++ coding. The plan is that we watch the videos together, and if I get stuck with any of the things discussed, he can bail me out and show me where I went wrong. This is another one of those ideas which is either brilliant or really stupid. With any luck we’ll still be married by the end of this…
I have to say, so far so good. I’m working in Xcode’s ‘My Playground’ feature at the moment, which allows users to just mess around with code to see what can be done. It’s very clear that you need something to help guide you with programming language. That’s the bit I’ve got to get to grips with, as nothing will work if you don’t know it. Xcode doesn’t have a feature that explains this to you; so having YouTube handy is a real plus.
It’s also useful to note that Xcode uses Apple’s Swift coding. Although (I have been informed) it is similar to C++ and other coding languages, it’s not identical, so don’t be fooled into thinking that if you’re vaguely familiar with one system, you’ll know this one. However, to someone brand new to coding, Swift is beginner-friendly, and keeps things simple for you.
I’ve wrapped my head around ‘var message = “Hello World”’ and I’m pretty proud of that first step. In fact (and yes, I am very aware that these are the early stages) it all seems fairly straightforward. The easiest thing to compare it to is very basic algebra. Don’t worry, a degree in mathematics doesn’t seem to be necessary; just remember that letters or words can stand in the place of numbers.
A = 10
B = 20
A + B = 30
That’s it. Easy, right?
As long as you understand what the variable stands for and how that can work in relation to the ‘if’, then it makes reasonable sense. ‘if’ is the logic of the coding. It’s basically the code’s way of saying: ‘If this happens, then this can happen.’ I can understand that.
To take the above example:
If A + B (30) is greater an amount than A (10) then you can make the code say “hello”.
Or in the actual code:
if (A + B > A)
So I think I’m ready to move onto the next stuff. I really want to know how all this translates into the finished products we see and interact with every day. It’s one thing to understand a line of letters and numbers as one being related in some way to the other, but just how does it translate into the decision making processes of the user?
We shall find out…