37 comments

[ 2.8 ms ] story [ 88.2 ms ] thread
"There are only two kinds of languages: the ones people complain about and the ones nobody uses."
Swift may in fact be the exception to that rule, as everyone complains about it and almost no-one uses it ;)
If the ones complaining don't even use it, it says much more about those people. ;)
That is a terrible quote, provided by an author trying to defend a fairly awful language. It is rhetorically weaselly, attempting to cast aspersions at critics, without actually providing meaningful defenses.
The examples look really scary.

So far I understood Swift to be the next big thing in terms of hot programming languages with a functional flavor.

Those more proficient with Swift, are posted screenshots manifestations of bugs or are we seeing correct output?

Hoping these are bugs that have been fixed in the meantime.. otherwise this reminds me of Javascript type promotion..

> So far I understood Swift to be the next big thing in terms of hot programming languages with a functional flavor.

Swift is tightly coupled to Apple's platforms (which are of course commercially very viable, and if you develop for them you should be looking at Swift), under a proprietary license and developed under closed governance. It's a legitimate product, but under those circumstances it doesn't really have a shot at being a NBT in programming by itself, beyond contributing its ideas to wider discourse.

It's obvious that no generally relevant library/infrastructure will be written in Swift, for example; if anyone with a great idea choses to implement it in Swift first for whatever reason, it will be a reimplementation in another, more widely useful language that gains widespread popularity.

What does NBT stand for?
"Next Big Thing", taken from the OP.
Are all the issues with Swift to be expected, or does it seem like there are more issues with Swift than one would normally expect normal from a new programming language?
"Xcode 6 beta 3." AKA some software that was never released generally, from July 2014.
Yeah, this is silly to talk about now. I'm sure you can dig up plenty of WTF things about the latest Swift, but few if any of these examples are still valid.
This is a blog whose latest entries deal with Xcode 6.0 beta 3 (out of at least 7 eventual betas, many of which made substantial changes to the language). Right now, the 'standard' Swift version is Xcode 6.1's (Swift 1.1), and Swift 1.2 is in its third beta. So it's definitely not representative of the current state of the language (which was, admittedly, in pretty awful shape at that point in time).
IMHO those bad examples are more or less bad, because of the high expectations and reputation of the company that released the language. Having in mind the age of Swift this site would not be so surprising if behind it there was a smaller team.

It would be really better if Apple go back in time and release working products in their first version. I understand having so big user (developer) base is hard, but as far as what we see from the financial reports they can easily afford having better software, by improving some development processes.

you classify a problem you don't even fully understand as easily solved because you're willing to spend other people's money freely. you have upper management written all over you.
Great reply, although I was hoping to make a discussion out of this.

Negative sentences doesn't contain as much information as positive ones.

"I don't like what you like" carries less information than "I like [something different]".

In other words. If you tell me what your opinion is I might change mine too.

The equality and truthiness oddities are the worst. One of my biggest pet peeves about languages is weird equality rules. PHP is one of the worst, there is a huge table of crazy rules that I suppose expert PHP people can remember, but it just seems crazy.

Languages like Ruby and Clojure have it best: nil and false are falsy, everything else is truthy.

Swift's rules are pretty simple too: true is true, false is false, and nothing else is any sort of boolean. If you want to check whether an array is empty, do so explicitly. If you want to test an integer for zero, you have to do == 0. Even testing for nil requires an explicit != nil.

As for equality, I think it's just old bugs from an old prerelease compiler. These posts are ancient history, relatively speaking. I just tested on the latest public release and a == [1], [1] == a, and [1] == [1] all produced true, as one would expect. str === str won't compile, also as one would expect (String is a value type, and as such comparing object identity is nonsensical).

PHP is pretty bad, but I think JS really takes the crown for insane equality comparisons. Basically every weird equality comparison from PHP is in JS, along with some other humdingers like 0 == [].

And my favorite, '\n\r\t' == 0

There is never a good reason to use ==.
I totally agree, but they were bringing up the insane equality rules in PHP using the == operator, so I did likewise in Javascript. Both languages luckily have fantastically logical === operators.
Learning iOS dev, coming from a js background, I have very few complaints about swift. It is in fact a very nice language.

The biggest pain is apple's frameworks and ide. The APIs are very inelegant and arbitrary. The worst thing is the drag and drop interface builder. I believe that the people who designed it never actually built an iPhone app with it. You can always get about 80% of what you want, then you have to resort to some outrageous hack and stitch the rest of it together with verbose imperative code. Declarative web dev with html really is a huge step up from Apple's stupid drag and drop thing.

Hopefully Swift is the start of Apple putting together a sane, modern development environment.

I've never done any iOS development due to job market (mostly contracts/consulting, not my kind of thing at the moment) and due to Apple track record on Development Environment (Drag-n-Drop, meh-IDE, etc) but I have to wonder, Microsoft, GWT (when it was still backed by Google), Android UI, Qt do support (or move toward the direction of) declarative UI model type of development. Only Apple that does not (right now I guess), what gives?

