Switch to Treehouse! An Introduction to Swift and Xcode and Variables
So this is probably the shortest time between blogs! As described in my last entry, working through the eBook was not working. So I've decided to go back to Treehouse. I always had a positive experience with it before; it helped me to understand the concepts and there were constant practical challenges that helped me gain and develop my knowledge. It was basically more hands-on and an active way to learn.
It does mean a charge of $25 a month, but to be honest, that should be a motivation to use it - rather than dread or guilt for not utilising it and wasting money! Rather like paying for a gym membership, then not actually going to it - that would be the worst thing of all! So this way, it will mean quality time with coding, rather than trying to make sense of something that is beyond me, with no way of testing whether I'm actually at the right point or not.
Right now, I have re-enrolled on Treehouse, where all of my progress has also been saved. That makes life easier - knowing all of that work before wasn't worthless! Something else I have found is on the 'Beginning Swift' course, there is an assessment, which will then determine at what point of the course I learn from. Basically the idea is to eliminate having to go through certain parts again! Will update with how I do on this...
Having completed the assessment, it's clear that I'm not ready to move beyond 'Enumerations!'. So what makes most sense is to go back to the initial course, the basics, just to make sure I consolidate my understanding and have a clear idea of what I know so far. This is a 149 minute course - 2 and a half hours. My goal is to one hour a week. That is the bare minimum and a modest target to get anything like my money's worth! During the Summer Holidays, from around mid-July for a month, I can up this dramatically - to more like an hour a day on average! For now, just the hour per week is most realistic. Starting now!
First Video: Introduction to Swift
History of Swift -
One of the key points that Pasan (the course instructor) makes in the introductory video is to make the most of the questions, discussions and other online tools. As well as that, the Swift eBook - and other documentation - really helps to supplement one's understanding.
He uses Mac OSX, which is handy as that is what I have!
An analogy he uses are directions as instructions - that's what programming is: a series of instructions to carry out a particular task. Swift is the programming language - it has it's own set of rules. In a spoken language, the rules used to construct sentences are called grammar; this is akin to syntax! We use the types and syntax to put together the instructions.
Another positive is that what I'll learn here can be used for Ruby, Python and other programming languages - excellent!
Two main words to take away: TYPES and SYNTAX
Next video: An Introduction to Xcode
Some general information about what Xcode is and how to install it. The version number is different inevitably, due to updates from Apple. It should still be accessible and relevant though. At the moment, my Xcode version is 9.2 - the one on Pasan's video is 8.0.
Next up is creating a Playground file, which is nice and familiar. I've listened to this just to recap.
Third video: Variables
Pasan breaks down what the different parts of the below code mean:
In this example, 'var' is a keyword for 'Variable' - a value that can be changed. A variable is also a container of a value, you could say. It is important to follow the syntax. In real life, we assign objects a name e.g. when we see a tree, we name it - as 'tree'. If we wanted to tell someone else about it, we would use the name given to it.
This all seems obvious now but it is good to make sense of it all! The text within the double quotes is the string. Its type is string.
The = is the assignment operator. This with the string together tells the computer that the string is stored inside the variable. The data is being put inside this box. Using the name of the box means that we can open it up whenever we need it; as humans, we draw on our memories to retrieve this information.
'str' is the name of the variable. It could have been anything.
Declaring a variable - creating an entirely new one, giving it a name and assigning some information to it.
This is now a different type, an Int. All this again is reassuringly familiar! We would only use 'var' for a brand new variable; if we were changing the value of an existing variable, we would just write its name and the new value. Also, I cannot change the type of data. So I can't suddenly make number a string value/of string type etc.
I feel invigorated to accept that I need an entire recap from the start again - it makes sense. It also makes it doable to think that I can catch this up here and there, but most importantly, make sense of it all on here, rather than passively listening to everything from before. Next time, I will look at several more videos - all about the basics. Specifically, I will be starting from 'constants'.
It does mean a charge of $25 a month, but to be honest, that should be a motivation to use it - rather than dread or guilt for not utilising it and wasting money! Rather like paying for a gym membership, then not actually going to it - that would be the worst thing of all! So this way, it will mean quality time with coding, rather than trying to make sense of something that is beyond me, with no way of testing whether I'm actually at the right point or not.
Right now, I have re-enrolled on Treehouse, where all of my progress has also been saved. That makes life easier - knowing all of that work before wasn't worthless! Something else I have found is on the 'Beginning Swift' course, there is an assessment, which will then determine at what point of the course I learn from. Basically the idea is to eliminate having to go through certain parts again! Will update with how I do on this...
Having completed the assessment, it's clear that I'm not ready to move beyond 'Enumerations!'. So what makes most sense is to go back to the initial course, the basics, just to make sure I consolidate my understanding and have a clear idea of what I know so far. This is a 149 minute course - 2 and a half hours. My goal is to one hour a week. That is the bare minimum and a modest target to get anything like my money's worth! During the Summer Holidays, from around mid-July for a month, I can up this dramatically - to more like an hour a day on average! For now, just the hour per week is most realistic. Starting now!
First Video: Introduction to Swift
History of Swift -
- Swift was launched in 2014
- Objective C was the previous popular language
- Apple were called upon to improve the language. Secretly, they had been working on a modern, flexible language - Swift!
- The language needed to be safer, more modern and more powerful - the three key aims
One of the key points that Pasan (the course instructor) makes in the introductory video is to make the most of the questions, discussions and other online tools. As well as that, the Swift eBook - and other documentation - really helps to supplement one's understanding.
He uses Mac OSX, which is handy as that is what I have!
An analogy he uses are directions as instructions - that's what programming is: a series of instructions to carry out a particular task. Swift is the programming language - it has it's own set of rules. In a spoken language, the rules used to construct sentences are called grammar; this is akin to syntax! We use the types and syntax to put together the instructions.
Another positive is that what I'll learn here can be used for Ruby, Python and other programming languages - excellent!
Two main words to take away: TYPES and SYNTAX
Next video: An Introduction to Xcode
Some general information about what Xcode is and how to install it. The version number is different inevitably, due to updates from Apple. It should still be accessible and relevant though. At the moment, my Xcode version is 9.2 - the one on Pasan's video is 8.0.
Next up is creating a Playground file, which is nice and familiar. I've listened to this just to recap.
Third video: Variables
Pasan breaks down what the different parts of the below code mean:
var str = "Hello, playground"
In this example, 'var' is a keyword for 'Variable' - a value that can be changed. A variable is also a container of a value, you could say. It is important to follow the syntax. In real life, we assign objects a name e.g. when we see a tree, we name it - as 'tree'. If we wanted to tell someone else about it, we would use the name given to it.
This all seems obvious now but it is good to make sense of it all! The text within the double quotes is the string. Its type is string.
The = is the assignment operator. This with the string together tells the computer that the string is stored inside the variable. The data is being put inside this box. Using the name of the box means that we can open it up whenever we need it; as humans, we draw on our memories to retrieve this information.
'str' is the name of the variable. It could have been anything.
Declaring a variable - creating an entirely new one, giving it a name and assigning some information to it.
var number = 4
This is now a different type, an Int. All this again is reassuringly familiar! We would only use 'var' for a brand new variable; if we were changing the value of an existing variable, we would just write its name and the new value. Also, I cannot change the type of data. So I can't suddenly make number a string value/of string type etc.
I feel invigorated to accept that I need an entire recap from the start again - it makes sense. It also makes it doable to think that I can catch this up here and there, but most importantly, make sense of it all on here, rather than passively listening to everything from before. Next time, I will look at several more videos - all about the basics. Specifically, I will be starting from 'constants'.
Comments
Post a Comment