6 ms·
I'm not sure I understand the point of his post. In all the examples he gives Swift comes with better and more succint syntax plus more safety than Obj-C, and
by coldtea 12y ago
I'm not sure I understand the point of his post.
In all the examples he gives Swift comes with better and more succint syntax plus more safety than Obj-C, and on par with his "Obj-C 3.0" idea.
And of course it has tons of other features and flexibility he doesn't delve into.
The whole post for me boils down to his "I hate Generics" rant at the end.
- dkarapetyan 12y agoThis is just a side-effect of the blub paradox disease. One of the symptoms for those that are afflicted with it is ranty blog posts about new languages that the afflicted person does not perceive as being better because it doesn't really have the same semantics as the one language they are used to. I think it was Douglas Crockford that said this. We don't get new and better technology because the old people accept it. We get new and better technology because the people using the old crap just die out.
- danidiaz 12y agoMax Planck said something similar about new theories in physics.
- lerno 12y agoIf you had followed what Owens has written and done in Swift, you know that he has worked and pondered the language quite a bit. Dismissing it as due to "blub" is disingenuous. Aside from brushing away the value of his opinions, such a statement also implies that Swift is in some way sufficiently removed from mainstream languages as to feel "foreign". That is not true. Swift is a pragmatic amalgam of features from many modern languages. The issue here is that many of the ideas are not fully realized and stunted to work within the constraints for the language (such as seamless C/ObjC interop). This is what is causing generics to only be halfway there (and same with several other features). In generics, Swift aims for strictly typed, reified generics, but then leaves you only with very crude tools to create them with. Generics in Swift is an exercise in frustration. Owens' feelings for generics might have changed if the support had been more complete.
- dkarapetyan 12y agoWhen it comes to programming language reviews I don't think there is any value in them regardless of who is doing the review. Steve Yegge in one of his epic posts explains why everyone should design a language from scratch to see what the process is like. Once you do that the magic and wonder disappears and you realize both how hard and easy it can be depending on what constraints you have. Here's a nice starting point http://nathansuniversity.com/ http://nathansuniversity.com/.
- lerno 12y agoYou're the one who evoked "blub", essentially insinuating that the reason for his inability to appreciate the language was due to him not being used to it. I addressed that, and your counter with that it's "hard to make a programming language"? Of course it's hard. And the problem with Swift is that it tried to do so many things at once, even with the hard constraints it had. And this is precisely why the language ends up short of its goal. Speaking of ObjC 3.0, the point of the author is simply that an incremental improvement on ObjC which simply removes redundant syntax from ObjC would have been just as useful but much easier to get up and running. The features that Swift tries to incorporate are admirable and interesting for the most part, but the implementation falls short because it's quite simply too ambitious to even reach "usable" until 3.0 or something.
- dkarapetyan 12y agoYou're putting words in my mouth. I did not say "it is hard to make programming languages". It is a skill like any other that can be improved with sustained practice. My point is most of these conversations about the merits/demerits of languages are less than useless. Here's a programming language checklist http://colinm.org/language_checklist.html http://colinm.org/language_checklist.html and another one about the history of programming languages http://james-iry.blogspot.com/2009/05/brief-incomplete-and-mostly-wrong.html http://james-iry.blogspot.com/2009/05/brief-incomplete-and-m.... This post was just a variation of the checklist which indicates to me the author is not really interested in any kind of deep analysis of the language and is just publicly bitching and moaning. That to me is an indicator of the blub disease.
- zvrba 12y ago> it doesn't really have the same semantics as the one language they are used to His complaint is that Swift does have mostly the same semantics as Objective C, and offers only a prettified syntax.
- deleted 12y ago[deleted]
- emodendroket 12y ago> I think it was Douglas Crockford that said this. We don't get new and better technology because the old people accept it. We get new and better technology because the people using the old crap just die out. A bit ironic considering what a stick-in-the-mud he is.
- mpweiher 12y agoPost https://news.ycombinator.com/item?id=8367012 https://news.ycombinator.com/item?id=8367012 suggests that it is actually Swift that is the Blub language...
- dkarapetyan 12y agoI don't see how. Being a blub language has nothing to do with ease of use for newcomers and in fact no language can be a blub language. It is more a reflection of the user. If all I know is imperative programming constructs because I've been writing C for 20 years and I start to learn Prolog but fail to understand what constraint logic programming is really about because I'm constantly trying to use imperative constructs in Prolog then I'm afflicted with the blub disease. Neither C nor Prolog is a blub language.
- the_af 12y agoThat doesn't suggest Swift is a Blub-like language to me. Though not explicitly stated in the Blub paradox, I'd say it implies that a fresh programmer, unfamiliar with both Blub and the more advanced language, would pick the more advanced language. The Blub paradox doesn't automatically apply to every language whose syntax you find bizarre. It also has to be a more advanced language, and the reason that you don't like the language's syntax and constructs must be because you don't understand the advanced features they enable. This is clearly not the case with Obj-C and the post you mentioned.
- lerno 12y agoNo? You've never ever heard Java/C++ programmers complain about ObjC's syntax? I find that... unlikely. http://bit.ly/1CqrYY4 http://bit.ly/1CqrYY4
- the_af 12y agoYes, I've heard it many times. How is that a counterexample? Bizarre syntax alone is not enough for the Blub paradox. I don't know anyone who seriously argues that Obj-C is a more advanced language than Java/C++, so Blub doesn't apply.
- yen223 12y agoMy favourite part was the whole "Optionals suck because Obj-C have nil, therefore Obj-C is superior" bit.
- the_af 12y agoExcept for the "therefore Obj-C is superior" part, I agree that Option types in languages such as Swift and Scala are unfortunately marred by those languages' need to be compatible with Obj-C and Java, respectively. I understand idiomatic Scala won't use null, just as I assume idiomatic Swift won't use nil, but nevertheless the fact that they allow nulls weakens their type systems.
- yen223 12y agoThat's one of the benefits of Rust imho - no legacy baggage. One of its downsides as well - no ecosystem to draw from. Oh well, take the good with the bad I guess.
- josephlord 12y agoCan you explain more about what you mean by Swift allowing nil weakening it's type system? Swift types don't allow nil but you can use a different type that is the optional counterpart. This is just the same as using the Maybe monad in Haskell and can be reimplemented in that way. Do you think that this also weakens Haskell's type system? Now if your issue was with the "!" Operator I would say that there is a case to be made but that should be used sparingly and carefully and is an obvious place for additional code review.
- the_af 12y agoHmm, maybe Swift's Optional works differently to Scala's Option, in which case my objection can be dismissed. In Scala, you can declare a value to be of type Option[T], which means it will be either a Some[T] or a None. This looks superficially like Haskell's Maybe monad. val x: Option[Int] = Some(1) The problem with Scala is that you can also write something like this: val x: Option[Int] = null By declaring a value to be of type Option[T], you "promise" it won't be null, but this is not enforced by the compiler. It's obvious this is a huge difference from Haskell's Maybe, and it weakens Scala. Null shouldn't even be part of Scala, but it's still there to retain compatibility with Java. Can a similar example be written with Swift? I assumed it was possible, but maybe I'm mistaken.
- prof_hobart 12y agoThat was exactly what I thought. His argument seemed to be "look, you could have added this feature to existing Objective C syntax rather than inventing a new language" - which is all true, but rather misses the point. At least one of the problems with Objective C is its syntax, and he states this himself - "Much of the Objective-C syntax is clunky, bolted on, and downright infuriating at times". Yet nothing I see in his suggestions solves that - unless he's suggesting ditching all existing syntax (which is pretty much what Swift is), then all he's doing is proposing yet another syntax structure to add to the already messy bastardisation of C and Smalltalk that makes Objective C the pain it is today.
- josephlord 12y agoI really like Swift, the strong static typing, imutability options, and even generics but there are some features of Obj-C that are lost. Objective C is a very flexible dynamic language with opportunities for runtime twizzling, object introspection. It is really like a lower level Ruby and if you use it a certain way is basically duck typed (you can send any message to any object). Swift is much more a static language and only really enables introspection and downcasting if you enable the Objective C compatibility for a class. This makes some things harder at least to do the same way as Objective-C (JSON parsing with NSJSONSerialization isn't pretty). As mentioned I prefer Swift but I do acknowledge that there are some losses that others may feel more keenly.