One of the limitations of Objective-C, the inability to create a function with a variable length argument list ... Erm, not true. For example, NSString's + (id)stringWithFormat:(NSString *)format, ...
How do you create such a function though? stringWithFormat is built in.
Stop the Hate: Obj-C Deserves Your Love
41–50 of 91 posts
Re: Stop the Hate: Obj-C Deserves Your Love
#42As someone who has been, on and off, writing Objective-C for the past decade, I will unequivocally state that as application programming languages go, it's a terrible 1980s jalopy of bad language decisions cobbled on top of more bad language design under which Smalltalk-descendent ideas peek through now and then. Language research has progressed. Microsoft has invested heavily in C# and related technologies. Even Sma…
As someone who does a ton of Objective-C, I challenge the notion that namespaces are even remotely necessary. I've also done development in nearly everything under the sun, in nearly every "popular" language under the sun, which challenges your other assumption that anyone who thinks Objective-C is good hasn't spent time outside of C/C++/Objective-C. I'm guessing you've never written a Windows app with C++ and MFC. O…
Re: Stop the Hate: Obj-C Deserves Your Love
#43The discussion for another article on the front page discusses why, even today, many developers prefer C-family languages over Java for developing user interfaces, because of unpredictable delays in responsiveness with garbage controlled languages. In that context, Objective C is the closest you will find to a best of both worlds language for responsive user interfaces. Being a strict superset of C, you can control t…
Re: Stop the Hate: Obj-C Deserves Your Love
#44As someone who has been, on and off, writing Objective-C for the past decade, I will unequivocally state that as application programming languages go, it's a terrible 1980s jalopy of bad language decisions cobbled on top of more bad language design under which Smalltalk-descendent ideas peek through now and then. Language research has progressed. Microsoft has invested heavily in C# and related technologies. Even Sma…
if (self = [super init]) {
/* do the init */
}
return self;
Huge advantage of this is that you can implement object pools, singletons, etc. transparently.Re: Stop the Hate: Obj-C Deserves Your Love
#45He is at the first stage of Cocoa development. Learning a new language is fun, and you can create some really cool stuff with the Cocoa frameworks. But once that wears off you are left with Objective-C, a vestigial language that isn't suited for a majority of application development. Here are some reasons I think Objective-C needs to be retired: - Header Files: These are archaic and require you to repeat code unneces…
Seriously, how would you get a list of all functions in a module without an IDE? Besides, I put all my documentation into h-files as well, so other devs can pretty much see what I am doing without ever glancing at c-files.
With Ruby or Java you need some advanced folding support in your editor or a full-fledged IDE.
Re: Stop the Hate: Obj-C Deserves Your Love
#46He is at the first stage of Cocoa development. Learning a new language is fun, and you can create some really cool stuff with the Cocoa frameworks. But once that wears off you are left with Objective-C, a vestigial language that isn't suited for a majority of application development. Here are some reasons I think Objective-C needs to be retired: - Header Files: These are archaic and require you to repeat code unneces…
But good enough to write major parts of an operating system in by a company full of people easily smarter than you? Say what?
> Header Files
It's C for chrissakes.
> No GC on the iPhone
Because it's a performance penalty. Clock cycles on a phone are vastly more important than on a desktop/laptop. I can guarantee you this will change in a few years.
> No NSDictionary/NSArray literals
It's not a scripting language. Show me array literals in C or C++ that map to an underlying collection class that gives you fast enumeration and then we talk.
> Xcode
Personal preference.
> Closures
They're called Blocks.
> No dymanic variables
It's called 'id'.
id whatever = [[YourObject alloc] init];
But even better: id whatever = [[NSClassFromString(@"YourClass") alloc] init];
Or how about setting properties on objects dynamically? [yourinstance setValue:@"Hello" forKey:@"property"];
Or dynamically dispatching methods?Ever messed with vtables in C++?
> Unit Testing
Agree, but that's changing.
> No namespacing
You bitch about all the typing, but you want to type out namespaces instead of using a prefix on your classnames. Ok ...
Your confusing ObjC with Ruby, Python, et al. But it is not any of those. Like I mentioned elsewhere, it's a high level layer on a low level language. Adjust your expectations accordingly.
Re: Stop the Hate: Obj-C Deserves Your Love
#47As someone who has been, on and off, writing Objective-C for the past decade, I will unequivocally state that as application programming languages go, it's a terrible 1980s jalopy of bad language decisions cobbled on top of more bad language design under which Smalltalk-descendent ideas peek through now and then. Language research has progressed. Microsoft has invested heavily in C# and related technologies. Even Sma…
Re: Stop the Hate: Obj-C Deserves Your Love
#48Earlier quoted context omitted.
As someone who does a ton of Objective-C, I challenge the notion that namespaces are even remotely necessary. I've also done development in nearly everything under the sun, in nearly every "popular" language under the sun, which challenges your other assumption that anyone who thinks Objective-C is good hasn't spent time outside of C/C++/Objective-C. I'm guessing you've never written a Windows app with C++ and MFC. O…
Obj-C does not have a similar performance profile to C/C++. Method dispatch is far slower than vtables. I've personally witnessed a huge Obj-C dev project fall apart when the team couldn't get performance up to snuff, even with dedicated help from Apple's UI team. The rewrite in C++ is progressing nicely.
I have no doubt that method dispatch is significantly slower than vtables, but you're ignoring the fact that for performant code, plenty of C++ devs believe that vtables are far too slow as well. Large high-performance C-style projects are always struggling with the tension between the indirection that architects want to keep the system clean and the hardwired directness that the profiler says the system needs to be fast. ObjC didn't introduce this dilemma; function pointers did. It's so well known in C++ code that the MIT Click Modular Router even got distributed with a tool that automated de-virtualizing method calls.
In both C++ and ObjC, when dispatch gets scary, you write C code. The difference is that C++ pummels you about the head and shoulders for even considering writing straight C with naked pointers, while ObjC could care less.
I would rather avoid ObjC. I would rather build a large system out of any high-level language, from Scala to Ruby to Python to Lisp, and use an FFI to drop into C code. But I'd spend the rest of my career in ObjC without so much as a Bourne shell script to fall back on than I would willingly start another project in C++.
Re: Stop the Hate: Obj-C Deserves Your Love
#49As someone who has been, on and off, writing Objective-C for the past decade, I will unequivocally state that as application programming languages go, it's a terrible 1980s jalopy of bad language decisions cobbled on top of more bad language design under which Smalltalk-descendent ideas peek through now and then. Language research has progressed. Microsoft has invested heavily in C# and related technologies. Even Sma…
As someone who does a ton of Objective-C, I challenge the notion that namespaces are even remotely necessary. I've also done development in nearly everything under the sun, in nearly every "popular" language under the sun, which challenges your other assumption that anyone who thinks Objective-C is good hasn't spent time outside of C/C++/Objective-C. I'm guessing you've never written a Windows app with C++ and MFC. O…
Apple is now suggesting that you use three-character class name prefixes, since they claim all the two character ones. I had my two character prefix claimed by a new private framework Apple added to iOS, and now one of my class names conflict with one of theirs. Kaboom.
If you go the no-prefix route, your code isn't library-reusable since other people will do the same thing, and you will still get screwed -- Apple regularly claims non-prefixed classes in their code, too.
My assumption is that you simply don't grok it, that you haven't learned how to utilize dynamic dispatch, KVO, etc. to greatly simplify and streamline your application designs. Or you are one of those script kids that takes all the low level shit for granted. This isn't python. This isn't ruby. This isn't even smalltalk.
Seeing as you're writing ObjC using a compiler I've worked on, I think that probably understand the "low level shit" better than you do.
Re: Stop the Hate: Obj-C Deserves Your Love
#50Didn't see a single explanation of why the language deserves my love. Let's see. * The language is verbose. * Practically speaking, it's only used to developer for two platforms (OSX and iOS). * The frameworks for those platforms are MEGA verbose. * The memory management model for the iOS platform is not GC, and it's not manual management. Frankly I found manual management of memory simpler than retain/release. And t…
NSString has plenty of methods to deal with this, and you get boxing for free between CFString and NSString.
> The frameworks for those platforms are MEGA verbose.
Which some view as self documenting.