Become a fan of Slashdot on Facebook

 



Forgot your password?
typodupeerror
×
IOS Programming Software Apple

Ask Slashdot: Objective C Vs. Swift For a New iOS Developer? 211

RegularDave writes: I'm a recent grad from a master's program in a potentially worthless social science field, and I've considered getting into iOS development. Several of my friends who were in similar situations after grad school have done so and are making a healthy living getting contract work. Although they had CS and Physics degrees going into iOS, neither had worked in objective C and both essentially went through a crash courses (either self-taught or through intensive classes) in order to get their first gigs. I have two questions. First, am I an idiot for thinking I can teach myself either objective C or Swift on my own without any academic CS background (I've tinkered in HTML, CSS, and C classes online with some success)? Second, if I'm not an idiot for attempting to learn either language, which should I concentrate on?
This discussion has been archived. No new comments can be posted.

Ask Slashdot: Objective C Vs. Swift For a New iOS Developer?

Comments Filter:
  • How many times (Score:2, Interesting)

    by msobkow ( 48369 )

    How many times are the slashbots going to post this same stupid question?

  • Learn both (Score:5, Interesting)

    by ZeroPly ( 881915 ) on Friday November 28, 2014 @07:21PM (#48481871)
    You don't need a professor to teach you how to program. Most of us who started using computers in the 70's and 80's were hobbyists, and we were self taught before going to college for CS. I don't use either one, so I'm not an expert, but in the immortal words of Yogi Berra - "when you come to a fork in the road, take it".

    It will only take you 20-30 hours each to learn the basics of the language, so try both, and at some point you'll gravitate towards one.
    • Learn both (Score:4, Insightful)

      by Anonymous Coward on Friday November 28, 2014 @07:29PM (#48481927)

      I agree, as long as you pick up some guides or literature focusing on best practices, rather than just the semantics of the code. There are just toooo many "self-taught" programmers who cannot write professional quality code in a team environment because they were never really exposed to doing it properly. It's perfectly fine to teach yourself - just try to be flexible and adaptable and not get stuck in horrible bad habits - and for god sakes, if someone says you're doing it wrong, at least consider what they have to say.

      • Practical professional stuff to learn about: design patterns, refactoring and test-driven development. Start learning this stuff as soon as possible otherwise you'll make all kinds of awful mistakes when your doing your first professional gigs (assuming you get to that point).

    • The API is. By faaaaaaaaaar the most work is going to be to learn all the NS_xxx classes and how you write and plug together an IOS app. The language on which this is built is small in comparison. The libraries and APIs and things that you manipulate is where the action is.

      Same goes for Java. the Java APIs are waay more work than Java, the language. If you learn Groovy or Clujure, which both run on the Java platform, you still need to learn the APIs or you won't achieve much.

      And so on for Ruby and any other

    • I'm sure that there are plenty of construction workers who know how to "build buildings" that don't think you need an archictecture/structural engineering professor to teach you how to build a building.

      So it depends if you think "building a building" means physically building it, or properly designing a building.

  • Further reading (Score:5, Informative)

    by pushing-robot ( 1037830 ) on Friday November 28, 2014 @07:22PM (#48481877)

    There's a site you may not know about which had a long discussion on this very subject not so very long ago. A lot of people weighed in and you may find it enlightening:

    http://ask.slashdot.org/story/... [slashdot.org]

  • by under_score ( 65824 ) <mishkin@be[ ]ig.com ['rte' in gap]> on Friday November 28, 2014 @07:23PM (#48481887) Homepage

    For wanting to learn something.

  • by Henriok ( 6762 ) on Friday November 28, 2014 @07:25PM (#48481899)
    You are not an idiot for going for this. There's a vibrant market out there for products based on these languages, with a great community and it serves at least two plattforms which by all accounts won't be going away anytime soon. I would go for Objective C, since it's a more mature language, with lots of good documentation, learning materials, and all the frameworks in iOS and OSX is using this. Swift is still finding it's way.. so while you are learning ObjC, Swift will mature, and you will be established when the time comes for Swift. Let the bleeding edge developers work out the kinks first.
  • by mwvdlee ( 775178 ) on Friday November 28, 2014 @07:28PM (#48481921) Homepage

    It's better to try and fail than never try at all.

    But since you have very little experience programming in any language, you're going to have to do a lot of learning and you're going to have to get a lot of help.
    Objective-C has been around a lot longer; there will be more people available to help and there will be more books, tutorials and example code.
    Considering there is a large and valuable legacy code base, it's going to be around for quite some time to come.

    Languages aren't that difficult to switch, assuming you're familiar with the paradigm (procedural, object-oriented, functional).
    API's are the hard part, but they'll be pretty similar between Objective-C and Swift.
    By the time you're proficient with Objective-C, switching to Swift (if necessary) should take just a couple of months at the very worst.

    • That is the biggest nonsense about programming languages I ever heared.
      Objective C is unreadable bitch just like Perl or IBM/JCL.
      To learn Objective C if you can do the same thing either with C or C++ or, that was the parents question: with Swift, is pure masochism!
      Sorry, but who in his sane mind would learn Objective C? Did you even ever try to read a page of code written in that language?

      Bottom line I don't get that fear about APIs repeated here on /. all the time. WTF, there are modern IDEs out there. The

  • by pubwvj ( 1045960 ) on Friday November 28, 2014 @07:38PM (#48481981)

    I would suggest going with Swift.

    The problem is not so much learning the language. You need to learn how to solve certain types of problems and there is a lot of background knowledge you will need. You also need a way of thinking, the Tao of the Programmer.

    My biggest suggestion is that you do not sit around or even shop around looking for 'gigs' but rather start creating stuff.

    Good luck.

  • by caseih ( 160668 ) on Friday November 28, 2014 @07:40PM (#48481995)

    As far as I can tell, Swift is just a new front-end to the Objective-C object system. So knowing how Objective-C works will be beneficial to working in Swift.

    Also most of the libraries and frameworks you will be working with are Objective-C and most of the current tutorials and online resources probably use Objective-C in their examples. That's not to say you need to start with ObjC, but be prepared as you use Swift to learn a bit about it, at least enough to read and translate example snippets you see.

    If my understanding of Swift is accurate, one can intermingle Swing and ObjC libraries and modules. They should have the exact same calling convention and object semantics. Perhaps Swift is easier to remember without some of the more unusual aspects of ObjC's syntax.

    • by Bogtha ( 906264 )

      As far as I can tell, Swift is just a new front-end to the Objective-C object system.

      No, that's not true. Swift interoperates with Objective-C, but it's not any kind of front-end to it, it works perfectly fine by itself.

      most of the libraries and frameworks you will be working with are Objective-C

      Most of the libraries and frameworks you will be working with are system components where you don't see the source code. Whether they are implemented in Objective-C or Swift is an implementation detail y

  • I would learn objective-c first because you can get more help with it. People all over the internet have been doing it for a long time. It won't be obsolete for at least a decade, so don't stress about swift being the new way to do the same things. Find tutorials online or get torrents of books/buy them. Dream up your own micro-projects, when you get stuck http://stackoverflow.com/ [stackoverflow.com] is your friend. This site has saved me MANY times, usually within minutes. take a look at other peoples micro-projects and full
  • Depends... (Score:5, Informative)

    by dagamer34 ( 1012833 ) on Friday November 28, 2014 @07:56PM (#48482085)
    Depends on your goals, really. I think a big pitfall most people think is that the goal is to learn a language, when you really should be aiming to learn confidently learn as many as possible. You'll soon start to see how similar they are, and it becomes a lot easier to pick up.

    The hard part actually isn't learning a language, but a framework. Frameworks are very platform specific, concepts are less reusable. And because Cocoa Touch is so intimately designed around Objective-C, even if you chose to learn Swift first, you'll need to know Objective-C anyway because of a) the amount of code/books/resources that exists on the internet in Obj-C vs Swift and b) a solution to your problem may only be written in Objective-C in a StackOverflow search result.

    As for skipping academic CS, at some point you need to learn the stuff that almost every CS grad is expected to know at some level (data structures/algorithms, operating systems I & II, algorithm complexity (aka Big O notation), software design, etc...) not so much because they'll be explicitly required of you, but as you build larger and more complex apps, without them, code readability, maintainability, and performance are going to go to total shit. Granted, there are some, heck many, CS grads who somehow evade actually knowing this stuff, and things don't turn out so great for the code they write in the end.

    My advice, tackle building an iOS app with a goal in mind, written in Objective-C due to the sheer number of resources out there, then expand from there.
  • Swift (Score:5, Insightful)

    by Schnapple ( 262314 ) <tomkiddNO@SPAMgmail.com> on Friday November 28, 2014 @07:58PM (#48482097) Homepage

    I've been doing Obj-C for a few years now and I'm using Swift in a new project.

    Swift all the way, mainly because Swift is just a much nicer language. Obj-C has a bizarre late 80's syntax which is not found anywhere else so it's very strange. Except for random places where it's not. There was a half-assed "Objective-C 2.0" which introduced dot notation but not everywhere or consistently. There's tons of things you can do with it that are unsafe and shouldn't work (found out a lot in translating some Obj-C code to Swift)

    There's still going to be a bunch of Cocoa stuff to mess with (i.e., there's no intrinsic date concept so you have to mess with NSDate) but at this point learning Objective-C is a waste of time. At best you will have a few more online resources to consult with versus Swift but Swift is the biggest new language in a long time - a language designed by the biggest company on earth for one of the most popular platforms on the planet. The uptake is more or less unprecedented.

    Anyone who prefers Obj-C just doesn't want to learn something new. Apple didn't invent a new language because of hipness reasons, they did it because their platforms are saddled with this shitty language which is missing modern conventions and is difficult to learn and use.

    Just use Swift.

    • by dgatwood ( 11270 )

      There's going to be tons of Cocoa stuff to mess with. You're basically using all the Cocoa classes, just with a bunch of extra wrapper code, in a language that's slower than Objective-C, for little real benefit beyond syntactic sugar.

      Worse, as things stand right now, if you start out using Swift, you're going to quickly start running into walls where the introductory documentation you need just doesn't exist yet. And when you get into trouble, you're going to go searching for code snippets on Stack Overfl

      • You're basically using all the Cocoa classes, just with a bunch of extra wrapper code

        You are using the frameworks directly. There is no "wrapper code". How the API's look to swift has been refined, but there on no layers over said API's...

        in a language that's slower than Objective-C

        An explicit goal of Swift is performance, and it's already faster than Objective-C [jessesquires.com] when optimized.

        for little real benefit beyond syntactic sugar

        I'm sorry, how are Tuples mere syntactic sugar over ObjC? Or operator overloading?

        • by dgatwood ( 11270 )

          There is no "wrapper code".

          For most Objective-C classes, that's true, but I was under the impression that Swift's array and dictionary support consists of wrapper code around NSArray/NSDictionary; I'm not certain of that, though.

          I'm sorry, how are Tuples mere syntactic sugar over ObjC? Or operator overloading?

          Operator overloading is, IMO, almost inherently a mistake. And tuples are pure syntactic sugar. Anything you can do with tuples can typically be done without tuples in just a couple more lines of cod

          • Operator overloading is, IMO, almost inherently a mistake. And tuples are pure syntactic sugar.

            don't like operator overloading either but you can't just hand wave t away as syntax sugar because you don't like it.

            Also tuples are way beyond what I consider syntax sugaring as they replace quite a lot of parameter nonsense and lots of extra method definitions because of elements being optional.

            The entire networking stack has no Swift documentation except for a very trivial NSURLSession example.

            NSURLConn [apple.com]

    • The uptake is unprecedented? Really? I imagine it will be approximately the same, or less, as the uptake for Obj-C when iPhones became a thing, which is "not terribly impressive". You're essentially forced to program in Obj-C for the iPhone, and it's still a niche language. People who write Mac-specific applications and iPhone apps use it, and essentially no one else.

      And the thing is: Objective C could theoretically be used other places. The bindings are there for people to write an OSS GNUStep-based a

      • I imagine it will be approximately the same, or less, as the uptake for Obj-C when iPhones became a thing, which is "not terribly impressive".

        Suddenly becoming one of the fastest growing programming languages in use [stackexchange.com] and making several top ten lists isn't terribly impressive? Ok...

        And now you're telling me that Swift -- which is essentially a tweaked Obj-C -- is "the biggest new language in a long time"? You can't even USE the language to program on anything other than OS X and iOS!

        So, one of the mos

    • Anyone who prefers Obj-C just doesn't want to learn something new. Apple didn't invent a new language because of hipness reasons, they did it because their platforms are saddled with this shitty language which is missing modern conventions and is difficult to learn and use.

      I'm mostly with this. My biggest problem with swift is there are still some holes in the compatibility with C code -- I was doing a project that called into CoreAudio to do some conversions, and the CoreAudio API required me to give it a

  • by Hussman32 ( 751772 ) on Friday November 28, 2014 @08:01PM (#48482117)

    It won't take you too long to learn how to write crappy code in either language. What you really need is a place to work that has focused goals, a clear set of programming guidelines that are built around writing code that others can read later, and the sitzfleisch to do the work.

    Find a job with a boss who is passionate about his/her work and are demanding enough to make you want to do a good job. There is no quick rich scheme in the next couple of months, programming quality apps is about art as well as science, and both take a lot of effort.

    But I promise you, your education isn't worthless, there may be unrealized benefits awaiting your team if you are willing to work at their level.

  • by CanadianMacFan ( 1900244 ) on Friday November 28, 2014 @08:35PM (#48482269)
    Best course I took at university was assembly on a simulated CPU which showed me exactly what was going on when I issuing commands. Made me realize what was happening down in lower levels. While I don't touch assembly at all anymore (and never did after that course) the way it made me think about how the computer works definitely turned me into a better developer today. For a very basic example, because I had the experience with the simulator and saw what happened with function calls it's easy to explain why a factorial implementation that uses recursion will be slower than one that just uses a loop.
  • Recent EDU Apple Tech Update led a bunch of us educators with mostly ancient programming skills through a simple app build in remarkably little time. Then see if you want to continue on to Obj-C.
  • 1) There are plenty of books, and plenty of sources online. You can teach yourself. However, to become really good is probably more work than you can imagine, simply because you can have no idea the complexity of it all until you're well into it. But if you're willing to work hard and be patient, then go for it.

    2) In this case, the first thing you need to learn is this: Fuck Slashdot. Go to www.lists.apple.com, sign up for the cocoa-dev mailing list, and ask your questions there. That is absolutely, positiv

    • 2) In this case, the first thing you need to learn is this: Fuck Slashdot.

      I thought Slashdot BETA already took care of that :-)

  • Comment removed based on user account deletion
  • Using tools like Openframworks and especially cocos2d-x you can make things for iOS in C++ that are extremely easy to port to Android, or Windows, Mac desktop, linux, and the Windows mobile OS.

    You don't have to do things the way apple tells you to do things.
  • I've been doing iOS development full time since before the release of the Apple App Store.

    At this point, anyone trying to get into iOS development should, no question, learn Swift.

    Apple has indicated as clearly as they can Swift is the primary language moving forward. All of the most experienced iOS developers I know are rapidly learning swift, much new work is being done in Swift.

    There's also no shortage of Swift books either available or soon to be released, and lots and lots of online courses covering s

  • by Snap E Tom ( 128447 ) on Friday November 28, 2014 @11:14PM (#48482869)

    Objective C will be dropped in the future. Once Apple says "This is the way to go," it *will* drop the old one sooner rather than later. Carbon, Rosetta, and WebObjects are examples of previous technologies that Apple has killed off.

  • The above has been my strategy. Admittedly I've never done coding for pay, however I've been coding my web site, I've written some Android apps, etc.

    When I first learned to program, it was BASIC. Later in college Turbo Pascal - which was dead easy to me as I knew BASIC, meaning I knew about the key paradigms of programming. Another decade or so later I had the need to write some small software, and in a few days I got myself going in Python - to this day my language of choice. HTML was added when the need c

  • You can't realistically do iOS development without knowing Objective-C; its just no feasible since all Apples frameworks are written in it, all the open source libraries use it, and all of the stackflow answers are for it. And fortunately, it is not a bad language. Swift is a much better language, at least potentially. It is still a bit rough to use. But it is sure to replace Objective-C over the next few years, so you would be a fool to ignore it. To address the larger question - you should get some f
    • by Bogtha ( 906264 )

      You can't realistically do iOS development without knowing Objective-C; its just no feasible since all Apples frameworks are written in it, all the open source libraries use it, and all of the stackflow answers are for it.

      This isn't the case. It doesn't matter whether a framework is written in Objective-C or Swift, you can use it from either language regardless. You can write an application from start to finish in Swift without needing to know anything about Objective-C. Sure, if you do know it, the

  • iPhone has a 11% market share, Android has 85%. At the same time, there are more ios developers than Android developers. If you want to plan your career, you learn Android.

  • Businesses that will pay you for a simple iOS app will also want an Android app. So you want to learn a cross platform toolkit like Cordova, where your existing HTML/CSS knowledge will help. Big players like Facebook that can invest in separate codebases for a sophisticated app will not hire you without a C.Sci degree and relevant experience. At this point, also consider that mobile development is difficult and is only a small part of consulting jobs. Good money can be had writing Hadoop jobs that require m

"Here's something to think about: How come you never see a headline like `Psychic Wins Lottery.'" -- Comedian Jay Leno

Working...