7 ms·
A Eulogy for Objective-C (2015)
- teilo 7y ago2015
- fortran77 7y agoYes. But I think these things are relevant today. People are forgetting that the newest hot languages die, and maybe if we didn't forget it we'd have better languages, and more measured responses to them.
- teilo 7y agoHN convention for old articles is that you note the year in parens in the article title.
- deleted 7y ago[deleted]
- dang 7y agoDiscussed at the time: https://news.ycombinator.com/item?id=10003438 https://news.ycombinator.com/item?id=10003438
- itslennysfault 7y ago> I have to admit that I really love Objective-C This person has no taste. I don't need to read any more. (I'm kidding. To each their own, but I do hate Obj-C)
- epx 7y agoI really liked ObjC, it made all sense to me as an OO language, unlike C++, to the point I didn't see much innovation in Swift at all, I felt it basically removed the C and [funny syntax] (my opinion about Swift mellowed since then).
- cellularmitosis 7y agoYou should check this out: https://academy.realm.io/posts/andy-matuschak-controlling-complexity/ https://academy.realm.io/posts/andy-matuschak-controlling-co...
- WalterBright 7y agoBack in 1987, I was looking around for an advantage for my C compiler (Zortech C). I looked at ObjectiveC (by Stepstone) and C++ (by AT&T). Both had NNTP newsgroups for them, and both had about the same amount of traffic, and hotly debated each other. I had to choose, and knew little technically about either. But Stepstone wanted royalties for developing a clone of ObjectiveC. I contacted AT&T's lawyer (William Ryan) who said I didn't need a license to develop a clone of C++. I asked if I could call it "C++" and he said sure. He laughed, and thanked me, saying I was the only one who ever bothered to ask. So C++ it was, and Zortech C++ came out in 1988 (the first native C++ compiler for DOS, and arguably at all. g++ was out, but as a beta.) The action for programming at the time was on DOS, and C++ pretty much exploded with the availability of an inexpensive, fast, native compiler for DOS. The comp.lang.c++ traffic grew by leaps and bounds, and comp.lang.objectivec faded away.
- an_d_rew 7y agoNice. Reminds me of discussing music piracy with my musician friends, all of whom fervently wanted to be sufficiently popular to actually HAVE people pirate their stuff! (Not the piracy part, the "you really want people to listen to you, first" part...) :-)
- badsectoracula 7y agoAFAIK pre-nextstep Objective C was also a very simple layer over C that only had "id" as a type with things like protocols, etc being introduced later by next. (also i wonder if Stepstone had a leg to stand on regarding implementing a clone of Objective C... you couldn't call it Objective C as i guess they had a trademark over it, but what else would they license?)
- monkeycantype 7y agoYep, I love objective-c, sure with a few syntax frustrations: ([[]]). I don't do any apple work anymore, but I'd love to be able to use named parameters, and it's message passing in plain c. Every couple of years I waste an enjoyable few days on exploring github looking at hobby project to bring smalltalk features to c. So if anyone has any recommendations of oo in c projects i could checkout I would appreciate it.
- CoolGuySteve 7y agoSimilar to how the posix API works with struct arguments for extensibility reasons, in C++ you can pass structs by reference with named arguments and init them in place, like: void dothing(const dothingArgs& args); ... dothing({ .arg1 = 1, .arg2 = someOtherThing }); Register colouring should make it run the same as regular args for the most part in optimized builds. This has two benefits: 1) Changing the order of the struct args won't introduce ordering bugs like with function signatures. 2) Default arguments are more explicit and there's less chance of breakage as the argument list grows over time and gets more default values, as tends to happen. And 2 drawbacks: 1) Passing complex types as arguments without copying can be tricky. 2) The compiler errors don't tell you specifically which arguments are broken, at least in g++. This one sucks the most imo.
- saagarjha 7y agoIs this a C++ feature or an extension borrowed from C?
- CoolGuySteve 7y agoIt's part of C++20 but is an extension borrowed from C in most C++11 compilers. I've been able to do it in g++ for at least 7 years now. The combination of type inference, pass by reference, and aggregate initialization shown here is only possible in C++, I think. https://en.cppreference.com/w/cpp/language/aggregate_initialization https://en.cppreference.com/w/cpp/language/aggregate_initial...
- markhahn 7y agogood riddance, frankenstein's monster of programming languages.
- ryandrake 7y agoIs it really dead? In other words are there examples of applications you can build with Swift that you simply can’t in Objective C? I haven’t built iOS apps since before Swift existed so I’m genuinely curious. If I got back into it I’d obviously prefer Objective C out of familiarity but not if Apple crippled it.
- protomyth 7y agoWell, with Swift UI the exclusive to Swift writing is on the wall. I dislike Swift and love Objectivite-C, but I expect Swift is it going forward.
- Klonoar 7y agoApple has slowly started bringing out frameworks that are Swift only, and in addition the SwiftUI runtime is... well, Swift only. All the old ObjC stuff still works, though, there's nothing stopping you using it. I released an app recently that was 50/50 ObjC/Swift (for a few weird reasons) recently and it's really painless in comparison to some other modern stacks.
- cable2600 7y agoSo Objective C became the Visual BASIC and Swift became the .Net Framework for Apple?
- favorited 7y agoThe conclusion at the end of the talk is that, no, it's not dead.
- apple4ever 7y agoEspecially given its 4 years later and still going strong. While Apple has released a Swift only framework, its very much in alpha state. Objective-C will live on strongly for another 5 years, and even in its twilight after that will continue going on. I'll be writing in it until I die haha. [apple4ever setGraveStone: @"here lies apple4ever" setBirthYear: 1950 setDeathYear: 2050];
- matchbok 7y agoCan't come soon enough. The syntax is a head scratcher. I don't understand why anyone could have possibly thought [[[[]]]] was a good idea! Don't get me started on the closure or variable syntax. Oof.
- favorited 7y agoThe syntax is all about C compatibility. Objective-C (unlike C++) is a strict superset of C. Anything using bracket notation in Objective-C is using dynamic OO message-passing. Anything that reads like C syntax is plain-old C. The closure syntax also relates to C compatibility. Because the Clang blocks extension isn't an extension to Objective-C, but to C. The syntax matches C's function pointer syntax, just replacing the * with ^. ^ was chosen because (A) it has no unary form in C, and (B) it can't be overloaded in C++.
- apple4ever 7y agoI love the brackets. Sure its kind of crazy, but I love how it works.
- jaynetics 7y agoThe brackets do have the advantage that they make the order of evaluation and individual callees totally explicit, unlike some languages with optional parentheses or a mix of dots and other syntax elements. As someone with the unusual distinction of learning to code with ObjC, I found the syntax super helpful as a newbie. Everything looked distinct (e.g. in other languages blocks might only differ from hashmaps by their context), everything was verbose as if explained to a child (Thing *thing = [Thing thingByConvertingOtherThing: otherThing];) and so on.