Lynda Course - Swift 5 Essential Thinking (Part 8 - FINAL!)

Here we go! The last part - the challenge - of Harrison's course. After this I will review all of the course and focus on what needs practising as several bits have come up that I definitely need to go over. Then I'll look at the next course/plan!

Start Time - 13:48




Let's break this down first. 1 is easy. 2 is all good. 3 is harder but I think I remember the syntax. 4 is, again, tricky but I can do it. Similar with 5 to 7 - error stuff which I may need help with!

Right enough deliberation let's give it a go - without any help first!

Right, so these bits I'm OK with -

// 1

enum ActionError: Error {
    case InsufficientMP, OutOfRange, UnknownError
}

// 2
// 3
func attackEnemy(mp: Int, distance: Doublethrows -> Bool? {
    
    // 4
    guard mp < 10 else {
        throw ActionError.InsufficientMP
    }
    // 5
    guard distance > 5.89 else {
        throw ActionError.OutOfRange
    }
    return true

}

Now I need to check previous entry for 6 and 7....

do {
    try attackEnemy(mp: 4, distance: 3)
    print("Yes those values are OK")
} catch is ActionError {
    print("Those values will not work")
} catch {
    print("Unknown error")
}


Still not sure about 7 so let's see the solutions for 1-6, then get a hint for 7....

func attackEnemy(mp: Int, distance: Doublethrows -> Bool? {
    
    // 4
    guard mp > 10 else {
        throw ActionError.InsufficientMP
    }
    // 5
    guard distance < 5.89 else {
        throw ActionError.OutOfRange
    }
    return true
}



// 6
do {
    try attackEnemy(mp: 4, distance: 3)
    print("Yes attack was successful!")
} catch ActionError.InsufficientMP {
    print("Not enough mp!")
} catch ActionError.OutOfRange{
    print("Values are out of range")
} catch ActionError.UnknownError {
    print("Unknown error")
}

// 7

if let successfulAttack = try? attackEnemy(mp: 7, distance: 12) {
    print("Attack success: \(successfulAttack)")
}

So mixed success there. It's clear that I need more practise with error handling. After a spot of lunch, I am going to go through all of the blogs for this course and unpick what else I need more practise with, and see what with Lynda I can do to fill those gaps. 

Paused at 14:15



Well, I've done some thinking and I've decided to come away from Lynda. There isn't that much on there - not enough to justify paying for it for a whole year and forking out a couple of hundred dollars. Honestly, it there were lots of courses with others in the pipeline, I would go for it as I enjoyed Harrison's. What I've realised is that stand-alone courses don't mean an awful lot. I need something which has regular updates to it. New content and ways of pushing the learning on.

So this gives me a few options -

1. Lynda - as explained above I'm not going with this. Advantages were it was via LinkedIn so all very centralised. Disadvantage of not much at all on there.

2. Udemy. Lots of courses and content. Sales are regular so usually affordable for 'pay as you go'. Disadvantages - most is out of date and quality is very variable. Most courses start well but tail off badly.

3. Treehouse. Liked LinkedIn, all centralised, so good to monitor progress. Interactive challenges to test learning regularly. Disadvantages of being VERY out of date and quality very variable too. I've given up with this one to be honest.

4. RayWenderlich.com. Lots of online content, with regular updates and plenty to be involved in. 20 dollars a month or 15 if committing to a year. Disadvantages - not sure of quality as his Udemy one wasn't exactly great.

5. Learnappmaking.com - the Reinder guy. Sounds impressive and lots of testimonials but no idea about the content quality. Missed sale of 30% off so will leave this until this that comes back around!

SO......

Out of all of those, I'm ruling out 1 (not enough content for the value) and 3 (same reasons). I'm moving away from 2 as these stand alone courses aren't great long term. And 5 is too unknown and without the discount that will come back round again.

So that leaves us with 4! I will buy a month's worth as committing for a year is not worth it. Let's give Ray a chance for a month!



Total Time Coding - 27 minutes
*Not including research for next course!



Comments

Popular posts from this blog

*Xcode Project Entry 2* F1 Quiz - part 1

Angela Yu Course Part 10 (up to lesson 112)

Angela Yu Xcode 12 Course - Part 7 (lectures 74 to 79)