NEW: My new book Pro SwiftUI is out now – level up your SwiftUI skills today! >>

Checkpoint 1: step 1 unclear, it turns out

Forums > 100 Days of SwiftUI

Reading step 1 of Checkpoint 1 "Create a constant holding any temperature in Celsius." I assumed that "any temperature" meant getting a value from the user/keyboard.

After spending, erm, some time trying to sort that I looked at the hints and discovered that what it meant was "Choose a temperature in Celsius and create a constant holding your chosen temperature."

A 3-minute project rather than a fruitless hour-long project.

   

The key words is Create a constant, so you end up with let something = any temperture

let celsius = 50.0

or

let celsius: Double = 50

Then number two convert that into a Fahrenheit

let fahrenheit = celsius * 9 / 5 + 32

Then print it

print("\(celsius)°C is equal to \(fahrenheit)°F")

   

Yes, I did complete the exercise correctly, but I still contend that the phrasing "Create a constant that can hold any number" is confusing—at least once, so far. Different wording would eliminate the confusion.

As programmers, precise language is critical. As a teacher, the same applies.

   

[in reference to an apparently deleted comment]

It is, in fact, a leap, but good communication doesn't assume "people won't leap." Many people taking this course have extensive coding experience and aren't necessarily going to assume this is a baby step.

I'm not saying "There is no other way to interpret this." I'm saying it's ambiguous without good reason.

   

Hacking with Swift is sponsored by Judo

SPONSORED Let’s face it, SwiftUI previews are limited, slow, and painful. Judo takes a different approach to building visually—think Interface Builder for SwiftUI. Build your interface in a completely visual canvas, then drag and drop into your Xcode project and wire up button clicks to custom code. Download the Mac App and start your free trial today!

Try now

Sponsor Hacking with Swift and reach the world's largest Swift community!

Reply to this topic…

You need to create an account or log in to reply.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.