The biggest news that Apple dropped at WWDC 2014 this year is the introduction of the Swift programming language.
It’s going to take a while to sort out the syntax and get used to writing in an entirely new language. I’m not quite sure what to think of the change. I’ve been thinking and writing in Objective-C for so long that it’s very comfortable. I don’t despise its square brackets message-passing notation, the way some developers who are new to the platforms do.
I’ve been learning Haskell for a few weeks and writing about it; and I’ll probably do the same for Swift as time permits. It’s hard not to just dive in, though. So hard, in fact, that I rewrote a little admin tool that I previously wrote in Objective-C. I was curious about how the interaction between Cocoa and Swift would go. The tool just scans the Downloads and Desktop directories for any “qfx” files and deletes them.
Here’s the ObjC version:
and the Swift version:
qfx files are Quicken files. When I download transactions from financial institutions, these are the files that get deposited everywhere. I don’t like having them sitting around; so I wrote this admin tool to weed them out periodically. It’s set to run as a
cron joblaunch agent. ↩