Swift Exceptions

Nick Lockwood has one of the best discussions of Swift exceptions I’ve found both in terms of design, problems and benefits.

Related Posts

  • 85
    “Silver” brings Apple’s Swift language to the .NET and Java worlds. It brings the language not the Cocoa libraries though. Sounds like they added exceptions to let Swift work with .NET or Java better. (Personally I think Apple should add exceptions too, but I know people at Apple really don’t like…
    Tags: exceptions, swift
  • 77
    There were some big changes to Swift this week. The most surprisingly controversial one was the adding of “exceptions.” I put those in quotes because they are quite unlike traditional exceptions in C++, C#, Java or Python even though I’ve called them Pythonesque at times.[1. I think I called them…
    Tags: exceptions, swift
  • 48
    Calling Swift from C.
    Tags: swift
  • 47
    Swift’s command line tools have changed somewhat. (HT: SwiftDevs)
    Tags: swift
  • 47
    Hashbanging Swift. Using Swift at the command line. I had enough issues trying to replace Python with Swift that I went back to Python.
    Tags: swift

Controversial Swift Exceptions

There were some big changes to Swift this week. The most surprisingly controversial one was the adding of “exceptions.” I put those in quotes because they are quite unlike traditional exceptions in C++, C#, Java or Python even though I’ve called them Pythonesque at times.1 Whoa. People on both sides of the debate flip out on that!

There have been two types of reactions.

First (the majority) is excitement. Finally we have something to avoid all those nested and hard to read if statements.

Second (a loud minority) are those groups that hate exceptions or think Swift did them wrong. From what I can tell one group are primarily those coming from ObjcC where exceptions were always warned against. (ObjC has long had C++ styled exceptions but few use them) There’s also the Haskell/Clojure folks who also hate exceptions. Both these groups shout the, “Swift isn’t learning from the mistakes of the past and is dominated by C++ folks.” The related group (sometimes also disliking exceptions in general but sometimes a fan of C++ or related exceptions) are those who note that Swift’s exceptions aren’t even really exceptions. 

Continue reading Controversial Swift Exceptions

  1. I think I called them Pythonesque because it’s fairly common in Python to use exceptions for error handling and not just unexpected catastrophic failures. To be fair not everyone agrees with that type of programming. Also unlike C++ Python’s exceptions are kind of intrinsically tied to an error state and the error state isn’t necessary catastrophic. The calling function is just supposed to respond to the error, fix things up a bit so you can continue and clear the error indicator. (See Python exceptions)

Related Posts

  • 77
    Nick Lockwood has one of the best discussions of Swift exceptions I’ve found both in terms of design, problems and benefits.
    Tags: swift, exceptions
  • 63
    “Silver” brings Apple’s Swift language to the .NET and Java worlds. It brings the language not the Cocoa libraries though. Sounds like they added exceptions to let Swift work with .NET or Java better. (Personally I think Apple should add exceptions too, but I know people at Apple really don’t like…
    Tags: exceptions, swift
  • 54
    Could have sworn I’d linked to this before. But I guess not. It’s well worth reading. Reactive Cocoa in Swift. The biggest issue right now is that Swift can’t see macros in ObjC/C. Given some of the problems that introduces I’ll hold off until things get more mature. The linked…
    Tags: swift, programming

WWDC: How were my predictions?

I knew coming in that the apparent last minute pullout of the new AppleTV would mean a very low key keynote this year. Already we were set to expect a focus on debugging and minor refinement to OS X and iOS. However even so I was pretty surprised. Some parts (especially the watch and the music sections) were really not very streamlined. It was not your typical keynote. It’s too bad since I was very excited about the AppleTV. But I’d rather them do it right than just push it out.

Continue reading WWDC: How were my predictions?

Related Posts

  • 73
    This is the third in my prediction posts. Note I don’t take these too seriously. I’m usually doing well if I bat .500. I’m excluding Apple TV predictions which had their own post as I’m convinced Apple’s updating the hardware. The real question is whether Apple is going to take…
    Tags: apple, wwdc, pro, tb, watch, predictions, hardware
  • 71
    This is the second of my WWDC predictions focusing in on iOS. Obviously given the amount of shared code a lot of this will apply to OS X as well. My Apple TV WWDC predictions can be found here. My old iOS9 wishlist can be found here. I think this…
    Tags: apple, ios, support, ll, expect, ipad, extensions, year, predictions, wwdc
  • 71
    The blog’s been pretty quiet of late as I’ve been extremely busy on other projects (including butting heads with trying to put an ObjC front end to a C++ project in Xcode). In past years though I made my WWDC predictions a few weeks out from the keynote. That’s far…
    Tags: apple, ll, wwdc, predictions, appletv
  • 43
    Well most of my predictions have already been falsified for WWDC. Apple appears to have leaked news that there won’t be a new Apple TV. It’s an odd leak, if that’s what it is. It appears like Apple had planned for new hardware and a new UI but it just wasn’t…
    Tags: apple, wwdc
  • 41
    Intel made its Thunderbolt 3 announcement. Thankfully it won’t require Skylake and will merely be released at the same time. Thus opens the door for a MacPro with TB3 announcement next week at WWDC. The connector will also be USB-C as some had hoped.
    Tags: announcement, thunderbolt, tb, week, wwdc, time, intel

No AppleTV at WWDC

Well most of my predictions have already been falsified for WWDC. Apple appears to have leaked news that there won’t be a new Apple TV. It’s an odd leak, if that’s what it is. It appears like Apple had planned for new hardware and a new UI but it just wasn’t ready. How much of this was due to content deals (presumably primarily CBS and NBC) and how much was an unfinished OS isn’t clear.

The problem is that Apple now has so many “channels” on the Apple TV that it’s very unwieldily. To be honest very few I use. I have ESPN & Netflix on the second row and I very rarely go to the third row or beyond. Further if you don’t already have cable most of them don’t work anyway. There are ways to hide the unwanted icons but most casual users would never guess how to do it. The whole UI needs a rethink.

If Apple really did have Apple TV plans, I hope they don’t delay them too long.

Related Posts

  • 72
    Sorry, been quite busy of late. Just a bit of followup on last week’s event.First I feel a lot better about my MacMini purchase last week. The speed increases were modest and arguably a step back for people doing multitasking. The high end of the Mini seems like a definite step down…
    Tags: apple, tv, wwdc
  • 67
    The blog’s been pretty quiet of late as I’ve been extremely busy on other projects (including butting heads with trying to put an ObjC front end to a C++ project in Xcode). In past years though I made my WWDC predictions a few weeks out from the keynote. That’s far…
    Tags: apple, tv, wwdc
  • 61
    I’ve not written much of late primarily due to just being so busy. However Gruber put up a tweet that made me think about the Remote app for the Apple TV. Apparently the Apple Watch has a remote app that’s actually useful for controlling the Apple TV. Color me surprised.…
    Tags: apple, tv
  • 59
    Lots of stories that Apple’s TV like service is postponed at best to 2016. Since Apple’s been working on this for years but networks like Fox, NBC & CBS don’t want a deal I think we can probably say the deal will never happen. The problem is that the economics…
    Tags: apple, tv
  • 54
    I’m still very skeptical Apple is making a car. This reminds me of the whole “Apple’s solved TV” from a few years ago. Guess what. We have exactly the same TV device we did when those announcements were made. Just now with a whole bunch of new channels I can’t use…
    Tags: apple, tv

Thunderbolt 3 Announced

Intel made its Thunderbolt 3 announcement. Thankfully it won’t require Skylake and will merely be released at the same time. Thus opens the door for a MacPro with TB3 announcement next week at WWDC. The connector will also be USB-C as some had hoped.

Related Posts

  • 80
    Apple filed a patent for using a USB-C connector as an universal connector including thunderbolt. No idea if that means they’ll do it. But it is interesting given some were predicting this.
    Tags: usb-c, connector, tb, thunderbolt
  • 62
    The story about a rumored MacBook Air with a single port has generated a lot of discussion the past few weeks. My favorite discussion was over at Ars and is still ongoing. I'll skip the discussion of the Air itself. While it seems like an odd design to me, I…
    Tags: thunderbolt, usb-c
  • 44
    Michael Tsai always has the best WWDC link roundup. 
    Tags: wwdc
  • 41
    I knew coming in that the apparent last minute pullout of the new AppleTV would mean a very low key keynote this year. Already we were set to expect a focus on debugging and minor refinement to OS X and iOS. However even so I was pretty surprised. Some parts…
    Tags: announcement, time, week, thunderbolt, intel, wwdc, tb