Courserea Intro to Programming in Swift - Part 1
So in typical style, I had no time to code for several days! Now I'm finally making a proper start with the Courserea one that I have signed up to. As I mentioned before, the purpose of this blog will be more to write out my 'live' understanding and thoughts about the content, rather than just regurgitating what is there.
Downloading Xcode
All updated - good to go!
Hello Swift
This is the classic - simple beginning. Things taking a while to actually run and come up on Xcode. No bother for now. It looks like there will be exercises that go alongside this course, cool! From learning before, I NEED the challenges to keep my understanding sharp.
Challenge
So now the first challenge has come up. Cool - nice and easy of course at this stage.
Variables
As mentioned already a few times, this a lot of refreshing. Consolidation really.
Different types introduced - String, Int, Double, Bool etc.
Ram - creation of variables takes up ram - memory essentially.
Constants/Variable; mutable/immutable etc.
OK, nice in the exercises that you type in the answers and get actual feedback too. Presumably for more complex ones they will take a little while to get back to me.
Challenge - answered questions no problem.
Next challenge - creating constants and variables - when to use which one, depending on mutability etc. All good!
Strings
Just looking ahead (as this is all recap), I can do a couple more bits then have all of 'week 1' done today.
Apparently in other languages e.g. Javascript, you can change languages easily. But Swift is type safe.
Use of type inference etc.
A bit about concatenation and interpolation. I know those well! These are all within the string section, as that is where these would be - as or within strings. Putting variables into strings.
Cool function - add in the .append to then put text straight after it. Nifty! This is more of a property - computed property of strings? Never mind that for now!
Challenges - all good except that the concatenation isn't strictly correct - I checked in a playground and the plus sign would be there...interesting!
Numbers
Playing around with arithmetic basically.
Compound assignment operator: -= += etc. Shortcuts.
Remainder/modular operator.
Arithmetic and logic is something I'm very confident with.
Challenges - all easy peasy.
So that's week 1 done! I did all of that in no time at all. I didn't record the time spent, don't feel the need. It felt good to get back into it with some easy, refresher stuff. I should be able to do all of Week 2 in another session - in the next couple of days. So a decent start to get back into Swift!
Comments
Post a Comment