Sweet Swift Sleep


Hush, little baby, don’t you cry
Mama’s gonna sing you a lullaby
And if that song doesn’t close your eyes
Mama’s gonna get the Swift language guide

To start off open up a new playground
Think of a function and write it down

And if you have not one result but two
Tuples work as your return value

And if it should be a type of its own
Define a new struct that can stand alone

And if you need to change (with care)
Just switch that one simple let to var

And if others need to see that change too
Make it a class, it’s the thing to do

And if one implementation’s not enough
Adding a subclass is not too tough

And if performance is getting worse
Consider adding final, like this verse.

Part of Poem-a-Day 2014. Title donated by Anna Z.