Swift: mumble mumble thoughts

untitled-1401863-m

Today I bring you a bunch of random observations.

I long for early return. Would it be too much to ask for:

require(a, b, c) {if any are nil, handle the error and provide an early return}
//use a, b, c here as they are now unwrapped

It would also be nice to have selfie blocks where all items are scoped to self the way they are in class/struct definitions, something like

with(foo) {
    property1 = true
    property2 = thisstring
}

AVFoundation !<3 Playgrounds. Amusing errors when you attempt to play audio.

Sometimes the bug is in another castle. And it’s someone else’s bug. Was helping someone last night in #swift-lang. He was complaining about a bug using shape nodes, but it turns out shape nodes work fine. It’s the printable protocol that has the bug. Video here.

Fun ways to crash Xcode / Playgrounds. Add a new resource while the playground is running in extended execution.

Playground complaints. Running in sim and/or switching on rendered documentation shouldn’t kill my undo/redo stack.

Analyze please. I long for Swift static analysis, especially to find not just memory management issues but language cruft, so I can trim down enumerations, etc.

Playground sources tip du jour. If you fix a bug and the bug persists, execute the playground again. For some reason, edits aren’t being picked up for me until the 2nd compilation. Go figure.

I spent time yesterday mastering swift sets. And then I spent even more time converting them all to arrays because I wanted them ordered in the end. (Topic was UTI conformance.)

Comments are closed.