4 ms·
> I'd rather eat a burrito than a salad. This is not a very good technical critique of the nutritional benefits of salad vs. burritos. I put about as much effo
by king_magic 14y ago
> I'd rather eat a burrito than a salad. This is not a very good technical critique of the nutritional benefits of salad vs. burritos.
I put about as much effort into my critique as the original article's author did in arguing for C#'s superiority.
> I like Objective-C, but objectively speaking, Objective-C is horrible for type-safety. The id type is used in a lot of places (e.g. every collection class), and you can magically convert anything to anything else without a peep from the compiler through the id type. There is no easy way to say "This is an array of Foo" and have that checked.
This is a problem that has bit me in the ass maybe once or twice since I started developing in Obj-C several years ago. You could magically cast things to whatever you wanted in C++, and that was never a serious problem for me back when I was developing in C++ either. As an avid JavaScript developer as well, I've had no problem with a lack of type safety. It's just not the huge demon (for me) that it's made out to be - at least in my experience.
> They might have some platform-specific code, but having a common, portable base is hardly a pipe dream.
70% code reuse across iOS and Android (see http://news.ycombinator.com/item?id=4998661 http://news.ycombinator.com/item?id=4998661) is hardly what I'd call "portable". Does the Bash shell do better than 70% code reuse across Linux / BSD / etc? I certainly hope it does.
- chc 14y ago> I put about as much effort into my critique as the original article's author did in arguing for C#'s superiority. Not really. He stated an actual fact: Proper garbage collection allows for simpler memory management than retain counting. I agree that he didn't do enough to illustrate this, but he did go further than just "I like this thing." It is indeed true that there are a number of awkward situations where you can end up with immortalized objects with retain counting that would not have been so under garbage collection (see for example the "__block id uglyHack = self" idiom in Objective-C). > 70% code reuse across iOS and Android (see http://news.ycombinator.com/item?id=4998661 http://news.ycombinator.com/item?id=4998661) is hardly what I'd call "portable". Does the Bash shell do better than 70% code reuse across Linux / BSD / etc? I certainly hope it does. I would rather rewrite 30% of my code than 100%. If you want to say it's imperfect and could be better, that's fine, but dismissing it entirely seems unreasonable to me.
- king_magic 14y agoRE: GC vs reference counting, I've found that writing code using ARC feels a lot like writing code using GC - 95% of the time, I never notice it. Still, I'd prefer to not have the overhead of GC. > I would rather rewrite 30% of my code than 100%. I agree with you on this. I'm not dismissing it - in my original post, I said the focus of the original article should have been the potential for reuse across platforms - but it was glossed over in a disappointing 3 sentences.
- CodeCube 14y agoChris Sells added reference counting to the open source "Rotor" release years ago. This was to test whether GC overhead was indeed an overhead over deterministic finalization. http://www.sellsbrothers.com/writing/refcount_rotor.doc http://www.sellsbrothers.com/writing/refcount_rotor.doc I'll let you come to your own conclusions about the results :)
- pretoriusB 14y agoI'm all for Objective-C, but your arguments were weak in the first place, and you're dragging a dead horse here. I mean: "I put about as much effort into my critique as the original article's author did in arguing for C#'s superiority." -- Why even write your critique then? At least the original article's author had a reason, it is marketing copy. >This is a problem that has bit me in the ass maybe once or twice since I started developing in Obj-C several years ago The general consensus is hardly that type safety in large applications is something to not be concerned with that only bites you "once or twice" when you are a novice. So I don't see the reason for the anecdotal reference. >70% code reuse across iOS and Android (see http://news.ycombinator.com/item?id=4998661 http://news.ycombinator.com/item?id=4998661) is hardly what I'd call "portable" This is horribly mistaken in more than two ways. 1) Nat says: "Both of these apps are using 100% _native widgets_ for their user interface, and I think it's fair to say that both of them are fairly UI-heavy.". Which means it's a worst case scenario. For a less UI-heavy app, or one with a custom canvas based GUI etc, the percentage would be far higher. 2) 70% is far better than rewriting everything (or 0% re-use) if you use Objective-C. You could use C++ or C to write a common base, but then you're not using a single language anymore, whereas with C# you are. 3) 70% in itself is nothing to sneer at when discussing portability. Especially considering your own argument that "write once, deploy everywhere" is a pipe dream, then 70% is quite high level of reuse -- basically meaning you merely re-do the UI parts to tune it to each platform.
- king_magic 14y agoI direct you to my final statement in my original post (http://news.ycombinator.com/item?id=4998697 http://news.ycombinator.com/item?id=4998697): > Edit: just for the record, I'm not necessarily trying to refute all or some of the OP's points. I think the original article was poorly written, and the case for C# was poorly made. Hence my "let's play this game" comment. RE: "This is horribly mistaken in more than two ways." Not all code is created equal. That 30% that needs to be rewritten for each device could be difficult to tune for each platform. Native widgets in iOS do not work the same as native widgets in Andoid. Unless there is some magical abstraction layer (which doesn't appear to exist), you're potentially rewriting the most difficult code for each platform. But again, please see my original post. In my original post, I said the focus of the original article should have been the potential for reuse across platforms - but it was glossed over in a disappointing 3 sentences.