Cocoa, Objective-C, iOS (and Mac) still repulsive

Discussion in 'iOS Programming' started by jonppa, Feb 14, 2016.

  1. jonppa macrumors newbie

    Joined:
    Sep 22, 2009
    #1
    Maybe this is just a personal rant but I still find Cocoa, Objective-C and XCode environments repulsive. I believe someone else is thinking the same way.

    I've now been programming iOS since 2008 (8 years, whoah). Previously I have written apps for Windows on Delphi and C# on .net. Currently writing also with Qt.

    First of all forcing people to use a little bit strange programming language called Objective-C feels like arrogant choice. In a world where there are so called "standardized" languages like C++. Yes, you can write the app totally in C++ (can you, really?) - all examples and stuff are in Obj-C. And what was this swift thing? THERE IS C++, JAVA, PYTHON THAT PEOPLE KNOW, ffs. No need to reinvent the wheel. I think Apple doesn't want to "lower" their statue to use a programming language that someone else has invented, because they are superior in all ways. In gods voice: "you shall use the tools and languages we decide".

    I have never found anything usable from XCode's Apple help. Easiest is to google around and get much better description and EXAMPLES of the code. Yes, Apple has some bloated example-projects somewhere but finding them, understanding them is another issue.

    The provisioning and signing got much better few years ago. In the beginning it was a nightmare, as everyone knows. However now we have new feature: you must upgrade the 5 gigabyte XCode all the time as iOS versions upgrade. Yes I understand why, but does it have to be the WHOLE XCode that you have to upgrade? Downloading new XCode, installing it and stuff takes an hour. Thanks for making me wait.

    Writing software on for example Delphi was damn easy. It started from the graphical user interface, add button, double click it and you have a stumb code where you can write the actions. The IBAction blahblah system is probably just to irritate coders. "Oh no, but you have some many choices with this system" - no I don't usually need them.

    C# on .NET was also a new language and I had to learn it. However there is a night-day difference in the easyness and approachability between .NET and Cocoa/Obj-C. I have to say that .NET framework is really well designed. All variables are named in the same way etc. Also Qt is really neat and easy way to write applications. Qt's help is awesome, easy to understand and it even have CODE EXAMPLES (Apple: hint).

    Another story (no pun!) is the storyboard thingy that came up in the game. How the hell are you going to use that one? Could Apple in this century write something intuitive ways to approach things. And editing the storyboard is almost impossible with Macbook Pro 13" without going insane.

    Solution is not "well just don't write apps for iOS or Mac". I wish it would be so. Apple has created awesome devices and OSes that I want to use, but feel really forced to use their tools when creating software for their devices.

    </rant>
     
  2. 1458279 Suspended

    1458279

    Joined:
    May 1, 2010
    Location:
    California
    #1
    I'm glad you wrote this. I've been programming for a very long time. I was learning Delphi back when it first came out and also did the C#/.Net round as well.

    That provisioning years ago screwed me up for hours :D I've never understood why computer languages had to be so different.

    I remember seeing a documentary about the evolution of cars. Back in the old days of cars, the gas/brake/clutch were wherever they wanted to put them. There was no rules or standardization.

    It's funny if you think about how 'smart' the computer world is and yet look at what they do. One of the biggest economic gains the world has seen was standardized shipping containers. Look at how much time is wasted because of all the different programming languages.

    I worked with DOS for years and I'm hardly functional in the OSX command line because they use different syntax.

    When Microsoft came out with Windows, people loved it because it was finally easy to use and standardized.

    Given all this, they can't make languages standardized? Xcode has no plugin support for GitHub?

    Then, Apple comes out with Swift. It's not like C/C++/C# or ObjC, it's different. Then nearly 2 years later, they're getting rid of ++/-- and For..Next.

    IMO, they've really lost sight of the business of software development.

    Apple has a strong market position right now, but that can change as it did with the PC. I wouldn't be surprised if Apple sees some changes over the years because of these issues. Companies see the devices as a portable computer, in the end who cares if it says Apple or Samsung?

    The consumer of the software we produce doesn't care what language it's written in, they just want it to work. The industry has made things much harder by not adopting standards for languages, editor, etc...
     
  3. AxoNeuron macrumors 65816

    AxoNeuron

    Joined:
    Apr 22, 2012
    Location:
    The Left Coast
    #2
    Guys, stop thinking of these things as bad things. Sure, they're irritating. Ridiculously, unbelievably, damnably irritating at times. But they make things more complex, and that's a good thing for us, because it increases our economic value as software developers. The more difficult and challenging it becomes to learn software development, the more important (and well paid) we shall become.

    That's the evil, Machiavellian way of looking at it. If they fix things and make it easier then our lives will be easier, but if they don't, we'll stay a small group of well paid individuals. Win win!
     
  4. cqexbesd macrumors regular

    Joined:
    Jun 4, 2009
    #3
    Given OSX gives you a pretty standard UNIX environment, familiar to people back to the 80s or so, I'm not sure its fair to say that because you started elsewhere then everyone else should move to that. Personally I had used UNIX well before I had used DOS.

    The real problem here I would suppose is that the DOS syntax would have to be so massively extended to be able to do all the UNIX things OSX supports (job control, complex piping and redirection, subshells etc) that it wouldn't be that much like DOS anyway. On the bright side OSX, like any UNIX, allows you to use anything you like as your shell so if you really long for the DOS syntax you could run something that used it (or write you own if required - in any language at all). Of course the provided commands would still be unix like so if you wanted it to feel like DOS on a more than superficial level you may need to do more than the shell.

    If you think there is a demand it could be a good project for someone.

    Some languages are good for some jobs, some good for others. If the only tool you have is a hammer, then everything looks like a nail. Languages grow and develop and feed off each other. This is how the art moves forward.

    Luckily most languages share a lot in common so its not so hard to move between them. I learnt the basics of Objective C in just a few hours - much as I did Java - because they are both very C like, a language I already know well. Mastery, of course, takes much longer - especially as its often more to do with knowing the environment, the standard libraries and the idioms more than the language. I think this is the common experience for people in the industry. I currently work in a language that I didn't know before I started my current job and I just learnt as I went - and this applies to at least 50% of my colleagues as well as we use a fairly obscure language. Java was the same experience for me - I had only superficial knowledge of it before I needed to use it.

    I haven't yet found the time for Swift alas so I can't say if this is some exceptionally hard language to use - but knowing Apple I would be surprised.

    As far as Apple's support for alternative languages - it's actually really difficult and expensive to support multiple languages in a rich eco-system so it doesn't surprise me that most platforms give you just one. You need a language that is expressive enough to be able to have a nice API and performant enough that people can write things well without spending hours optimising and familiar enough that people don't have to spends weeks studying to get started. Objective-C seemed to be that language - instantly familiar to C programmers who had tried OO with only a few small syntactical things needed to get going. There weren't too many choices IMO - C++ and Java both having terrible downsides and Objective-C already being in place from NextStep. Personally I think it was the right choice and I'm glad to have used Objective C.

    By providing a C API to as much as they can Apple at leafs leave the door open for fairly easy access by other languages.

    Of course the world has moved on since C's heyday (sad for C programmers like myself but true). C is still a very good language but for most application writing jobs it lacks some nice (though admittedly not required) features. Objective-C added some of these. Now Apple wants to add more modernity and feel limited by the structure of the language - so they went and did the huge amount of work required and produced a new language. This is great. This is how we move forwards. Will they have got everything right? Obviously not. Is it even possible for them to have done so? Probably not - languages are always a compromise.

    I'm not qualified to pass judgement on Swift given the little time I have spent on it compared to other languages but the point I am trying to make is that development in the development space is good. Not all of it will be successful but we can all learn from it either way.
     
  5. 1458279 Suspended

    1458279

    Joined:
    May 1, 2010
    Location:
    California
    #4
    That's an excellent point and it's not just about the money.
    How many times have we seen those "Do I have to program to make an app" type questions?

    I'm not against anyone learning, but I remember back in college many people just didn't get it. You'd try to teach them basics like looping and data types and it just didn't sink in.

    These people are looking for a job or a way to get an app for cheap. They don't belong in the world of professional programmers. The code they write can cause more damage that good.

    So yea, I get that this becomes the gate-keeper to something that is actually a real science.
    --- Post Merged, Feb 15, 2016 ---
    Good point about DOS vs Unix. DOS should have copied it's syntax from Unix, at least for the basics.

    I do understand that all the languages offer something unique and try to address concerns, but what I'm talking about is just the basics.

    Take looping for example. Why can all languages just use For..Next or at least have that as one loop while offering others for special needs. If the basics of programming are loop, iteration, and selection, why can't those all be the same and have maybe some added options.

    Swift did something that I don't think I've ever seen before. The return type of a function comes at the end. Maybe some others do this, but why?

    IMO, it's like the turn signal switch on a car. if you put them all in the same place, everyone would know where it was and how it worked. Remember when cars were 1st built, you couldn't tell the clutch from the brake.

    I can see the need for special languages for special needs, but Swift, ObjC, C++, C#, Java are all pretty much trying to be main stream.

    Can anyone say that ObjC can do something that C++ or Java can't do? Aside the who was here first, I get that part, but think about newer languages.

    This is just under the heading of 'C'. It looks like someone too some pills they shouldn't have taken and just kept making new languages.

    https://en.wikipedia.org/wiki/List_of_programming_languages
     
  6. Stella, Feb 15, 2016
    Last edited: Feb 15, 2016

    Stella macrumors 604

    Stella

    Joined:
    Apr 21, 2003
    Location:
    Canada
    #5
    Java, C#, somewhat ObjectiveC (thanks to iOS) aren't trying to be mainstream, they *are* mainstream.

    To answer your question: ObjC can be used to build native iOS apps with XCode, out of the box. Java cannot. ObjC cannot be used as easily to build web applications, unlike Java.

    Programming languages are not black and white. Each have their own strengths. These days, developers want to get on with building software - implementing business logic. 3rd party developer support is extremely important - what frameworks / libraries are available for the software project? What does Java do that C++ cannot *as easily* and vice versa....? One answer.

    What most developers do not want is to be challenged by the programming languages itself. One language is not ideal for all types of software - a competent developer will choose their language of choice based upon the task. These days, software developers need to be competent in more than just one language. Flexibility is the key.

    I'm for one, is very glad the world has moved on from C. Other languages allows me to concentrate on implementing the business logic, and less on lower level issues such as pointer management, pass by reference / values etc - which languages and the runtime can manage quite efficiently by itself. This will help improving on software reliability.

    ------------


    Those languages under 'C' you list - you do realize that some of them aren't designed to compete against each other right? They have different purposes. Listing languages like you have done putting them under one category of "too many languages" is very naive.
     
  7. cqexbesd macrumors regular

    Joined:
    Jun 4, 2009
    #6
    Because it would look out of place and ugly in numerous languages. Imagine C with a "Next" keyword... Having inconsistent syntax is horrible to use and having your source code not easy to "flow" your eyes over makes it harder to understand structure. Of course it fits in some langauges.

    Go does this order, as does Ada and Pascal. I'm sure many others. It is meant to be more natural when reading it e.g. the method takes a string and an int and returns a string. I'm so used to C style declarations I don't like it much but I know its my prejudice rather than an actual deficiency. I'm sure I would get used to it if I used it often.

    All are Turing complete so you can do everything in all of them (more or less) but some things are easier than others. The big difference is the ObjC supports dynamic typing and binding allowing e.g. simple implementation of proxies and delegation. You can do all this in other languages of course. I can do it in C but ObjC makes it so much nicer. And ObjC makes everything nicer than doing it in C++ :)
     
  8. firewood macrumors 604

    Joined:
    Jul 29, 2003
    Location:
    Silicon Valley
    #7
    Rant away, because I (and many others) find the other old languages, tools and platforms you mention even more repulsive.

    All these computer languages are Turing complete. But no one can create a better programming language (for humans) without doing something different (which you may not like), and dumping legacy syntax (which may include your favorite language feature, but implemented or specified poorly). And Swift is looking far better than Go or Hack.

    I think that Objective C is great because it's a superset of C (close to the hardware) with a minimum of any cruft added (unlike C++) beyond basic OOP, and thus somewhat suitable for high performance real-time processing (unlike Java and most other GC languages). C++ reminds me of the old cat lady whose house is filled to the rafters with piles of collected junk.

    My guess is that Apple's original iOS code-signing gauntlet was to keep out (lazy or stupid) coders who even couldn't follow basic multi-step instructions. Apple was never interested in people porting over old crufty solutions because they didn't know how to create newer better solutions.

    And you don't need to use storyboards if you want to do your own manual layout (which is no longer trivial on any of the multi-device platforms). I still do layout in code with some legacy apps. Xcode is great compared to unix makefiles and vi (which I still use).
     
  9. xStep macrumors 68000

    Joined:
    Jan 28, 2003
    Location:
    Less lost in L.A.
    #8
    Yes, it is.


    Back in 1985 when Next Computer was choosing languages, C++ was relatively new, Java did not exist, and there wasn’t a huge list of object oriented options. The smart developers of Next bought into Objective-C because it answered their needs at the time. When Apple bought Next, they were buying into well developed, mature, and proven environment. Apple continued on with that environment all the way through to it’s most recent devices. Arrogance had nothing to do with asking you to use Apples proven system.

    Swift is an interesting turn of events. It’s good to see them trying to improve the development process, but many people will have big struggles with it. On to the future! :)
     
  10. Stella macrumors 604

    Stella

    Joined:
    Apr 21, 2003
    Location:
    Canada
    #9
    XCode is not a particularly good IDE for writing code, especially Swift ( no refactoring tools. Xcode simply lacks many tools / features found in other IDEs .

    Xcode to write Swift or ObjectiveC is just good enough... Not fantastic.
     
  11. AxoNeuron macrumors 65816

    AxoNeuron

    Joined:
    Apr 22, 2012
    Location:
    The Left Coast
    #10
    I agree there, Xcode + Swift just isn't anywhere close to as good as it really should be.

    I mean, autocomplete is horrendously bad in Swift. I don't know why, but it just feels like autocomplete in Objective-C is so much better (even though it's STILL not very good). But in Swift, I find that autocomplete is essentially useless since I type faster than it can suggest.

    There's really no excuse at all for this, since my computer very fast, there's no reason autocomplete should be so slow. Even worse, Swift's autocomplete seems completely irrelevant. Say in the last 5 minutes I've been working with UITableViewCells, and I start typing this:

    Code:
    self.tableView.insertRowsAtIndexPaths(<indexPath>, withRowAnimation: <UITableViewRowAnimation>);
    When I start typing in the 'row animation' section, it should automatically suggest 'UITableViewRowAnimation'. But no, it doesn't do that. Thats completely basic stuff Apple, it isn't that hard to do, and it would significantly improve everyone's speed if you would simply improve the damnable autocomplete in Swift. I mean seriously, I can personally create a better autocomplete routine than Apple, both faster AND more relevant. And if I can do it, there's absolutely no reason Apple can't....this is really just junior-level stuff and there's no reason it should be so terrible in Xcode.
     
  12. 1458279 Suspended

    1458279

    Joined:
    May 1, 2010
    Location:
    California
    #11
    I remember the old days. We used to have editors, compilers and linkers. We used to get out of the editor, compile, and link. It's seems old at this point, but I do remember that a few of them had their own compiler.

    I spent a great deal of time learning the language that the editor used. There were over the counter products that you could by that were add ons for the editor and some included source code.

    One example actually built the asteroids game that was created in the editors compiler.

    TBH, it became very productive. One thing I noticed is that Xcode doesn't have any add ons that I've seen. Someone said ObjC has a playground add on, but I haven't see a large market for these add ons. I don't see why someone can't build an add on for code completion.

    Kinda odd that many say Xcode is better than what Android offers. You'd think that an open free market system like Android would come out with some great things.
     
  13. Stella, Feb 16, 2016
    Last edited: Feb 16, 2016

    Stella macrumors 604

    Stella

    Joined:
    Apr 21, 2003
    Location:
    Canada
    #12
    The great thing about today, in many cases the language vendor does not have to come up with the IDE - just an SDK. You have option to choose another IDE, which may have been better than the 'official'.

    You don't have to use XCode to write your code - there are alternatives. Though alternatives still rely on the XCode tool chain, and you'll still have to use XCode for some tasks such as GUI Builder and CoreData mapping. They aren't total XCode replacements. Still, better than nothing.

    The official Android IDE is Android Studio which is based upon IntelliJ product. In terms of coding editing / debugging, and stability definitely better than XCode. But you don't have to use this one, there are alternatives...

    There are XCode plugins - look at Alcatraz - XCode Package Manager, that allows you to browse / install XCode plugins... the easy way.

    Lastly, I remember the 'old' days too... and glad things have moved on and progressed: Software Development is more productive.

     
  14. tyche macrumors 6502

    Joined:
    Jul 30, 2010
    #13
    Delphi was awesome. I programmed professionally on ver 2 and 6. Best years of my career. The only thing I'm sick about in the Apple dev world is the never ending device resolutions. I guess the same could be said about any mobile platform.

    Ps. I do use Embarcadero to keep my source code compiling on newer platforms. Pretty comprehensive platform that is too pricey.
     
  15. Stella macrumors 604

    Stella

    Joined:
    Apr 21, 2003
    Location:
    Canada
    #14
    I remember when Delphi introduced Code Insight - was fantastic! The VCL, BDE, and the incredibly buggy Help of v2 ( or v3 ), where the context sensitive help didn't go to the correct Help Page! The GUI Builder was pretty good - helped you out a lot. Though, looking back - the ability to put database components on a UI Form was pretty flawed... broke MVC.

    I think Delphi 5 was the last version I used.

    Shame about Kylix - potentially good but the execution was awful.

    Delphi is still alive.... just about.
     

Share This Page