TheRightLane on Coding

Using defer in Swift in 2 minutes

September 26, 2017

"Subtly useful" is not something that is usually said about programming constructs. But "defer" is without doubt a perfect candidate for being subtly useful. Why? Defer is a way of telling a code block to execute when the function exits. If you haven...

Read on!

Writing the right code

September 24, 2017

I'm going to be straight with you. Most of the code you write is garbage and should never have been written! Controversial? Mean? Yes! Good, maybe it will make you change how you code. What am I doing wrong? The main culprit is over thinking. If you...

Read on!

Swift let and var In 2 minutes

September 22, 2017

One of the first things a coder notices about Swift is var and let. It seems like an odd system at first and when you add in optionals it can seem downright bizarre. Wha??? Let's start again. What is var? Var is exactly what you would expect it is...

Read on!

Basic programming math in 2 minutes

September 20, 2017

That's right! I'm gonna teach you all the math you need to know in 2 minutes! Feel free to send me the $30,000 you were going to pay some university! SWEET! Ok, not really, but here are the basics that you absolutely MUST know to be a working coder...

Read on!

Swift guard 2 minutes

September 18, 2017

Guard is the number one thing you can do to make you code look and feel pro! Big statement? Yes, but after you start using guard you will find your code is better in almost every way! I don't care how my code looks! It just works. Bullshit! Pretty...

Read on!

Swift if and if let in 2 minutes

September 16, 2017

Swift has an awesome and unique if system. My favorite thing about it is that it doesn't need parenthesis! Seriously! Don't use them! Don't waste time! This isn't Java! Swifty! Ugly! So what's up with if let The best way to understand if let is...

Read on!

For loops in Swift In 2 minutes

September 14, 2017

The first question I get from coders starting Swift is what's up with the for loops? What's up with Swift's for loops? Loops are one of Swifts best features. I know that sounds stupid but use Swift for a few hours and then switch to a language with C...

Read on!

Fizzbuzz In 2 minutes

September 12, 2017

If you are going to get a coding job you are going to have to interview. At one of those interviews, eventually , you will get asked to do fizzbuzz. So, what is it? Fizzbuzz is a simple question There is a child's counting game called Fizzbuzz, it...

Read on!

Swift Hello World in 2 minutes

September 10, 2017

Printing out "Hello World" is probably the most pointless thing you could spend time on. It wasn't always that way. Back in a time when getting ANY program to run on your computer was an achievement it made sense to have a consistent test to show...

Read on!