6 ms·
No it's not. After the major Obj-C hype on HN I decided to learn it and was very disappointed. 1. C compatibility is a liability, not a benefit. Every language
by notinfinland 14y ago
No it's not. After the major Obj-C hype on HN I decided to learn it and was very disappointed.
1. C compatibility is a liability, not a benefit. Every language that has build on C is full of corner-cases, warts and undefined behavior. Obj-C is the worst since it didn't fix anything about C, it just nailed objects on top of it.
2. The syntax is horrible. People rush to say that this is not important, but it's HUGELY important since it's the only way that you interface with the machine, the text that you read and modify for the entire lifetime of the software - which could be years or even decades.
Brad Cox failed to anticipate how object orientation would look like in future programming languages. Most languages either extended the C syntax for the object oriented part or got rid of the baggage. B.C brought us the e-mail symbol and writing + and - in front of all your member functions. e.g:
* You have to write @interface and @implementation and @end because apparently it was too much work to write a decent contextual parser.
* @"char" instead of automatic conversion
* @ as placeholder in string formatters. I see a pattern here...
* You must use () around return types. This is piss poor programming language design: thanks to the +'s and -'s you already know you're looking at a non-C function, but let's make the programmer dance around like a little monkey.
* Must use pointer syntax even though you're forced to use pointers to objects anyway. Java and C# got this right.
* No operator overloading. Where is your Smalltalk now?
* Namespaces?
* many other examples
Obj-C assumes that it can offload the boring tasks to the programmer because such was the fashion in the 70s and 80s.
3. Verbosity does not help at all. You have to spend more time reading code, understanding code, writing code. If it has more LOC, it's harder to maintain, this is a proven fact.
4. The type system is as weak as C's, but dynamic typing makes it even more fragile.
5. Memory management in iOS is too complicated. Even with ARC you still have to do manual memory management in some cases. The fact that I call retain and release is not much better than calling malloc and free. Heck, it's easy to do similar reference counting in C.
Several studies (please Google) have reported that iOS dev is more time consuming than Android and this matches the reports that I got from companies/people doing cross-platform dev. Obj-C is more complicated to program in than Java, in no small part due to memory management.
The final nail in the coffin is that this programming language is all but owned by Apple. The only reason to use it is if you're doing iOS development, but even there we're thankfully starting to see some alternatives such as Ruby and C#.
- batista 14y ago>Obj-C assumes that it can offload the boring tasks to the programmer because such was the fashion in the 70s and 80s. You seem to forget that it was created in the 80s. You also seem to forget that it was picked in part because of it's performance characteristics, including the ability to drop down to pure C, for stuff like OpenGL etc. In general, your complain is an repeat of "it's not high level enough as the languages I normally use".
- overcyn 14y ago> If it has more LOC, it's harder to maintain, this is a proven fact. Its a proven fact that given 2 programs, the one with more LOC will be harder to maintain?
- notinfinland 14y agoIt is not mathematically proven, but there are studies that indicate this (e.g Code Complete provides some) This assumes that the code bases are of similar quality.
- overcyn 14y ago> there are studies that indicate this So... not a proven fact at all. More like a vague correlation with assumptions tacked to the end.