Swift WTF
swiftwtf.tumblr.com
swiftwtf.tumblr.com
Swift WTF: http://swiftwtf.tumblr.com/image/88465530183)
But it looks fine on my machine (Xcode 6.2): http://imgur.com/rJU7lcx
Chris Lattner
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.
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.
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.
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. :)
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.
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?
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.
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.
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.
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.
Languages like Ruby and Clojure have it best: nil and false are falsy, everything else is truthy.
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).
And my favorite, '\n\r\t' == 0
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..
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.
Flagged.
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.
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.