Sup!

Swift Slowly: Day 22 - Hacking Swift 5

Today, I decided that I’d use CodeRunner to look at the examples found in the tutorials. It’s part of SetApp.

CodeRunner running a code.

It’s simple and I can just run the code that I want without the overhead. Plus it catches errors that are in code, which helps when I’m going through tests and logic.

Error within application

At this point, you can really, really tell that the lessons are building on top of each other and you can’t rush through them.

Getting a problem wrong

I don’t like making mistakes. When I do, it drives the lesson home and keeps me awake and cautious of what I’m doing.

Error message when you make a mistake

As an added bonus, I’m learning that mistakes shouldn’t effect my ego so much.

Also, I can definitely get along with someone who writes this kind of code.


enum PizzaErrors: Error {
	case hasPineapple
}

How day you wake me up?!

Swift Slowly: Day 21 - Hacking Swift 4

Today is all about loops.

I learned that you can’t loop over a tuple. I think this is because you can’t guarantee that every item will be the same thing.

I got to spend some time look up how to get a real going because it feels like forever to check my answers in a playground sometimes.

Swift Slowly: Day 20 - Hacking Swift 3

I want to point out that I really enjoy the brief discussions on why things are the way they are in Swift.

Why do things this way in Swift?

I got into a grove with the operator overloading and made the assumption that ** was an exponent operator.

I found myself talking through the training and that really helped me with understanding.

I think I’m in the same boat as Paul when it comes to the ternary operators.

I’m very much in the “avoid where possible” camp because even though this code is longer I do find it easier to follow:

I didn’t know that switch statements read the value they were reading once as compared to the if statement which would read it every time that it does a comparison.

Just finished the 1997 film Selena. Good movie but really depressing.

Swift Slowly: Day 19 - Hacking Swift 2

The introduction of complex data types: Arrays, Sets, and Tuples. I normally get sets and tuples mixed up hopefully not after today. I spent some time going through my older run throughs of the material.

In a previous attempt to make it through the 100 days, I had created an Xcode playground with pages for the different days.

Hacking with Swift playground

I’ll brush this bad boy off and use it to take notes. One of the gripes that I have that waiting for results feels kind of nerve wracking as I’m looking at the little spinner in the corner of the status bar.

I liked using playgrounds sometimes to see if certain lines are valid.

Using raw values with associated types

Apparently, you can’t use raw values with associated types in enums.

This one took a while, but I think this time was just a little more fun to do.

Completed!

Guess who isn’t allowed upstairs!

Swift Slowly: Day 18

Working through Paul Hudson’s excellent 100 days of SwiftUI. I thought about changing the title to reflect the fact that I’ll be going through this but decided to stick with this to show that it’s part of a greater arch.

Notable things

Having the _ as a number separator is kind of fun to think about because it reminds me that not every language looks at the comma , the same way.

I like the fact that every section that I’ve looked at has an option page on “why” something is the way it is.

A section pointing to why something is the way it is.

Overall, a very good start to an addition of my programming habit!

Our dog isn’t allowed upstairs.

waiting for the family to come down.

I feel pretty good about limiting my technical projects. Although I do have feelings that I’m missing out, the absence of that feeling of what “I should be doing X”, makes it worth it.