Is it still worth it to learn Objective-C

Discussion in 'Mac Programming' started by Jacksonc, Jun 2, 2014.

  1. Jacksonc macrumors 6502

    Jacksonc

    Joined:
    Dec 1, 2013
    Location:
    Jony's house
    #1
    I just bought a bundle a few days ago that had a lot of courses to learn to write code. One of them was Objective-C. I just started that one this morning, but I'm not sure if I should continue. Should I focus on learning Swift, or should I learn both?
     
  2. Red Menace macrumors 6502

    Joined:
    May 29, 2011
    Location:
    Littleton, Colorado, USA
    #2
    You can use whatever you like, but since the Cocoa documentation uses Objective-C, you will at least need to be able to read it.
     
  3. BornAgainMac macrumors 603

    BornAgainMac

    Joined:
    Feb 4, 2004
    Location:
    Florida Resident
  4. larswik macrumors 68000

    Joined:
    Sep 8, 2006
  5. Jacksonc thread starter macrumors 6502

    Jacksonc

    Joined:
    Dec 1, 2013
    Location:
    Jony's house
    #5
    Not really. I can modify most code to make it do what I want it to do, but I don't write any code.
     
  6. mrxak macrumors 68000

    Joined:
    Apr 16, 2004
    Location:
    Drifting through space in a broken escape pod
    #6
    I think Objective-C will be around for a long time. It's certainly worth knowing if you want a job in Mac programming because chances are you'll be working with some old Objective-C code. As long as the old code still works, I don't imagine a lot of companies will throw it away and convert over to Swift, though eventually probably everyone will be writing Swift for new apps and updating parts of their code as they get updated.

    If you're just a hobbyist, why not learn both? The more languages you learn, the easier it is to pick up new ones, and I'm sure learning Objective-C first will help you appreciate Swift and what Apple's trying to accomplish with it.

    That said, Swift is obviously the future. Apple is going to be supporting it much more in the long term. It will get most of the attention at Apple HQ. If there's an OS 11 in the pipeline, it's possible Apple will switch to a brand new set of APIs and Objective-C will fall by the wayside, like C++ did after the OS X transition. In fact, I'd go so far as to say the introduction of Swift is probably the first big sign we've seen that big changes are coming to Mac development. A big company like Apple doesn't create and endorse a new programming language on a whim.

    So, learn both, and learn as many other languages as you can, and you can be the old dev someday talking about how Objective-C used to be everybody's favorite thing. C, and C-based languages are probably not ever going to disappear, they just go in and out of style.
     
  7. Jacksonc thread starter macrumors 6502

    Jacksonc

    Joined:
    Dec 1, 2013
    Location:
    Jony's house
    #7
    Thanks, I guess I'll learn both. I'm only 14, so I probably won't be getting a programming job for a while, but it will be fun to learn. (And I'll keep developing apps for a long time) What would you recommend starting with?
     
  8. chrfr macrumors 603

    Joined:
    Jul 11, 2009
    #8
    At 14? Start with Swift and get in on the ground floor with everyone else who's now learning it.
     
  9. mrxak macrumors 68000

    Joined:
    Apr 16, 2004
    Location:
    Drifting through space in a broken escape pod
    #9
    He's 14, though. He has plenty of time to learn Swift. At his age I was learning Pascal and I've never written another program in it since. It was still a valuable experience. My advice to learn as many languages as possible is all the more relevant to a kid just starting out. The knowledge you learn from each language builds up and makes you understand the decisions made by other language designers. It's going to be a while before any real good Swift books come out, anyway. He can start learning Objective-C now, and start using it now, and in a few months when the new XCode is released publicly, and everybody's scrambling to get their book out, he can pick up one or two of the best ones and start on Swift. Hey, he's already got his Objective-C book. Might as well use it.
     
  10. larswik macrumors 68000

    Joined:
    Sep 8, 2006
    #10
    Well, it really depends on you. I spent a year learning C, then Objective C before I even started with Cocoa and started on my first app. I wanted to learn how to program and enjoyed learning the inner workings of the code.

    But when I started I tried to start with Objective C and I was over my head and didn't get anything. So I stepped back to C and learned it first.

    It really depends on what you want. It took me over a year till I was ready to upload an app to the app store. I asked a lot of questions here on the forum and read "Learn C on the Mac" it took 3-4 months to read that book and start to really understand the concepts.

    Years later, I am glad I did.
     
  11. 1458279 Suspended

    1458279

    Joined:
    May 1, 2010
    Location:
    California
    #11
    I noticed that they said during the WWDC they were looking for Swift apps to be uploaded, so my guess is that this might go the way of Retina where they have a cut-off day or updates need to have it.

    On the other hand, they now have tons of apps in ObjC, tons of code already written. Introducing a new language is very very hard because of the time to rewrite all the code just to have the program do the same thing it already does.
     
  12. echel0n, Jun 3, 2014
    Last edited: Jun 3, 2014

    echel0n macrumors newbie

    Joined:
    Sep 29, 2008
    #12
    Hey, at his age I was learning assembler :) Today, I'm learning Swift.

    Learn all the languages you can, but knowing down-to-the-metal C will always give you an advantage over most other programmers.
     
  13. 1458279 Suspended

    1458279

    Joined:
    May 1, 2010
    Location:
    California
    #13
    One issue that I haven't seen mentioned in all these new "Swift" threads is the value of the language outside iOS/Mac.

    One of the great values of C/C++/Java/... is that they are very close to universal. I'm a big fan of universal languages in that languages like C/C++ can transfer routines/knowledge base to other platforms.

    Those that start with Swift will be ignoring development on other platforms. The one thing we should be doing is moving towards one language for all the development platforms.

    No matter how much you love or hate Apple, you have to consider several things:

    1. the point of saturation in the US is there or very close to being there (most that want a smart phone, already have one)

    2. the main growth in smartphones is Asian countries.

    3. there are more iPhone 4 version than all of the iPhone 5 versions combined... Meaning that people don't always run to the latest when the one they have is a great device.

    4. If you are interested in a job, you now have 2 languages that can do the same thing. Some companies will be looking for ObjC programmers, others might only want Swift programmers.

    Time will tell how this will all play out, but I can say that what I've seen so far, I really like Swift better than ObjC.
     
  14. ArtOfWarfare macrumors 604

    ArtOfWarfare

    Joined:
    Nov 26, 2007
    #14
    Objective-C won't be around for long. It's not like Python 2 or Windows XP where people will drag their feet on upgrading for the next decade after the replacement comes out. It'll be more like iOS, iPhones, or maybe OS X and Macs, where it'll be dwindling within a few months and all but gone within 4 years.
     
  15. aaronvan Suspended

    aaronvan

    Joined:
    Dec 21, 2011
    Location:
    República Cascadia
    #15
    Try Racket

    Racket is an excellent language to learn the principles of OOP, and programming principles in general:

    http://racket-lang.org

    DrRacket is the IDE that you can use to write and run your code in the same window.
     
  16. Cromulent macrumors 603

    Cromulent

    Joined:
    Oct 2, 2006
    Location:
    The Land of Hope and Glory
    #16
    Highly doubtful. You really think companies / developers are going to rewrite their existing legacy code in Swift for what is effectively no reason?

    Objective-C will be around for many, many years to come.
     
  17. Nalp2010 macrumors member

    Joined:
    Dec 23, 2008
    #17
    Follow the crowd if you're new to programming. You will inevitably run into things you don't understand and will require help with - those are problems that are easy to solve if you're part of a large community, there will always be some resource or person around to help.

    If you need help with Objective C you should be at least be able to "Google it" that's not the case with Swift for the time being.
     
  18. ArtOfWarfare macrumors 604

    ArtOfWarfare

    Joined:
    Nov 26, 2007
    #18
    I really think that companies and developers have far less Obj-C code worth keeping around than you might think. Because Obj-C never had a decent package manager (CocoaPods seems to have been the only one, and in my limited experience with it, I found that it was complete garbage), there's a shortage of Obj-C code that got reused much. There's not much for good examples or full featured libraries outside of what Apple provides. So yes, I think Obj-C will have a swift (no pun intended) demise now that Apple has decided to unveil Swift (this was the point when I realized the possible pun).
     
  19. 1458279 Suspended

    1458279

    Joined:
    May 1, 2010
    Location:
    California
    #19
    +1!

    I worked for a company that had a system developed in an old language that was very very hard to find people that knew well. They had to keep the system going or they would be out of business. This took years to develop, in the meantime, they still had to move forward or die.

    You need to look at this from a business standpoint. The language looks to be easier to learn and safer to use, but does that mean that business that have a system that works or is almost complete will dump it for those reasons alone? NO!

    This is the reason the world had a shortage or COBOL programmers in 2000. It was an outdated language long before 2000, yet many businesses still had legacy code to maintain.

    Updating an OS is very very different, notice how most OS updates don't require all new apps?

    Consider the update from DOS to Windows, even back then Windows ran DOS programs in a window because they knew there was a HUGE user base and code base in DOS.

    Businesses need a compelling reason to upgrade, people don't. People can dump an app and find a substitute, their livelihood (income) isn't usually tied to it.

    ----------

    One other point, who thinks that a business is going to be so willing to dump a proven language for another language simply because it's easier for a NEW programmer to learn?

    Since when are "easy language" programmers more valuable to a business than "hard language" programmers?

    A programmers value isn't based on the easy or hardness of the language, it's based on skills and supply/demand, etc...
     
  20. nuckinfutz macrumors 603

    nuckinfutz

    Joined:
    Jul 3, 2002
    Location:
    Middle Earth
    #20
    I agree with AoW

    Apple appears to have put in significant resources into Swift. The proof will be how much "dogfooding" they do with their own apps.

    That being said no one else uses Obj C so there's little point in a newbie (like myself) learning it. By the time you get comfortable (assuming 3-4) Swift will have undergone two more iterations and AoW is right. New projects will likely be dominated by Swift.
     
  21. Cromulent macrumors 603

    Cromulent

    Joined:
    Oct 2, 2006
    Location:
    The Land of Hope and Glory
    #21
    Your assumption seems to be that because there is no package manager (ala pip / easy_install for Python and npm for Node.js / JavaScript) for Objective-C libraries there aren't that many out there. This is patently false.

    There are no centralised repositories for C libraries either yet there is wealth of software for it available for use by many people for just about every operating system under the sun.

    A quick search on Github will reveal a whole wealth of open source Objective-C libraries out there, and this ignores libraries written internally by businesses to be shared between their closed source applications.

    Objective-C isn't going anywhere any time soon. It'll be here for years or longer. Just look how Python 2 is still going strong even though it is just getting bug fix releases and the newer Python 3 is where all the language development is happening.

    My guess is it will take Apple 10 years (at least) to migrate the vast majority of applications to Swift.

    Perhaps new projects will but the vast majority of code out there is for existing projects and they are all well and truly Objective-C. New code added to them may well use Swift for parts of it but no one in their right minds is going to spend time and money on rewriting existing code from Objective-C to Swift especially as you are going from a theoretically well debugged piece of code to new untested code.

    It just isn't going to happen.
     
  22. hiddenmarkov macrumors 6502a

    Joined:
    Mar 12, 2014
    Location:
    Japan
    #22
    Its not just the amount of code, its how vital it is to the company and if the ROI of dev costs is there to rip it out for new stuff.

    Deeper it digs into the heart as it were, I have found the harder it is to remove it is my experience in this area from many years in IT.


    Also have to factor in in some places the time won't be there for conversion to swift in a short time frame. Staff numbers depending, playing with swift comes after the obj-c code maintenance for current user needs.

    Internal corp development in my view is a different animal than 3rd party. Not a dev at work, I just see how our shop runs for the dev section.

    When the CFO comes down and says please fix this app for us...its tends to be a priority. One you can't do a say adobe on this. I have a more than mild hatred of adobe because at many months out they stop developing for current software, but they will put in a new release months away from release.

    Tell the CFO you can't fix their current app because you are working on a new app in a new language with no timeframe of completion is not going to fly.

    This,imo, gives obj-c a good lifespan.
     
  23. Amazing Iceman macrumors 68040

    Amazing Iceman

    Joined:
    Nov 8, 2008
    Location:
    Florida, U.S.A.
    #23
    Nah, there's nothing as wordy as COBOL.
    Swift may be wordy, but not as bad, as its goal is to be a natural language.
    C is very tight in words and efficient.
    Objective-C is a very strange language. It's a mix of the previous two.

    Swift reminds me of Visual Basic or REX.
    I have to say that is very easy to understand and follow, if it wasn't for Xcode crashing so often.

    BTW, what's the latest version of Xcode 6 available?

    ----------

    I think the contrary. Focus on Swift, it's the new language. You'll need to invest a lot of time and resources to learn something that may go away. If you are good at it, you may not need to work for nobody but yourself.
    Big companies like the one demoing at the Keynote are starting to develop for the new SDK and I wonder if they are focusing on Swift as well. Something worth asking them to get a better idea of what's going on.
     
  24. Amazing Iceman macrumors 68040

    Amazing Iceman

    Joined:
    Nov 8, 2008
    Location:
    Florida, U.S.A.
    #24
    Same here... Basic at 13, Assembler at 14...
    I remember the days of using Microsoft MacroAssembler 1.0, paired up with Sidekick, the Editor that would stay resident in upper memory...

    Next was Lattice C 1.0 which later got acquired by Microsoft... :eek:

    I was learning Objective-C but after Monday, now I'm learning Swift! :D
     
  25. 1458279 Suspended

    1458279

    Joined:
    May 1, 2010
    Location:
    California
    #25
    If you want to release an app before iOS8, then ObjC.

    If you just started and don't plan to release until late this year, Swift.

    If you already know ObjC, then either way, learn some Swift and use as needed/wanted.

    This could be compared to Storyboard in some respects... Storyboard can make development faster. If you only have 2 screens, probably not worth learning Storyboard, if you have 10 screen, might be worth it.

    There's nothing (that I know of) that you can do in code that Storyboard will do for you... It's just a tool.

    If you already know ObjC then there really isn't a compelling reason to change, the performance might be worth it, but that could be a non issue with some apps.
     

Share This Page