I'm not buying this. It basically says "there are a few concepts in Ruby that map nicely to Swift". There are quite a lot of concepts that don't map, for example evaluated classes, which enable things like:<p><pre><code> class Foo
include Virtus.model
attribute :foo, String
end
</code></pre>
Now, I could go on like this, but that would be moot. I just question the basic premise of saying that just because 5 features match somewhat nicely (even if it involves more braces of different kinds), those would be reasons for Rubyists to love Swift. Much in contrast, similarity might not be the most compelling reason to switch to something different.
Optional binding in JavaScript is a misfeature, and Ruby's looks that way too, because 99% of the time when you do this:<p><pre><code> if (hasAccess = true) {
doSomething();
}
</code></pre>
you meant to compare, not assign. So when I saw this Ruby example, I was not amused:<p><pre><code> if current_user = find_current_user
notify_user(current_user)
end
</code></pre>
However, the Swift equivalent is the best of both worlds:<p><pre><code> if let currentUser = findCurrentUser() {
notifyUser(currentUser)
}</code></pre>
<p><pre><code> if current_user = find_current_user
notify_user(current_user)
end
</code></pre>
Funny to see an anti-pattern in C/C++ so lauded in another community.<p>Also, you know what I like about Ruby? I can write it and it'll run everywhere, and it is maintained by a vibrant community effort. Where's that on this list?
Why Rubyist Will Love Swift? Because Apple has published it.<p>Disclaimer: I have walked the tutorial and reference and I belive it is fantastic. I am waiting for someone to release a linux compiler.
The comparisons with scala and c++ are stronger. This is a large language, with a lot of complexity from having to maintain compatibility with an existing environment, plus lots of new concepts bolted on top. Like those languages, the time to basic proficiency may be faster than with their predecessors, but the time to mastery will be much longer.
As a wannabe-rubyist who thinks reading Obj-C is somewhere between having a migraine and using H2SO4 eye drops, so far I'm in love with the language. I'm doing lots of tripping over the Cocoa APIs, though, in no small part due to Xcode.<p>The error messages you get when you've done something wrong are unintuitive at best and downright misleading at worst.<p>Example: I've got a field I want to render an image in. It's represented as an object of type NSImageCell.<p>I've got my image file defined as an object of type NSImage. So far, so good.<p>I type the . after the image cell, and I'm presented with a number of autocomplete suggestions. One of which is a method called "setValue" which accepts an object as an argument.<p>Okay cool.<p><pre><code> myCell.setValue(NSImage(named: "myImage"))
</code></pre>
Compile and.. instacrash with "Unrecognized selector"<p>What?<p>Some research turns up that this error means you've tried to send a message to (call a method on) something that doesn't accept that type of message.<p>Turns out that the method I needed is called setObjectValue. And it also accepts an object as an argument.<p>So, Xcode. Why did you give me setValue as an autocomplete when it isn't valid on that object? Why are these method names nearly identical? <i>facepalm</i><p>And that's before I get into the almost completely worthless inline error messages. "Cannot convert to $T1". What?<p>I really, really like the language, but Xcode is trying its damndest to turn me away. I've got a stack of bugs/feature requests that need to be entered into Apple's reporting tool - hopefully some of these are just warts that'll get fixed as Xcode 6 comes out of beta.
I'm not a rubyist, neither I am a professional programmer, but I'm sad that Apple didn't/couldn't choose Ruby as their main language. Nowadays I'm deciding what programming language to learn as a hobby. Reality (market) tells me that should be JavaScript or right now Swift (looks like javascript for me). It makes me sad, I wish it could be Ruby. So clean and clear. Everything makes sense, I don't need to memorize almost nothing.<p>Edit/Disclaimer: My first contact with programming (besides BASIC) was Autolisp (Autocad scripting) and my professional field is design.