Most platforms that come out these days usually have support for:

1) dependency management

2) some sort of way to make build from command line (CI integration)

3) unit-testing framework and runner

4) SCM strategy that unifies unit-test/integration-test runner, build the thing, package it to the point of ready to ship...

How are these handle in the world of iOS which is backed by a multi-billion dollars company?

> Microsoft, GWT (when it was still backed by Google), Android UI, Qt do support (or move toward the direction of) declarative UI model type of development. Only Apple that does not (right now I guess), what gives?

What does you mean by "declarative UI model"? You have been able to define UI declaratively using Interface Builder since day one. Do you mean something more than this?

> dependency management

CocoaPods or Carthage.

> some sort of way to make build from command line (CI integration)

xcodebuild.

> unit-testing framework and runner

XCTest.

> SCM strategy that unifies unit-test/integration-test runner, build the thing, package it to the point of ready to ship..

Can you give an example? Xcode Server does at least some of this. I don't think this is something commonly provided as a standard part of most platforms.

> The biggest pain is apple's frameworks and ide. The APIs are very inelegant and arbitrary.

I can't agree with that at all – Apple's frameworks are among the most consistent I've ever seen. They have a small number of solid design patterns that they stick to that serve them very well. Picking up new frameworks is usually extremely easy because of this consistency. They are far beyond JavaScript in this respect.

> The worst thing is the drag and drop interface builder. I believe that the people who designed it never actually built an iPhone app with it. You can always get about 80% of what you want, then you have to resort to some outrageous hack and stitch the rest of it together with verbose imperative code.

Interface Builder certainly has its shortcomings, but the most frequent complaints I see about it are from people who haven't taken the time to learn it properly and fall back to imperative code in preference to learning how to use Interface Builder properly.

Also, 80% declarative UI and 20% imperative code is a pretty fair mix – unless you are designing extremely simple applications, you shouldn't expect to put together an entire user interface using nothing but drag and drop tools. That's not an effective way to work regardless of the quality of the drag and drop tools.

> Declarative web dev with html really is a huge step up from Apple's stupid drag and drop thing.

They are really two different worlds. Most of the time, one or the other is clearly the better choice for any given project, but it doesn't really make sense to say that one is better than the other overall.

Idunno... its a matter of opinion I suppose. But a drag and drop editor is just foolish, and they have never worked well. Here's how you adjust kerning:

http://stackoverflow.com/questions/7370013/how-to-set-kernin...

They really should have woken up and done a nice markup language and a styling language to go with it a very long time ago.

> a drag and drop editor is just foolish, and they have never worked well.

They work great for what they are designed for if you learn how to use them effectively. If you use them for things they aren't designed for or you assume that just because it's a GUI editor you can click around and build things without knowing what you are doing, then you're going to run into problems. This is not a problem with the tool.

> Here's how you adjust kerning

No, that's how you adjust kerning if you want to do it manually as a one-off task. It's trivial to wrap that up into something you can use in Interface Builder for day-to-day work.

This is exactly the kind of thing I was referring to wit the 80/20 split I mentioned. You use Interface Builder to create your user interface. It's not Photoshop. Fine control over the details, such as character-by-character adjustment of kerning, is more effectively done elsewhere. But just because you don't have Photoshop-level control over the details, it doesn't meant that it's not a great tool for the other 80% of GUI work.

I also don't understand how pointing out how to do kerning with code is a criticism of Interface Builder. You realise that if you create all your GUIs by avoiding Interface Builder you still have to use those APIs for kerning? That's not how you do kerning in Interface Builder, it's got nothing to do with Interface Builder. That's how you do it in code.

I predict this blog will run out of content real fast. I also notice the author conveniently left out the timestamps for their posts.

Swift is still very new, crashes in the language and in the IDE will not surprise anyone who calls himself a software engineer.

I don't write code on iOS or MacOS but Swift looks very solid to me and an obvious improvement over Objective C.

It kinda seems like it already has run out of content. Most of the examples are using either a beta version of Xcode or version 6.0, at least 2 minor versions behind. As a few people have pointed out, some of the examples aren't even reproducible on the current versions.
The last post is from July of last year, only a month after the language got its first public reveal.
>Swift is still very new, crashes in the language and in the IDE will not surprise anyone who calls himself a software engineer.

And yet Rust is reliable as fuck even in its current shape.

Swift has no excuse to be so unpredictable, especially given that it's back by a humongous commercial company.

Rust hasn't even gone 1.0 and they're doing nightly releases. Just from that, I'd say that it's not ready for production so it hasn't reached "reliable as fuck".

People are shipping production Swift. And as people have already mentioned, these examples were from last year, and many issues have already been fixed.

Anyway, I know it feels good to throw stones but it really adds no value to the conversation.

> And yet Rust is reliable as fuck even in its current shape.

I appreciate your vote of confidence in the team, but Rust has been in development for five years at this point, while Swift hasn't. :)

This blog is from when the language was first announced, yet most people commenting seem to think it is current, and thus imply that SWIFT is in worse shape than it is.

Flagged.