"Things like factories, adapters, and other design patterns are all thankfully not there." Not sure I understand this? How does Obj-c enable the developer to avoid factories?
In defence of Objective-C
81–90 of 122 posts
Re: In defence of Objective-C
#82Earlier quoted context omitted.
Yeah, I found that line hideous - ridiculously unintuitive and hard to read compared to the equivalent in say, ruby. Maybe the whole essay would have been better framed something like: "Objective C: not quite as bad as Java!"
Just curious, for comparison: what would the equivalent be in Ruby?
At least that's one way to do it in ruby.
Re: In defence of Objective-C
#83As someone who likes Objective-C a lot, I have to say this is a pretty bad defense of it. No offense, clearly we are both fans of the language, I just don't think this will convince anyone on the other side. In fact, I find very little defense of it at all in this post. It seems his fundamental argument is "its a matter of taste", which while true, in no way conveys the many "whys" of the choices made in this languag…
They could have added garbage collection if they wanted to add as much ram to the iphone as the Android phones have but I guess they already made their choice long before one could develop code for the iphone.
And GC is always less efficient than no GC, even with more memory.
Re: In defence of Objective-C
#84I'm (some what) proficient in many programming languages. Some more than others. I've worked in languages like Python, Eiffel, C#, C++, Prolog, Java, OCaml, F#, Ruby and as of recently, after a long hiatus, Haskell. I have such a strong dislike for Objective-C, I can't explain it. I mean C++ is insane in a way, and Haskell is a pure Mindbender. But Objective-C's syntax, to me, is indeed so verbose, I'd rather read th…
Grow some taste?
Re: In defence of Objective-C
#85For example, to filter an array is lovely: filteredArray = [allRecords filteredArrayUsingPredicate: [NSPredicate predicateWithFormat:@"someField == %d", someFieldFilterValue]]; A four-word name for filter and filtering for equality by using a string formatting DSL are not really on my list of lovely things. I'm sure Objective-C does something well but this guy is not pointing it out.
filteredArray = allRecords.Find(i => i.someField == filterValue)
EDIT: Not sure why the downvote, I'm simply stating that many other languages have far better syntax for filtering an array so I'm not sure why the author would think the syntax in Obj-c is all that great unless they have never done the same thing in any other language.
Re: In defence of Objective-C
#86-quote- Go and look at some Lisp, then come back – obj-c will suddenly look better :) Trust me, it grows on you. You’ll soon learn to see through the brackets – just like the green vertical text in the matrix, it becomes invisible after a while. -end quote- Its ironic that a Lisp/Scheme person would say the same as to why s-expressions are good (the parens become invisible!) so I don't see why objective-c syntax is b…
"You’ll soon learn to see through the brackets" @I @hope @that @also @applies @to @the @the @at-@signs. ;-)
Re: In defence of Objective-C
#87I love Obj-C message send syntax and I miss it dearly when using any other language. I love that a method implicitly documents itself at the call site, and that the delimiters occur between calls rather than in the middle of them. And it works great with code completion. You just type '[' and the editor immediately knows what you are doing. Choose a method and the parameters are right in front of you. No documentatio…
> And it works great with code completion. You just type '[' and the editor immediately knows what you are doing. Whereas in other languages you'd have to write... "."? > Choose a method and the parameters are right in front of you. No documentation required, unless you actually need in-depth information. Pretty much every somewhat advanced IDE does that, especially for mostly-statically-analyzable languages.
You write "." AFTER you've written the method name. In ObjC "[" immediately tells that you want a method/class name for autocompletion.
Re: In defence of Objective-C
#88Earlier quoted context omitted.
Yeah, I found that line hideous - ridiculously unintuitive and hard to read compared to the equivalent in say, ruby. Maybe the whole essay would have been better framed something like: "Objective C: not quite as bad as Java!"
Just curious, for comparison: what would the equivalent be in Ruby?
filteredArray = [allRecords filteredArrayUsingPredicate:
[NSPredicate predicateWithFormat:@"someField == %d", someFieldFilterValue]];
in ruby: all_records.select {|r| r.some_field == some_field_filter_value}
in clojure: (filter #(= % some-filter-value) all-records)
in haskell: filter (\someField -> x == someFilterValue) allRecordsRe: In defence of Objective-C
#89As someone who likes Objective-C a lot, I have to say this is a pretty bad defense of it. No offense, clearly we are both fans of the language, I just don't think this will convince anyone on the other side. In fact, I find very little defense of it at all in this post. It seems his fundamental argument is "its a matter of taste", which while true, in no way conveys the many "whys" of the choices made in this languag…
They could have added garbage collection if they wanted to add as much ram to the iphone as the Android phones have but I guess they already made their choice long before one could develop code for the iphone.
Re: In defence of Objective-C
#90I don't think these are the real problems with Objective-C. To quickly address this issues, before discussing the real problems: "Ugly" - get over it, "Verbose" - get over it, "Memory Management" - Obj-C memory management is in fact super simple as long as you follow some really simple rules, especially with ARC. Now the real problems I have: 1. Lots of unnecessary code. With the old runtime, you had to modify your c…
Once it matures I expect the Xcode debugging experience will become quite a bit different from the current (flimsy) gdb shell-out.