I’ve made it to Day 3 of learning the programming language, Swift. So far, I have to say that I have been enjoying the syntax. I still type random “;” out of habit, even though I have experience with scripting languages like Lua and Python, I still tend to click the good old “;” out of habit. There are some features that I found interesting such as the way strings and variables are concatenated using the \() formatting. At first I found it obnoxious, but when I had to do stuff with the variables, I found this syntax much easier to read and less confusing when manipulating the variables.
Another feature that I’m enjoying is the function syntax. In this particular example, you’re able to pass through a series of numbers just by simply using
Int... I found this a pretty cool and useful feature.
func sum(numbers: Int…) -> Int
var sum = 0
for number in numbers
sum += number
sum(100, 200, 300)
I am also enjoying that some of the things that I loved about Python are similar in Swift, like the “for” loop syntax. However, in Swift it’s even better, in my opinion, because the loops have brackets as opposed to colons. The familiarity of brackets always makes me feel welcome in any new language that I’m learning. Overall, I’m having more fun than I should discovering and learning Swift so far. Soon, I’ll get to the point where I’ll begin to experiment with Swift in creating an iOS app. Stay tuned!