[swift-users] Date and Data

Travis Griggs travisgriggs at gmail.com
Wed Aug 3 17:43:52 CDT 2016

> On Aug 3, 2016, at 3:36 PM, Jon Shier <jon at jonshier.com> wrote:
> If you think Date and Data look similar at a glance, wouldn’t NSDate and NSData? Or are you comparing this against your old Array<UInt8> type?

Fair question. I did think of that. I did actually port this code from Objective C. For whatever reason, it wasn’t as noticeable (to me) there. ObjC doesn’t lend itself to as “tight” of code, it’s got extra verbosity everywhere, so maybe it was less noticeable in that case. I honestly don’t know.

I realized right after I wrote this, that I could also

typealias Timestamp = Date

And reap similar benefits. The fact that some have coined data as "The World's Worst Variable Name” makes me tend to shy away from it already I guess.

More information about the swift-users mailing list