Category Archives: Sideblog

Sideblog posts. Usually links to news stories with a quick comment by me.

Strings in Swift

Strings in Swift. Completely rewritten to account for all the changes in beta 4. I’ve not touched Swift after my initial bought of learning. I’m waiting for it to mature a bit before diving in it again. The problem of string indices and O(N) searching seems to remain a big problem though. Obj-C was always a lousy text processing language IMO. I wish Swift had more of the capabilities of Python in that regard. (Again – get me iterators and the yield statement)

Related Posts

  • 41
    I’d mentioned in passing in one of my Swift posts about using it as a scripting language. Someone on Twitter asked me if I’d convert from using Python to Swift for my scripts. It’s an excellent question that I really can’t answer fully at this stage. The language is still very beta. Most of the…
    Tags: swift, python

On Adding Applescript

On adding Applescript support to your app. (HT: Brent Simmons) I wish, wish, wish more apps added Applescript support. It makes things so much easier. If you’re doing small business software you absolutely should do this. Not because your clients will write Applescript but because they’ll get people to do it for them for automation. Especially to do repetitive actions with Keyboard Maestro. (I wish Daylite has better scriptability)

Swift in Flux

Nice list of what’s changing in Swift. (HT: Michael Tsai) I don’t think most changes will affect people’s existing code, but even so I’d be cautious about using it until things settle down a mite. And of course there are lots of improvements needed in Swift — especially in strings. The biggest flaw I see is the ambiguity about float sizes. The biggest change in beta 3 that will affect existing code is the change of the token for half-closed range operator. However that was so bad I’m still glad they changed it.