Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Objective-C, why does the syntax suck so bad? — Gideros Forum

Objective-C, why does the syntax suck so bad?

eezingeezing Member
edited March 2014 in Relax cafe
Had to edit an Xcode Objective-C project yesterday and boy did I struggled with the syntax. Heck, trying to print an integer to console took 25 minutes and a dozen google searches. I get that these native languages allow for maximum control, but the complexity to a simple line of code seems a bit ridiculous this day in age.

For the most part I'm able to stick with interpreted languages, but every now and then I'm required to get my hands dirty in something C.

if you got any tips, suggestions or resources on learning that stuff, please feel free.

Thanks!

Comments

  • ar2rsawseenar2rsawseen Maintainer
    Ah, so true, completely my thoughts.
    Well I seem to be ok with Android and Java for the most time (until it comes to JNI and C bridging) :D

    But basically one of the many reasons using cross platforms frameworks like Gideros to make development much more enjoyable
  • Yes, nice thing about Java is GC which is a little more complicated with Objective-C. @ar2rsawseen I noticed that XCode exports have ARC (Automatic Reference Counting) disabled. Do you think it would be ok to enable it for when we are developing our own plugins. Would it mess up any other parts of the project?
  • ar2rsawseenar2rsawseen Maintainer
    @amaximov yes it could mess up something internally (usually there would simply be a warnings etc).
    But as far as I remember, you can enable ARC for separated source files
  • @eezing and @ar2rsawseen, more so @ar2rsawseen
    I am surprised...

    agreed that it is easier to simply have something like
    printf("You are lucky winner : %d", 5);
    but then having something like
    NSLog(<a href="https://forum.gideros.rocks/profile/You%20are%20lucky%20winner%20%3A%20%25d" rel="nofollow">@You are lucky winner : %d</a>, 5);
    is not any different either.

    and while I must admit that when I started off, I did not understand head or tail of Objective-C code, the more I tried to read, the more I got confused, why do you have - or a + and why the square brackets, why the :'s it is a bit unconventional. Once I got my head around it, it all made perfect sense. In fact it is the most verbose language and given that it also has some of the longest methods and functions but they are intuitive.

    Like Gideros has this instant device testing advantage over other frameworks including xCode, similarly I think many languages have the advantage over using Java in Eclipse.

    @eezing, for your question on resource to learn, if you are after books, try the Nerd Ranch (Hillegas) books on Objective-C, there are a couple from Pragmatic and Apress too. If you are after a website with free tutorials and articles, then search for cocoa.
    twitter: @ozapps | http://www.oz-apps.com | http://howto.oz-apps.com | http://reviewme.oz-apps.com
    Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
    Cool Vizify Profile at https://www.vizify.com/oz-apps
  • ar2rsawseenar2rsawseen Maintainer
    @OZApps hey, I have never hidden the dislike for Objective-C, mostly as you said of it being confusing (which mostly relates to using oldschool terms, like protocol instead of interface, messages instead of function calls, etc, and I'm probably too young for that :) ), and probably I'm simply not yet on the same level with it as you are.

    But of course also the fact, that it makes me work on the Mac, does not help either :D
  • @OZApps hey, I have never hidden the dislike for Objective-C,

    But of course also the fact, that it makes me work on the Mac, does not help either :D
    I guess that is the biggest issue, different platforms. Now I cannot live with out my mac as it provides everything, CrossOver, Parallels, VMFusion, VirtualBox (if I need windows), Unix and the Mac OSX. My only gripe with Apple is that now I will be forced to move to Maverics as all apps have to be iOS 7 compatible, for which you need a maverics machine. Thereby making my Lion machine redundant unless I upgrade.
    twitter: @ozapps | http://www.oz-apps.com | http://howto.oz-apps.com | http://reviewme.oz-apps.com
    Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
    Cool Vizify Profile at https://www.vizify.com/oz-apps
  • john26john26 Maintainer
    I wonder what percentage of Macs are sold to iOS devs...? :-\"

    Likes: Harrison

    +1 -1 (+1 / -0 )Share on Facebook
Sign In or Register to comment.