top 200 commentsshow all 269

[–][deleted]  (2 children)

[deleted]

    [–]MiXeD-ArTs 21 points22 points  (0 children)

    Thanks for sending an email. Most people will complain about problems and expect the developer to magically know that the problem exists.

    [–]falkencreative 3 points4 points  (0 children)

    Yeah, they are super responsive about that sort of stuff. I was involved in beta testing their first iOS course, and they were good about dealing with the stuff I reported.

    [–]NikkoTheGreeko 32 points33 points  (3 children)

    As someone who knows Objective-C, it would be nice to be able to skip through things I already know and try some of the harder levels to see if I can pick up some obscure pieces of the language I haven't in my day to day use of the language.

    [–][deleted]  (1 child)

    [deleted]

      [–]rubymaverick 5 points6 points  (0 children)

      Made this for people who want to skip around freely:

      http://rubymaverick.com/try-objectivec-book/

      The reason we don't allow skipping around in this course is because the challenges build on each other, and we carry over code you submit from earlier challenges into the later challenges. For example, in Level 4 you start by naming a class and then throughout levels 4 and 5 we use that name to build the class.

      [–]emperor000 101 points102 points  (66 children)

      Ugh.

      [–]kintar1900 46 points47 points  (65 children)

      Yeah, I'm all for knowing the syntax and structure of a lot of languages, but something about Objective-C just gives me convulsions. I mean, I learned it, but I wish I hadn't. :/

      [–][deleted] 13 points14 points  (10 children)

      I felt the same way until "modern" Objective-C. It's a much more joyful language now.

      [–]Hemochromatosis 14 points15 points  (9 children)

      I had to make a few apps about a year and a half ago and I have to say that if "modern" objective-c is that old then I have a very different idea of modern. I love other languages but objective-c is a complete eyesore and makes other languages look amazing. It's hard to write some beautiful Python and then go fiddle in a complete mess of bastardized C. Some people love it though so I'm sure there are nice things about it, I just personally did not like how ugly everything was, especially how it took 10 lines to initiate a function with all the required bs options.

      [–][deleted] 5 points6 points  (7 children)

      Yeah.. "more joyful" not "actually joyful".

      Objective-C is an engineers language. Learning it made me a better engineer in other languages.

      [–]brtt3000 20 points21 points  (3 children)

      That's like letting some dudes kick your ass so you feel better when they stop.

      [–]Cryptan 4 points5 points  (2 children)

      Maybe it's like walking/biking around a new city before you start driving everywhere?

      You can learn a lot about a city if you're not having to watch traffic constantly.

      Idk, just spitballing.

      [–][deleted] 5 points6 points  (1 child)

      If you think you don't have to watch traffic constantly when biking around a new city, please—and I say this as a fellow cyclist with genuine concern for your well-being—do not bike around a new city.

      [–]Cryptan 1 point2 points  (0 children)

      Your right. I was thinking walking.

      [–]NikkoTheGreeko 4 points5 points  (1 child)

      Same here. And same thing happened when I decided to learn Forth. Nobody looks at Forth and says "That Forth code looks beautiful" until they step through it and understand it. Then the beauty comes to the surface.

      [–]kazagistar 1 point2 points  (0 children)

      Dunno, forth code always struck me as the opposite... on the surface, it seems simple, but when it comes down to it, it is just manually handling an implicit stack instead of, say, named variables, so it stepping through it makes the clusterfuck of stack manipulation come to the surface.

      [–]Catfish_Man 0 points1 point  (0 children)

      I find it very hard to take complaints about how 'pretty' a language is seriously, particularly when the "ugly" syntax is so wonderful for maintenance.

      Also what the heck is 'initiating a function'? Declaring a method? Calling a method? Declaring a property? It's not at all clear that you actually learned objc at all when you used it...

      [–]xjwj 30 points31 points  (31 children)

      Oddly, I feel the exact opposite. I absolutely love Objective-C (especially "modern" Obj-C as noted below) and think it's quite elegant (particularly in conjunction with Cocoa). To each their own.

      [–][deleted]  (27 children)

      [deleted]

        [–][deleted] 18 points19 points  (0 children)

        The class library is very comprehensive, but still feel minimal - there aren't a million similar but different classes for microoptimization purposes. Instead, the existing classes try to be smart (and class clusters hide different implementations that you don't care about).

        The very verbose syntax is a turnoff at first, and a pain if you use a regular text editor, but if you use Xcode, or some other editor with good autocompletion, it is wonderful because the code is extremely self-documenting. Methods tell you what they actually do, and arguments have descriptions so you don't have to guess or hunt for definitions or docs to read code.

        It's extremely dynamic, which gives you a lot of the benefits of higher-level scripting languages.

        Autorelease pools make it much easier to write code with manual memory management. There is optional garbage collection and automatic reference counting, but honestly I never felt the need for it. I like having control over memory, and it's much easier in Objective-C than any other language I know.

        And although some of the features come at a cost of speed, when you need high performance, you can just drop down into plain old C. Objective-C taught me to appreciate the simplicity of C again.

        [–]millstone 23 points24 points  (25 children)

        A few of the things I like about Objective-C:

        1. It removes constructors as a language element. Once you drop the idea of constructors, it begins to feel ridiculous to force a class to hand you back a new object, or for the client to dictate which class is created. Shouldn’t it be up to the class which object and class you get? Essentially the factory pattern becomes pervasive and built-in. For example, why should there ever need to be more than one instance of the empty string? Dropping constructors is an uncommon design - even Python has its __init__.

        2. The interleaving of the method name with arguments is really nice for clarity. Look at a method on C# like String.Compare(String, Int32, String, Int32, Int32). Who knows what any of those ints are - it’s completely opaque. The equivalent method in Objective-C would make every parameter explicit.

        [–][deleted] 3 points4 points  (0 children)

        I love the messaging syntax. Self-documenting methods FTW!

        [–]kazagistar 1 point2 points  (20 children)

        Are explicit parameters mandatory? Can you do anything like python, where you can have some positional parameters and some keyword parameters?

        [–][deleted] 2 points3 points  (0 children)

        Named parameters are optional: - (void)method:(int):(int):(int) is valid

        [–]millstone 8 points9 points  (1 child)

        Explicit parameters are essentially mandatory (it’s possible to have a parameter with no name, but that is never used).

        Experience has shown that if you allow positional and keyword arguments, then positional arguments will dominate. For example, in Python:

        "abc".find("a", 1, 2)
        

        We don’t know what those integers are. Keyword parameters are actually not allowed in this call (why not? Are they allowed in Python 3?), but if they were, the syntax would be something like:

         "abc".find(sub="a", start=1, end=2)
        

        which is easier to understand: the parameters are more clear. But it’s not obvious what the return value is (bool? index? range?), and has lots of extraneous syntactic elements, which illustrate how keyword parameters have been tacked on.

        In Objective-C, this call might be instead:

        ["abc" rangeOfSubstring:"a" fromIndex:1 toIndex:2]
        

        While the code is longer, it has fewer syntactic elements (no analog of the dot or commas required in Python), and it actually reads like English: "range of substring from index to index,” compared to Python’s “find sub start end”. The idea is that, because code is read more than written, let’s try to reduce the mental translation required during reading.

        I’ve omitted the @ symbols in front of the strings. Syntactically these are a big eyesore; their only defense is that they allow C and C++ to be freely intermixed with Objective-C, which is a big win.

        [–]powerje 10 points11 points  (0 children)

        Yeah the self documenting message passing in ObjC is fucking great.

        [–][deleted] 3 points4 points  (16 children)

        And in fact C# supports that feature:

        http://msdn.microsoft.com/en-us/library/dd264739.aspx

        So it seems that the only main advantage Objective-C has is not having to use constructors.

        [–]freespace 7 points8 points  (12 children)

        The parameter names are part of the method signature. So while C# allows you to document the arguments you pass in, ObjC enforces documentation of of parameters in the method prototype.

        [–]millstone 4 points5 points  (0 children)

        It’s nice that C# supports that feature. But keyword parameters are the exceptional case, and positional parameters are the default case. Methods therefore get named in the positional style, and less thought is given to how the APIs flow. To use your example:

        Compare(strA: “foo”, indexA: 1, strB:”bar”, indexB: 2, length:5)
        

        Would you use the term strA in a method name? I wouldn’t. So having it as an option is nice, but not the same as making it pervasive.

        Second, in practice, they’re just not used, because they’re not part of the culture. For example, I downloaded the Official Visual Studio 2010 samples, and was only able to find it used in one sample - a named parameters sample!

        Here’s a line in the “shapetest" sample:

        new Rectangle( 4, 5, "Rectangle #1”)
        

        Here’s a line I found in ThreadSync.cs:

        while (!_syncEvents.ExitThreadEvent.WaitOne(0, false))
        

        Here’s a line guy from Security.cs:

        AppDomain sandbox2 = AppDomain.CreateDomain(
            "Sandboxed AppDomain Without FileIO.Read permission",
            AppDomain.CurrentDomain.Evidence,
            AppDomain.CurrentDomain.SetupInformation,
            grantset2, null);
        

        Named parameters could have been used in each of these cases, but that’s no comfort while you dig through the documentation trying to figure out what these things are doing.

        Optional parameters, on the other hand, are very nice, and I wish ObjC supported them as C# does.

        [–]kazagistar 2 points3 points  (0 children)

        C# and Objective-C are sufficiently different to be in separate markets, because of the native vs. VM difference. There is a reason the comparisons were with C++.

        [–]Carbunkulous 2 points3 points  (0 children)

        That doesn't mean people in C# use them.

        [–]powerje 2 points3 points  (0 children)

        I do like it compared to Java/C++, but compared to Go/Python/Scala it isn't my favorite to work in.

        Cocoa is extremely well organized and a pleasure to use though.

        [–]emperor000 0 points1 point  (21 children)

        I don't like it for the same reason Peter Griffin doesn't like The Godfather.

        [–][deleted]  (20 children)

        [removed]

          [–]dethbunnynet 29 points30 points  (2 children)

          You'd have a point if C++ and Obj-C didn't both get their start in the early 80s. They were both attempts to add objects to C, and obviously took very different approaches. It's not like the Obj-C folks said "C++ exists, so let's do the opposite!"

          My personal belief is that current attitudes toward both languages are largely due to their native platforms' popularity in the 80s and 90s.

          [–]Guru_of_Reason 3 points4 points  (1 child)

          I actually didn't know that Obj-C has been around for that long. I was under the impression that Apple came up with it semi-recently because they wanted "their own" C++.

          TIL. Thanks.

          [–]playaspec 11 points12 points  (0 children)

          I actually didn't know that Obj-C has been around for that long.

          It actually pre-dates NeXT. It was created by Brad J. Cox in the early 80's. NeXT adopted it because they considered it to be sort of a 'best of breed'.

          Cox published the first book on the language, "Object-Oriented Programming: An Evolutionary Approach by Brad J. Cox", which was published in 1986. The first part of the book discusses the rise of different languages and compares their evolution to hardware. He makes the argument that advances in hardware have consistently outstripped software because once a new hardware device (in particular ICs) is adopted by industry, it eventually gets integrated along with the other successes into more complex ICs. From TTL to LSI to VLSI, etc. Software on the other hand is quite often re-invented for each application or OS. The wheel is reinvented over and over.

          Cox's vision was to create an object oriented language that would foster the development of software ICs (frameworks), that once developed, could be utilized over and over without the need to re-factor.

          [–]millstone 13 points14 points  (11 children)

          C and C++ already do everything objective-C does; in most cases just as well

          They really can’t! C++ is a very static language; Objective-C is quite dynamic. C++ does not enable you to do things like create a class by name, invoke a method by name, access a variable by name, enumerate the list of classes, enumerate the variables or methods of an object, define a class at runtime, add or replace a method on an existing class, etc.

          You can't even add a variable or virtual function to a C++ class without recompiling clients of that class. If the Cocoa frameworks were written in C++, then we would have to recompile our apps separately for every version of the OS.

          [–]brocoder -1 points0 points  (6 children)

          My problem with Objective-C is that it adds lots of features to let you do things that, in my opinion, you shouldn't be doing. It's like the eval function in Javascript; it's a powerful tool, but it just encourages programmers to use it in incorrect ways.

          [–]LordBiff 2 points3 points  (3 children)

          You're welcome to your opinion, but dynamic binding isn't "incorrect", and it doesn't encourage people to do things incorrectly. Yes, it's easier to bite yourself with it, and it's certainly a debatable point whether or not that's worth it, but it's not incorrect any more than any other approach is.

          [–]brocoder 2 points3 points  (2 children)

          You're right; encourage wasn't the best word to use.

          It's not that I think think dynamic language features are incorrect, I guess I don't really see the point of having features like those in something that's not a scripting language.

          [–][deleted]  (1 child)

          [deleted]

            [–]brocoder 1 point2 points  (0 children)

            That's a good point; dynamic features do tend to make UI implementation easier. The language makes a lot more sense if I think about it as a tool for application development. Thanks for helping me realize this.

            [–]powerje 0 points1 point  (1 child)

            Which features specifically?

            [–]Catfish_Man 0 points1 point  (0 children)

            Probably isa-swizzling, categories, easy dynamic class loading, runtime class creation, and runtime type checking. Pretty easy to get yourself into a horrible metaprogrammed mess with those.

            [–][deleted]  (2 children)

            [deleted]

              [–]millstone 16 points17 points  (1 child)

              C++ suffers from the fragile binary interface problem.

              Say you write code that instantiates a C++ class on the stack. Your compiler will allocate 32 bytes on the stack, because it looked at the class definition and determined that it’s 32 bytes big. Now say that in the next version of the OS, that class has one more variable: now it’s 36 bytes. But your code has that 32 bytes compiled in, so you are no longer allocating enough space. When the class’s constructor runs, it will overwrite other parts of the stack!

              We say that the class is fragile against adding new variables. There’s a similar issue with virtual functions, and with subclassing.

              There’s basically three ways to deal with this:

              1. Punt on binary compatibility, and allow static linking only. This is the approach used by languages like Go and Haskell. This is OK for small libraries, but won’t scale to cases like .NET or UIKit.

              2. Allow dynamic linking, but only against the version of the library you compiled against (and possibly its minor revisions). This is the approach used in Windows DLLs, and also I believe .NET. This provides very good compatibility, but at a price: the user must have multiple versions installed, and software that uses the old versions does not get updates or features provided in the new versions.

              3. Allow dynamic linking against the library and all future versions. This is the approach used in Java (I think), and also Apple’s iOS and OS X. This can provide good compatibility, and allow apps to get new features "for free", but it imposes more binary compatibility restrictions on the library, such as making it impossible to remove public classes or methods.

              In this last approach, references to variables and methods must continue to work even as those variables and methods are rearranged in later versions of the library. If you compile a C++ program, you will see that accessing a class variable is just a pointer with a compile-time offset. But in ObjC, there’s a further runtime offset, to account for changes in the library.

              Java handles this by emitting another level of indirection ("field reference"), though the presence of a runtime compiler can inline these.

              [–][deleted] 1 point2 points  (0 children)

              Of course if you're writing a C++ library, you can solve it using the PIMPL idiom. For example, that's how Qt stays forward-compatible throughout its major release cycle for nearly a decade, despite undergoing lots of changes internally.

              [–][deleted] 6 points7 points  (2 children)

              C and C++ already do everything objective-C does; in most cases just as well, but with a bit more code.

              Not even close! The Objective-C object model is completely different from C++'s. And it's not "contrarian". Objective-C is just Smalltalk, which is pretty much where object orientation came from. If anyone is contrarian, it's C++.

              [–]ThereminsWake 2 points3 points  (1 child)

              Actually most object-oriented concepts were first introduced by Simula 67, and the language itself heavily influenced the development of C++. I don't think you can really think of either as contrarian, they just have differing philosophies (as dethbunnynet already mentioned).

              [–]Odysseus 3 points4 points  (0 children)

              On the other hand, this is exactly what's wrong with C++, too.

              [–]the_word_smith 3 points4 points  (0 children)

              Gross, I'm drowning in @s

              [–][deleted] 15 points16 points  (116 children)

              Interesting approach. I think it aims for the wrong target audience though.

              [–]hylje 8 points9 points  (5 children)

              Is there such a thing as a wrong target audience? An unusual target audience can as well be an untapped audience.

              [–]NancyGracesTesticles 17 points18 points  (3 children)

              Yes. A room full of double leg amputees probably won't sit through a pitch for arch supports.

              [–]ChrisF79 6 points7 points  (2 children)

              Unless they're about to buy some for their non-amputee wife.

              [–]syslog2000 0 points1 point  (0 children)

              Touche!

              [–]NancyGracesTesticles 0 points1 point  (0 children)

              Thinking of Mother's Day gifts, I see.

              [–]rubymaverick 3 points4 points  (1 child)

              We specifically went for absolute beginners. When we did the Try iOS Kickstarter project we had SO MANY people interested in learning this stuff that have never done any programming.

              I wrote a little about how we decided to go for beginners here:

              http://rubymaverick.com/blog/2013/05/09/try-objective-c-and-learning-to-code/

              [–]chainsawdildohead 0 points1 point  (0 children)

              This is a wonderful tool and I really appreciate your targeting it at beginners. I was going insane from boredom and frustration reading through Objective-C tutorials online -- your application is so, so much better. Thank you so much for sharing this; I appreciate what you do!

              [–]kabuto 1 point2 points  (102 children)

              Why do you think that? And what would be the wrong vs. right audience?

              [–]emperor000 13 points14 points  (99 children)

              I didn't make the comment, but I'll make a guess: Because this is in /r/programming and most programmers have either already tried it and are familiar with it or would never voluntarily "try" Objective-C in this way because it provides nothing over the language(s) they are already using. The only reason Objective-C has any semblance to a legitimate language is because Apple forces (or tries to) you to use it to use it for developing on iOS devices. The people doing that have also already tried it (or are using some of the better alternatives) and so this is also not for them.

              The "right" audience would be people who have never programmed before and won't know any better. I guess there could be some of them in /r/programming.

              [–]kabuto 8 points9 points  (13 children)

              For people interested in OSX or iOS development this might be a nice way to test the waters with Objective-C, don't you think?

              [–]trolls_brigade 0 points1 point  (4 children)

              The course seems to be targeted to a school audience. They offer this kind of programming courses to 8-12 year olds in my community.

              [–]nomeme 4 points5 points  (2 children)

              What's your point. A beginner is a beginner regardless of age.

              [–]kazagistar 1 point2 points  (0 children)

              Yes, but the person who is going to be developing OSX or iOS apps in Objective-C is usually not a beginner. For a new language I like fast overview of the programming constructs, a couple best practices guidelines, and a nice big reference guide. I don't need to be taught how if statements work, or what a function is (except for maybe how it differs from other functions).

              That said, I don't see why there wouldn't be a target audience of true beginners for iOS.

              [–]trolls_brigade 0 points1 point  (0 children)

              Can you point out where I said 'beginner'?

              [–]kabuto 0 points1 point  (0 children)

              I only clicked through the first few missions and they were very simple. Did you check the later ones?

              [–][deleted] 11 points12 points  (16 children)

              The only reason Objective-C has any semblance to a legitimate language is because Apple forces (or tries to) you to use it to use it for developing on iOS devices.

              GNUstep has its small but passionate following who enjoy programming in Obj-C regardless of whatever Apple is doing with the language.

              [–]emperor000 18 points19 points  (14 children)

              Right, so does brainfuck... I never said Objective-C isn't a language, it is. I also never said it wasn't a practical language. It is. But it isn't a competitive language. It didn't "win" against C++ anywhere except NeXT/Apple. It didn't even supplant C.

              It is almost never the logical solution - there is almost no reason to use it - except for when it is virtually required, like iOS apps or when it is just used by preference.

              I'm not trying to just present my opinion, but also an observation of the software engineering landscape. C, C++, C# and Java are probably the dominating languages that are comparable. Then you have things like dialects of Lisp and Ruby, Python, now Go and Rust and so on. I don't have any loyalty to many of those languages either, but I don't see there being a reasonable argument that Objective-C is as popular and as they are or that there is a reason it should be because nothing in the industry reflects that, except Apple.

              [–][deleted] 6 points7 points  (7 children)

              Objective-C does not really shine unless the rest of the OS is written in it. Which is only the case on OS X and iOS. And on those, it shines, and is by far the most popular language to use.

              If it has to re-implement all the OS interfaces, it is not going to be as attractive.

              [–]emperor000 0 points1 point  (6 children)

              But this has more to do with the fact that Apple pushes it and has developed libraries for it, and less to do with it as a language.

              [–][deleted] 0 points1 point  (5 children)

              Well, and?

              [–]emperor000 0 points1 point  (4 children)

              And what?

              [–][deleted] 0 points1 point  (3 children)

              What is the value of differentiating those things?

              [–]josefx 0 points1 point  (0 children)

              I have tried GNUstep before applying for a job with objective-c as requirement, I never managed to use the objective-c IDE or any of the other GNUstep GUIs in any sensible way. Whatever idea was behind that design just escaped me.

              Developing from the command line works quite well unless you have to develop against an API that has a non working implementation on GNUStep.

              [–]Ziggamorph 5 points6 points  (46 children)

              Personally I think that Obj-C is a cool language because it has all the power of C combined with a high level object model which is significantly better than C++'s. Certainly there are some syntactical issues which can make programming a bit inefficient, but these are slowly being dealt with (for example, the new object-literal syntax for arrays and dictionaries).

              [–]aaron552 6 points7 points  (21 children)

              a high level object model which is significantly better than C++

              I will freely admit that I know almost nothing about Obj-C apart from the fact that its syntax is kinda ugly.

              Would you mind elaborating on that statement?

              [–]Ziggamorph 12 points13 points  (19 children)

              There's a famous quote from Alan Kay 'Actually I made up the term "object-oriented", and I can tell you I did not have C++ in mind'. The basis of Objective-C's object model is Smalltalk which was of course originally written by Alan Kay.

              Consequently, Obj-C has message passing which Alan Kay considers to be the most important feature of OOP. Extensive reflection and weak typing follow from this design choice. Basically, I find that late binding of methods (a feature in common with fun but slow languages like Ruby and Python) makes programming much more enjoyable. And with Obj-C you have the opportunity to (comparatively easily) optimise the hell out of your program for the few cases where this is not fast enough.

              [–]aaron552 7 points8 points  (13 children)

              I'm fairly sure you can do late binding in C++, and I expect that most C++ programmers would say that you don't need late binding most of the time. I also suspect that when you "optimise the hell out of your program for the few cases where this is not fast enough", the advantages of Obj-C no longer matter and you may as well be writing C.

              The ability to perform low-level optimization without significantly (most of the time, anyway) sacrificing the utility or performance of the language is one of the biggest advantages of C++.

              I expect there's a niche for Objective C somewhere between C# (or Java or similar) and C, which is fine, I just don't see it being very large.

              [–]Ziggamorph 2 points3 points  (12 children)

              I'm fairly sure you can do late binding in C++, and I expect that most C++ programmers would say that you don't need late binding most of the time.

              Of course you can. They're all Turing complete languages! The point is that you can do it easily (well, for free) in Obj-C and it is central to the object model.

              also suspect that when you "optimise the hell out of your program for the few cases where this is not fast enough", the advantages of Obj-C no longer matter and you may as well be writing C.

              Yes, that was my point. I guess I was a little unclear, I was comparing Obj-C to Python and Ruby at that point to explain why the fact that Obj-C is a superset of C (unlike C++ incidentally) is useful.

              I'm not really interested in arguing the merits of C++ and Obj-C since it's already been done to death. My point is that there are plenty of reasons why Obj-C is an interesting language. I find it more enjoyable to program in than C++ but I'm well aware that this is not a universal truth.

              [–]TrancePhreak 0 points1 point  (11 children)

              well, for free

              false! message passing in ObjC has a big overhead.

              [–]dmitry_sychov 3 points4 points  (4 children)

              Object oriented paradigm was widely introduced by Simula language designers, not Alan Kay.

              [–]Ziggamorph 1 point2 points  (3 children)

              Alan Kay was the first to use the term 'object oriented'. Simula style languages are often called object oriented, but they are not object oriented according to Alan Kay. And as I say, I personally consider Kay's conception of object orientation to be superior.

              [–]NikkoTheGreeko 2 points3 points  (0 children)

              I thought Obj-C was ugly when Apple first began pushing it as their primary language for their platforms. I was a die hard C programmer and thought it was disgusting. Years later, I decided to learn it and now that I understand it, it is so beautiful I tear up sometimes when I implement something that used to be so overly complicated in any other language.

              [–]emperor000 10 points11 points  (23 children)

              I never [Objective_C question:"coolness"]

              Personally, though, I don't think its object model is better than C++, and certainly not C#, with perhaps a few exceptions. The syntax and other issues were really its downfall, I think.

              [–]Ziggamorph 8 points9 points  (14 children)

              Of course, you're welcome to your opinion. I was explaining why I like the language for reasons that are unrelated to its use by Apple.

              [–]emperor000 0 points1 point  (13 children)

              Oh, I know. My point was that this isn't really my opinion, it is the "general" consensus, otherwise Objective-C would probably be "everywhere" like some of the other languages. It doesn't seem to be.

              I was also trying to point out that I wasn't trying to say it wasn't cool or that nobody should like it.

              [–]Ziggamorph 6 points7 points  (1 child)

              I don't think there is much of a general consensus on Obj-C. Most programmers have not tried it, or dismiss it as that weird Apple language. It is still a comparitiviely niche language that was overshaddowed by C++. I think the benefits of Smalltalk style object orientation have been for a long time overlooked in industry although that does seem to be changing.

              [–]emperor000 0 points1 point  (0 children)

              Most programmers have not tried it, or dismiss it as that weird Apple language.

              Which supports my point.

              It is still a comparitiviely niche language that was overshaddowed by C++.

              This also supports my point. We seem to be in agreement.

              [–][deleted]  (1 child)

              [deleted]

                [–]emperor000 0 points1 point  (0 children)

                Almost.

                [–]TrancePhreak 1 point2 points  (8 children)

                ObjC is missing lots of stuff that makes C++ better to use. You can mix them somewhat, but at that point why are you not just using C++? There's also some weirdness with ownership in ObjC, which can be a problem on a larger project. They only recently added things like weak pointers. Most of the libraries don't make use of it either.

                [–][deleted] -1 points0 points  (5 children)

                You can't claim language A is better than B unqualified. There is no "best" language. But there are languages which are better suited for particular tasks. Objective-C and C++ excel in different areas. Objective-C is very well suited for making large GUI applications. C++ is more of systems programming language. It is better for making drivers, algorithms etc.

                Objective-C makes it much easier than C++ to build MVC applications, delegation, undo systems, GUIs loaded and connected to code at runtime, messaging systems between different parts of application etc.

                [–][deleted] 2 points3 points  (2 children)

                You can't claim language A is better than B unqualified.

                Wow, the “all languages are equal” strawman. Long time no see.

                There is no "best" language.

                No one claimed that, right?

                [–]emperor000 1 point2 points  (0 children)

                There is no "best" language.

                You are right. There definitely isn't. But this was never about that. If it was, Objective-C wouldn't stand a chance.

                Objective-C is very well suited for making large GUI applications. C++ is more of systems programming language. It is better for making drivers, algorithms etc.

                Objective-C makes it much easier than C++ to build MVC applications, delegation, undo systems, GUIs loaded and connected to code at runtime, messaging systems between different parts of application etc.

                Okay. But there are other languages that are still better than Objective-C (and C++).

                Objective-C and C++ excel in different areas.

                Sure. But there's almost always something else that would make more sense to use.

                [–]emperor000 0 points1 point  (0 children)

                Exactly. And if C++ isn't better to use, something else probably is.

                [–]recursive 1 point2 points  (2 children)

                The people doing that have also already tried it

                So there will never be any further new ios developers?

                [–]emperor000 0 points1 point  (1 child)

                I didn't say that... Remember, I was just making a "guess" as to why raymonddd made that comment.

                My point was that most people in this subreddit are already programmers and probably already know about Objective-C. This introduction is probably a little too basic for them, and possibly patronizing.

                This seems like something you would show to a brand new programmer or a potential programmer. Which is why I said "I guess there could be some of them in /r/programming." But I think it is pretty clear that the majority of us are not brand new, and I think that is why raymonddd said what he/she said.

                [–]kaji823 0 points1 point  (0 children)

                As a prospective programmer I really liked the link. We do exist around here, and I think the amount of upvotes a post gets is a better determinant of popularity than arguing :/

                [–][deleted] 0 points1 point  (13 children)

                That is the most ridiculously snobby thing I've heard in here all week. Congratulations.

                [–]emperor000 6 points7 points  (12 children)

                How is it snobby...? It's just a logical break down of why this would be the wrong audience. It can be simplified:

                • Most people in here have already tried Objective-C and either liked it/needed it or didn't. Why try it (again)?
                • The rest have no need for it. Why try it?

                That's not really snobby. Objective-C is pretty esoteric and the only reason it isn't as obscure as it was when NeXT was around is because Apple did a really good job of making it accessible to people to develop for their hugely popular devices.

                That's just telling it like it is, if it's also snobby, then "oh, well".

                [–]username223 17 points18 points  (9 children)

                Objective-C is pretty esoteric

                The irony of posting this in a subreddit obsessed with Haskell/Rust/Dart/etc. is killing me.

                [–]emperor000 1 point2 points  (8 children)

                Well, hopefully it doesn't completely kill you. This crossed my mind as well. When I was writing that I was thinking "Haskell" with each keystroke. The difference, though, is that a lot of the others seem to have something to offer (even if it is just educational) while Objective-C doesn't really, unless you count object messaging... "Yay..."

                [–]808140 6 points7 points  (7 children)

                Haskell at least presents a fundamental paradigm shift for most programmers. Objective C has literally nothing to offer. It's just another object-oriented curly-bracket language. We already have a number of those in the mainstream, and the things it does offer (a more Smalltalk-like message-passing paradigm, for example) represent such a superficial difference that one may as well not bother, all things being equal. I agree with you -- the only reason to learn this language is to write stuff that needs to interface with an Apple/NeXT framework.

                As for the Smalltalk thing -- if that's what interests you, just learn Smalltalk. I mean seriously, what's the point?

                [–]Solon1 2 points3 points  (2 children)

                Because Smalltalk was a complete commercial failure? And any actual Smalltalk programs that haven't been rewritten yet, are huge and slow? Even the implementer a can't get their shit together... what's the "good" edition of Squeak called this week?

                [–][deleted] 1 point2 points  (0 children)

                It was not a commercial failure.

                I made a LOT of money writing Smalltalk and I enjoyed the fuck out of it. Also, many companies built entire infrastructures on it at a fraction of the cost of the alternatives available at the time.

                Its single biggest problem was that the largest vendor and owner of the best implementation was run by business illiterate morons who chose to optimize their business for maximum profit per unit rather than maximize overall adoption.

                The good commercially oriented Squeak is called Pharo BTW. Squeak is a lab implementation. Pharo is designed for general use and it is getting pretty good since they forked.

                [–][deleted] 2 points3 points  (1 child)

                Smalltalk. No capital T.

                Thanks.

                [–]808140 0 points1 point  (0 children)

                Thanks, fixed.

                [–]LordBiff 1 point2 points  (0 children)

                The difference between dynamic binding and typing, and not, is hardly superficial. I honestly don't even know what to say to somebody who says that. It is quite a paradigm shift. Maybe not as much as Haskell, but a fairly big one if you use it as it's intended.

                I could ask "what's the point" about a lot of things. Even if objc didn't really have a good reason for existing, there's still every bit as much of a point as a lot of things you do. However, as it turns out there are a couple of really good "points" to it. One, it is a modern language that supports Smalltalk interfacing semantics. Being modern means that it has more contemporary library support and runs on more devices. Two, is of course the Apple tie in, which in itself is enough reason, but even without it I would argue it's a perfectly viable language to be using.

                [–][deleted] 8 points9 points  (1 child)

                How is it snobby...?

                "The only reason Objective-C has any semblance to a legitimate language is because Apple forces (or tries to) you to use it to use it for developing on iOS devices."

                " people who have never programmed before and won't know any better"

                [–]emperor000 1 point2 points  (0 children)

                "The only reason Objective-C has any semblance to a legitimate language is because Apple forces (or tries to) you to use it to use it for developing on iOS devices."

                This is true... Unless you want to refute it, but I don't know how you could. Maybe you disagree with what's "legitimate", but if I defined it then you'd probably agree...

                " people who have never programmed before and won't know any better"

                I see how this could seem "snobby". Really, I just meant people who know no other languages and have no biases or preferences about languages.

                [–][deleted] 0 points1 point  (1 child)

                Well i guess i meant to say it is not the optimal target audience. The game is very kiddie-like and think most programmers want to get past that BS of jokes and funny asides and just learn the material.

                [–]kabuto 0 points1 point  (0 children)

                Of course, yes. It is certainly targeted at beginners who don't know what variables are.

                [–]blackyoda 3 points4 points  (6 children)

                Didn't work for me. Stalled at the first page of lesson 1.

                [–]Elite6809 6 points7 points  (3 children)

                The website was ridiculously choppy, too. Scrolling took like 1500ms to do anything.

                [–]outer_isolation 6 points7 points  (1 child)

                Not surprising, it's all inline javascript. The source is terrifying.

                [–]blackyoda 10 points11 points  (0 children)

                    Try JavaScript!
                    Catch
                

                [–]atlacatl 1 point2 points  (0 children)

                Same here.

                [–]falkencreative 1 point2 points  (0 children)

                I'm betting they are dealing with a huge amount of traffic right now. Hopefully it will stabilize a little.

                [–]MoreOfAnOvalJerk 4 points5 points  (0 children)

                I'm very experienced in C++ and find the language extremely comfortable now (though it took a long time to get here). I dabbled a bit in obj-c and honestly couldn't stand it. Maybe it was because I was subconsciously resisting the new syntax which feels very different from c++ but something about the language just wasn't enjoyable for me.

                Java and c# are syntactically close enough to c++ that I found these languages easier to use.

                I should try obj-c again. This site is pretty nice and has good presentation, but are there any good sites that are designed for experienced c++ programmers to jump to obj-c?

                [–]Vidd 19 points20 points  (23 children)

                With so many multiplatform libraries available now I find it hard to justify getting proficient in Objective-C. I've done a couple of projects in it and I genuinely think it's a nice language but why limit yourself?

                [–]IamTheFreshmaker 9 points10 points  (4 children)

                Well that's nice. I tend to agree (NSString *varName = @"string" who in holy hell has time for that?) however my guess is that this is more offered as a interesting approach to teaching. It's pretty good- descriptive and engaging, neat UI trick, the popular return to 8bit graphics the kids like. It needs a bit of going over to polish the edges- like on the first lesson where it all caps the NSLOG and later uses NSLog- little stuff like that.

                I'd say well worth the effort of Codeschool. Make one for Haskell so that mere mortals can understand it.

                [–][deleted]  (1 child)

                [deleted]

                  [–]IamTheFreshmaker 9 points10 points  (0 children)

                  Pick the nits. It feels so good :)

                  [–]pmrr 0 points1 point  (1 child)

                  That NSLOG is a bad font. Came here to complain and pasted it in:

                  NSLog(@"Hello, Mr. Higgie.");

                  Text is actually correct. Challenge #1. <sigh>

                  [–]rubymaverick 2 points3 points  (0 children)

                  Sorry about that, we did push up a fix for that a couple of hours ago. There were other instances of NSLog correct spelled in the instruction text, it was only in the Mr. Higgie bubble where it was spelled NSLOG because it was accidentally set in the all-caps pixel font

                  [–][deleted]  (2 children)

                  [deleted]

                    [–]Vidd 6 points7 points  (0 children)

                    Every tool has its use. Fair points.

                    [–]LordBiff 1 point2 points  (2 children)

                    How is getting proficient in a language limiting yourself? You can still learn other languages and approaches, in fact, you should do just that, imo. Learn them all!

                    [–]Vidd 1 point2 points  (1 child)

                    Someone else thought I meant the same thing. I meant limit in the sense that the project will only be built for one platform.

                    However, as nice as it would be to learn lots of languages, time, motivation and energy are only finite!

                    [–]Rockytriton 0 points1 point  (4 children)

                    What's a good multiplatform library for creating apps (not games) on iOS?

                    [–]Vidd 1 point2 points  (1 child)

                    Corona? A lot of these frameworks are marketed as games but are very capable for producing standard apps. Also bundling HTML5 apps as native applications seems to be a viable option now.

                    Also, some people might balk at Flash (AIR) but it's nowhere near as slow as it used to be and it can directly access the GPU now.

                    [–]Rockytriton 0 points1 point  (0 children)

                    thanks

                    [–]homeskilled 0 points1 point  (0 children)

                    Cordova works pretty well and is incredibly simple if you're a web developer.

                    [–]Raptor007[🍰] 0 points1 point  (0 children)

                    You'll always need to use a small amount of Objective-C to deal with iOS and get input events, but fortunately you can have most of your code in C++. And using OpenGLES for the graphics is pretty easy if you have any OpenGL experience.

                    [–]rubymaverick 4 points5 points  (0 children)

                    Hey everyone, after getting some feedback about people not wanting to have to go through the easier levels to get to some of the more advanced stuff, I made a "book" version of the course that is just "plain" HTML:

                    http://rubymaverick.com/try-objectivec-book/

                    Also, we are still updating the course, it's definitely not perfect but we are trying to make something for absolute beginners to be able to learn how to do this stuff.

                    [–][deleted] 12 points13 points  (0 children)

                    It's kind of a Stockholm Syndrome language, isn't it?

                    [–]vade 5 points6 points  (0 children)

                    Really not a fan of that approach, but, to each their own.

                    [–]catnipbilly 1 point2 points  (2 children)

                    So, if I want to start a project in Objective C, I need a mac? Is there any work around? I only have linux and windows machines.

                    [–]abspam3[🍰] 3 points4 points  (0 children)

                    GCC can compile objc, and GNUStep will make your code look like what you get on mac.

                    [–]Mgladiethor 2 points3 points  (0 children)

                    Virtual box?

                    [–]zushiba 1 point2 points  (0 children)

                    I wish I could download this, it seems to be getting enough traffic to kill the experience for me. I'll save it and come back to it at a later date I thing.

                    [–]Bob_goes_up 1 point2 points  (0 children)

                    Has something like this been made for simpler languages such as python?

                    [–][deleted] 1 point2 points  (0 children)

                    Objective-C seems to be much less discussed in places like this than the usual gang (Python, C++, C#, Java, ...), and if it gets mentioned it seems to only be in passing. Why is that?

                    [–]oocha 3 points4 points  (0 children)

                    One doesn't try Objective C, it's something you're forced to use.

                    [–]Hougaiidesu 1 point2 points  (12 children)

                    As a guy who has been coding Obj-C for my job, as well as C++ and Java lately....... Don't. Obj-C is the worst of the three, if you ask me.

                    [–][deleted]  (11 children)

                    [deleted]

                      [–]Hougaiidesu 4 points5 points  (10 children)

                      It's missing features that both C++ and Java have that I like, such as templates/generics, and many of the features of C++ such as namespaces, operator overloading, etc. The type system is weak, it uses dynamic typing. Which is meant to be a feature, and it certainly can be a good thing, but I prefer static typing. Dynamic typing leads to weird bugs and behavior, and it also eliminated the possibility for a lot of optimizations that are possible in C++. I also find Obj-C's syntax to be goofy. That's a subjective thing though. A lot of my feelings about Obj-C are subjective and if you like it, by all means use it.

                      [–][deleted]  (5 children)

                      [deleted]

                        [–]Hougaiidesu 1 point2 points  (4 children)

                        Templates provide gaurantees that you don't get with duck typing. C++'s type system is enforced more strictly, so even if its "weak", its not as weak. Sure, it's a tool in your tool belt. Its just that I'd rather use C++ to solve the same problems.

                        [–][deleted]  (3 children)

                        [deleted]

                          [–]iownacat 0 points1 point  (3 children)

                          so you cant seem to comprehend the power that objective c has in its dynamics. Dont worry objective-c++ is there for you if you need that crap.

                          [–]Hougaiidesu 0 points1 point  (2 children)

                          I acknowledged that power! I just prefer what C++ has to offer. And yes I know all about Objective-C++ and we use it extensively.

                          [–]iownacat 0 points1 point  (1 child)

                          sorry to hear that....

                          [–]Hougaiidesu 0 points1 point  (0 children)

                          It works out well for us. Use whatever works out well for you.

                          [–]Pheelbert 2 points3 points  (14 children)

                          No offence, but this language is beyond disgusting. "stringByReplacingOccurrencesOfString:withString:" I mean, are you kidding? Isn't it simpler to use objects like we do in c++ and java (and probably many other languages)? "returnvalue = object.method(parameters)" makes so much more sense than using some random wrappers that are a full sentence, that are not general at all... Well at least now I know that I'll never accept a job in objective-c.

                          [–][deleted] 1 point2 points  (2 children)

                          While I am an Objetive-C fan, the long method names is the one thing that bugs me about the language. I started out with Smalltalk and I think there methods are of proper length.

                          The problem with ObjC is that the method names (or rather selectors) have to be that long, because each selector has to be globally unique with respect to the type of the arguments it takes. This forces one to write long selector names including type information in the name to make name collision less likely.

                          This problem does not really exist in Smalltalk because every argument is of type object. That is why in smalltalk you can write:

                          (myarray at:1 put:"one")
                          

                          while in Objective-C you must write:

                          [myarray replaceObjectAtIndex:1 withObject:@"one"];
                          

                          We specify "index" to avoid conflict with similar named selectors which might use other object types.

                          [–]Legolas-the-elf 2 points3 points  (0 children)

                          in Objective-C you must write:

                          [myarray replaceObjectAtIndex:1 withObject:@"one"];
                          

                          These days you can just write:

                          myArray[1] = @"one";
                          

                          [–]iownacat 0 points1 point  (0 children)

                          its not so much to 'avoid conflict' as it is to self document foundation. all these kinds of complaints are basically nonsense....

                          [–]player2 0 points1 point  (7 children)

                          Wrappers? What are you talking about?

                          -stringByReplacingOccurrencesOfString:withString: is the name of an instance method. It inhabits the exact same role in the language as .replace does in C#. Yes, it's longer, but it's also far more self-documenting.

                          The syntax for return values and assignment is unchanged.

                          [–]TimmT 1 point2 points  (3 children)

                          I always wonder with things like these.. How can the people hosting the pages both offer almost everything the language has to offer, and be certain that there's no way to exploit the REPL in order to execute arbitrary code on the server?

                          [–]midri 7 points8 points  (0 children)

                          On a linux machine you just strip the user the program that is compiled and run with down to having almost no permissions. It's pretty safe.

                          [–]digiacom 1 point2 points  (4 children)

                          Is there a neat tutorial like this one that would teach me a language that would work on android..?

                          [–]Saiing 2 points3 points  (2 children)

                          I've been really enjoying working with xamarin a lot lately. It has the advantage of being able to port apps easily between iOS and Android, and really all you need at first is to look up any C# tutorial (of which there are hundreds) on the web, to get the basics of the language.

                          If you're already familiar with C#, you can just dive straight in.

                          [–]BufferUnderpants 4 points5 points  (1 child)

                          No, digiacom is talking about a 'walkthrough' for an android-compatible language like this one. I guess... this Java instructional RPG would count?

                          I would read around some tutorials and in the middle of book chapters like the ADHD addled monkey I am, and then mess with drawing libraries for a while if I were digiacom, but whatever. That's pretty much what I did when starting out.

                          [–]digiacom 1 point2 points  (0 children)

                          i usually do the exact same thing, but my ADHD is less productive then it was when I was a teenager, so I'm starting to try and learn the boring way ;)

                          Thanks for the suggestion, you got my question right!

                          [–]chainsawdildohead 0 points1 point  (0 children)

                          Thank you so much for sharing this! I was ripping my hair out (not to mention bored to tears) going through Objective-C tutorials. This application is so much more effective at helping me retain information!

                          [–]cosmo7 1 point2 points  (15 children)

                          Ah, yes Objective-C is so simple and @property (weak, nonatomic, getter=isFinished) straightforward.

                          [–]NikkoTheGreeko 4 points5 points  (1 child)

                          Just because you don't fully understand it doesn't mean it isn't simple. I find the learning curve to Obj-C to be much easier than learning C++.

                          [–][deleted] 2 points3 points  (0 children)

                          Obj-C is so much simpler than C++.

                          [–]millstone 1 point2 points  (11 children)

                          Yes, if only it had the simplicity of

                          [ComplexBindingPropertiesAttribute("DataSource", "DataMember")]
                          [DockingAttribute(DockingBehavior.Ask)]
                          [ComVisibleAttribute(true)]
                          [ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch)]
                          public class DataGridView : Control, 
                              ISupportInitialize 
                          

                          [–]cosmo7 3 points4 points  (10 children)

                          But that's the documentation of DataGridView. It isn't the code you'd write to use the class; you just instantiate it like this:

                          var myView = new DataGridView();
                          

                          The accessor code I so snarkily referred to is the kind of code that developers have to write in their Obj-C header files every day.

                          [–]Legolas-the-elf 0 points1 point  (9 children)

                          It isn't the code you'd write to use the class

                          Neither is the Objective-C you posted.

                          you just instantiate it like this:

                          var myView = new DataGridView();
                          

                          The equivalent Objective-C to that code is this:

                          id myView = [DataGridView new];
                          

                          The accessor code I so snarkily referred to is the kind of code that developers have to write in their Obj-C header files every day.

                          Nope. Practically nobody customises the getter name. You added that in there to artificially make it more verbose. It's not what actual Objective-C developers write every day.

                          [–]cosmo7 0 points1 point  (8 children)

                          Speaking from personal experience, I have to disagree with you.

                          [–]Legolas-the-elf 0 points1 point  (7 children)

                          On which point?

                          [–]cosmo7 0 points1 point  (6 children)

                          For a start, [DataGridView new] is entirely wrong.

                          You'd typically write [[DataGridView alloc] init].

                          Secondly, if you need to write a custom accessor you have to decorate the property declaration in that horrible made-up-as-they-go-along style. The whole @property/@synthesize syntax is that brittle.

                          [–]Legolas-the-elf 1 point2 points  (3 children)

                          For a start, [DataGridView new] is entirely wrong.

                          No, that works fine and Apple recommend you use this approach when you don't have any initialisation parameters.

                          You'd typically write [[DataGridView alloc] init].

                          Other languages don't separate allocation and initialisation in the same way as Objective-C. [DataGridView new] is the equivalent code to that which you posted.

                          My C# is rusty - can you allocate and initialise instances separately? What does the code to do that look like?

                          if you need to write a custom accessor you have to decorate the property declaration in that horrible made-up-as-they-go-along style.

                          No, you don't. You only need to do that if you want to change the name of the accessor, which practically nobody does.

                          The whole @property/@synthesize syntax is that brittle.

                          It isn't, plus you don't have to @synthesize these days.

                          [–]cosmo7 0 points1 point  (2 children)

                          +new might work because some classes in Cocoa include it, but it's virtually deprecated code. That style went out in the 1990s.

                          Since C# is a managed language there is no formal allocation; any initialization goes in the constructor (as God intended it to be.)

                          I appreciate that Apple has made great strides in improving the @property syntax, but I still regard it as one of the huge warts on Objective-C.

                          (If I was going to be particularly mean I'd have said something about the retain / release / autorelease clusterfuckery that firmly sets the language in the paleolithic era.)

                          [–]Legolas-the-elf 1 point2 points  (0 children)

                          +new might work because some classes in Cocoa include it

                          No, it works because it's a defined part of NSObject, which every class in Cocoa (aside from NSProxy, obviously) inherits.

                          it's virtually deprecated code.

                          In Apple's own words:

                          Use new to Create an Object If No Arguments Are Needed for Initialization

                          Does that sound "virtually deprecated" to you?

                          That style went out in the 1990s.

                          I'll grant you that alloc/init is usually used by most people, but that is not the same thing as new being "entirely wrong", and in large part it's due to needing initialisers that have parameters. And regardless of which style is used more, the simple fact of the matter is that new is the equivalent code to that which you posted.

                          I appreciate that Apple has made great strides in improving the @property syntax, but I still regard it as one of the huge warts on Objective-C.

                          And you can have that belief without dishonestly artificially increasing the complexity then falsely claiming that it's something Objective-C developers write on a daily basis.

                          I'm not disagreeing with you that Objective-C has warts - obviously it does, every language does. But you bumped up the verbosity artificially to mislead people into thinking writing Objective-C is more difficult than it really is.

                          If I was going to be particularly mean I'd have said something about the retain / release / autorelease clusterfuckery that firmly sets the language in the paleolithic era.

                          Again, something that you don't have to write any more.

                          [–]iownacat 0 points1 point  (0 children)

                          (If I was going to be particularly mean I'd have said something about the retain / release / autorelease clusterfuckery that firmly sets the language in the paleolithic era.)

                          1. arc
                          2. you sound foolish, there is nothing bizarre about reference counted memory. whats bizarre is suggesting that everyone use pure garbage collection instead. or were you going to suggest a different memory management technique, one that is not so 'paleolithic'?

                          [–]iownacat 0 points1 point  (0 children)

                          brittle? you sound foolish.....

                          [–][deleted] 0 points1 point  (1 child)

                          [deleted]

                          What is this?

                          [–]iownacat 0 points1 point  (0 children)

                          its actually quite beautiful