Become a fan of Slashdot on Facebook

 



Forgot your password?
typodupeerror
×
Open Source Programming

Ask Slashdot: Which Classic OOP Compiled Language: Objective-C Or C++? 407

Qbertino writes: I've been trying to pick up a classic, object-oriented, compiled language since the early 90s, but have never gotten around to it. C++ was always on my radar, but I'm a little torn to-and-fro with Objective-C. Objective-C is the obvious choice if you also want to make money developing for Mac OS X, but for the stuff I want to do, both languages would suffice on all platforms. I do want to start out on x86 Linux, though, and also use it as my main development platform. Yes, I know quite a few other languages, but I want to get into a widespread compiled language that has good ties into FOSS. Both Objective-C and C++ fit that bill. What do you recommend? How do these two programming languages compare with each other, and how easy is cross-platform development in either? (Primarily GUI-free, "headless" applications.)
This discussion has been archived. No new comments can be posted.

Ask Slashdot: Which Classic OOP Compiled Language: Objective-C Or C++?

Comments Filter:
  • c++? (Score:4, Interesting)

    by Rinikusu ( 28164 ) on Monday March 02, 2015 @08:33PM (#49168219)

    I'd go with C++ as the toolchain is mature and if you want to do any GUI work there's Qt, etc. Obj-C is more limited on Linux, but I"m sure the Windowmaker guys would love to have some more folks on board.

    • Re:c++? (Score:5, Informative)

      by menkhaura ( 103150 ) <espinafre@gmail.com> on Monday March 02, 2015 @08:40PM (#49168261) Homepage Journal

      Even for non-GUI work, Qt is a blessing if you want to do cross-platform programming. The library does a lot, ranging from database access to network programming, all in a very well documented and well thought out API.

      Good luck.

      • Re: (Score:2, Informative)

        by Anonymous Coward

        Another plug for Qt:

        If you are new to C++, Qt makes it very easy to write code without too many trips to Google. QString class is my favorite example of this. It's pretty easy to figure out how to split a string on a comma with QString. How do you do it with std::string? If your answer wasn't "use boost", you found some chunk of code on Stack Overflow, didn't you?

        The downside to this aspect of Qt is that it can make transitioning into non-Qt C++ development a bit of a challenge.

        • by fnj ( 64210 )

          What's the mystery?

          #include <iostream>
          #include <sstream>
          #include <string>

          int main(int argc, char *argv[])
          {
          std::istringstream iss(argv[1]);
          while (iss.good())
          {
          std::string s;
          std::getline(iss, s, ',');
          std::cout << '"' << s << "'\n";
          }
          return 0;
          }

          • by Pieroxy ( 222434 )

            I think you should be modded funny actually. I haven't done any C++ since college (say, 20 years ago) and reading your code makes me happy that I didn't. The mess of it !

            As another commenter pointed out, what if the string is made of UTF-8 and not ASCII ? Such trivialities should be handled at a layer way below this.

    • Re: (Score:2, Interesting)

      by cheesybagel ( 670288 )

      Both languages suck. I would pick C++ as it is more future proof and less niche than Objective-C.

      I mostly program in Python or C though. Sometimes Java. I hate C++. C++ is the Swiss Army knife of compiled languages. It does a bit of everything but nothing well. You can always find another language that is better at it on every single aspect you look at. Jack of all trades master of none.

      That post on Nim a couple of days back on Slashdot was interesting but I haven't tried the language yet.

      • You can always find another language that is better at it on every single aspect you look at. Jack of all trades master of none.

        Master of Jack is the one thing where no other compiled language triumphs over C++.

        If you're sure on day one that there are language features your project will never need (on any project fork)—cross my heart and hope to die—then go ahead and pick a less cluttered language better suited to your constrained subdomain.

        What you're really saying here is that you'd rather wor

    • First, WindowsMaker doesn't use Objective-C, it's written in C. However, GNUstep [gnustep.org], which is the open source implementation of the Cocoa frameworks (originally the OpenStep specification, but they're tracking Apple changes) could use more help! Oh, and we support (on *NIX) a superset of the Objective-C language that Apple supports on their products, so I wouldn't say that Obj-C is more limited on Linux.

      That said, and I say this as the maintainer of the GNUstep Objective-C implementation, I'd recommend C+

  • by ameoba ( 173803 ) on Monday March 02, 2015 @08:34PM (#49168223)

    C++ is still very much a living, actively developed language. There's a lot of people using it for modern projects. It's well supported under pretty much all modern operating systems & you have excellent tools available under Linux.

    There's not a lot of reason to pick up Objective C unless you plan on targeting Apple. It's pretty much a dead language everywhere else, outside of a few niche projects.

    • by antifoidulus ( 807088 ) on Monday March 02, 2015 @08:52PM (#49168349) Homepage Journal
      Which is actually kind of sad, as an object oriented superset of C Objective-C is much much better than C++(for starters it's an actual superset of C, unlike C++). However it never gained any traction outside of the Apple ecosystem.
    • Re: (Score:2, Informative)

      by Anonymous Coward

      Apple's statements in support of Swift make it sound like it's Apple's intention for Objective-C to be a dead language in their eco-system as well.

    • by perpenso ( 1613749 ) on Monday March 02, 2015 @09:21PM (#49168527)

      There's not a lot of reason to pick up Objective C unless you plan on targeting Apple.

      C++ is also important when targeting Apple. Objective-C is the language of the Cocoa API (Mac OS X and iOS), however there is no need to use it beyond code that makes Cocoa based system calls. And getting C++ and Objective-C code to call each other is trivial.

      Personally I recommend separating UI and platform (OS) specific code from an app's core functionality and implementing the UI/platform-specific code in whatever the native language for the platform is and implementing the core code in C/C++. This leaves the core code portable, ready to target other platforms. I have iOS apps where the core code can be compiled in a console Linux environment and exercised by various scripts (regression testing) and in a random manner (fuzzing).

  • Java (Score:4, Funny)

    by buchner.johannes ( 1139593 ) on Monday March 02, 2015 @08:38PM (#49168249) Homepage Journal

    I don't expect any contrary opinions here on /.

    • Actually not bad advice, if the poster wants to get into OOP.

      Objective-C is the obvious choice if you also want to make money developing for Mac OS X

      With Apple switching to swift, you'll be learning an orphan language. Best bet is to learn c, then c++. This way you get the basics first.

      However, if you think you're going to make money developing for OSX starting from zero, seriously, what universe do you think you're in?

    • Re: (Score:3, Insightful)

      by bobbied ( 2522392 )

      I don't expect any contrary opinions here on /.

      (Oh you ARE sarcastic....)

      Java is not the Swiss Army knife of programming languages... There are things it just isn't well suited for... But generally, not a bad choice for most run of the mill projects where performance and foot print don't really matter. However, if you are on limited hardware or have tight response time constraints, Java is not for you (but you hardware and embedded guys know this already.)

      • by narcc ( 412956 )

        ... There are things it just isn't well suited for...

        Like writing computer programs?

    • by rwa2 ( 4391 ) *

      I would put down Java as a good language for learning how to do OOP stuff in the most verbose way possible. But at least it works as documented, and is well-documented. I find myself spending less time fighting the compiler and obscure memory allocation problems, and more time fighting the shear volume of code. That isn't necessarily a bad thing.

      Otherwise, I think I'd have more fun doing something in Python, with some modules implemented in C++ to optimize the performance-critical parts.

    • by Greyfox ( 87712 )
      No destructors just kills java for me. Yes, I know you have things kind of like destructors that can run at GC time but they're not guaranteed to. That means I have to rely on the programmer to remember to call close before his object goes out of scope, and he's not going to be able to in all cases. That in turn means he's going to be leaking resources. Which seems to be why a lot of the production MQ servers I've seen pretty much HAVE to be rebooted every three days.

      Some time ago I was working for a comp

  • C++, C++, C++ (Score:3, Informative)

    by Anonymous Coward on Monday March 02, 2015 @08:40PM (#49168257)

    C++ is darn-near universal. It is everywhere and everyone uses it for everything.

    Objective-C is an alternative language used, supported, and pushed by exactly one vendor. It only even exists because of the hipster mentality to "be different" just for the sake of being different with no real other point.

    I don't see how this can possibly be a difficult decision.

    Learn C++, and if you find yourself needing to dabble in Objective-C for some Apple device, no problem there. Doing the reverse would be more challenging and would limit your skills.

  • Objective C (Score:2, Insightful)

    by xx_chris ( 524347 )
    I hate C++. It's the triumph of syntax over clarity. The only thing it brought to the game was a better commenting method. I can't read a page of C++ without referring to something. I've never seen clear clean C++. I'd never willfully write in C++. Objective C is a measured improvement over C and I vacillate between obj C and GCC. Would that Swift were more like obj C and less like C++.
    • Re:Objective C (Score:4, Interesting)

      by sg_oneill ( 159032 ) on Monday March 02, 2015 @08:50PM (#49168323)

      C++ can be clean. The problem is really Macro metaprogramming madness tends to lead to some really strange code and sometimes straight up gibberish. I much prefer Objective C as well, I think its terse, readable and *usually* fairly resistant to a lot of the gunk C++ has accumulated. HOWEVER with that said C++ *can* be well written and clear. Hell even PERL can be. Its just that often it isn't.

    • Re: (Score:3, Interesting)

      by Drishmung ( 458368 )
      I agree.

      I was surprised to find how clean Obj-C was. Eventually, I figured out that it's because of two things:

      [1] The weird at first [receiver message] syntax makes it explicit that it is a message passing object model. I find that a natural and helpful model, rather than the procedural-like syntax of C++ and Java. The syntax helps me think in objects, with a clean visual and mental distinction between the Obj bits and the procedural bits.

      [2] NextStep is a thing of beauty.

      Against that, modern C++ has more

      • by Malc ( 1751 )

        Never tried SmallTalk?

  • Comment removed based on user account deletion
    • I was going to say Newspeak, but yeah, Squeak is fine.

      Eiffel or Sather would also be good approaches. Don't damage your brain by using languages whose object module is based on Simula.

  • Objective-C is not classic. That leaves you C++, a rather large language. Large in the sense that there are a lot of rules to learn (with good, practical reasons). But you don't need to know the whole language in order to be productive. And it's fun!
  • Have you ever heard of VB6? I'd start there. Nailed it.
  • by OrangeTide ( 124937 ) on Monday March 02, 2015 @08:59PM (#49168399) Homepage Journal

    Unless you're using Apple's base libraries. Implementing a new Base Library is hard, I've gotten a tiny subset working on my own to see just what is involved. I wouldn't recommend writing the full thing unless you have a burning desire to do it. Porting GNUstep Base Library to various platforms is possible, and has already been ported pretty widely. You'll have to bundle LGPL libraries with your application if you plan to distribute binaries, depending on your application that can make Obj-C a non-starter.

    I use C everywhere, and never C++. C is not the easiest thing to do, but putting together portable frameworks for C is less work than doing the same for Objective-C. (at least in my personal experience, your mileage may vary). C isn't an object oriented language, in that it doesn't do anything special to make that work. But there are OO toolkits for C, with varying degrees of horribleness. A classic is Xt (X Toolkit) and Xaw(X Athena Widgets), which is not terribly C99 friendly anymore. But it does permit limited object-oriented hierarchies. GObject (GTK+) is another option for C, I'm not a fan of it, but it's not obsolete unlike the Xtk/Athena example I mentioned.

    What confuses me about your question is why are you only asking about C++ or Objective-C? There is Free Pascal (Delphi clone) and D. (D is very good, I highly recommend that over Obj-C). There are probably a lot of other options out there that would suit your initial criteria, especially surprising is you didn't mention Java. It's very good example of OO, perhaps OO taken to the extreme, but it's fairly clean. (Obj-C is a little hacky, but thats it's charm and power)

  • by Chalnoth ( 1334923 ) on Monday March 02, 2015 @09:00PM (#49168411)

    There really isn't all that much difference, so that once you get comfortable with one you should be able to switch to the other without much difficulty if you need to. But I'd lean towards C++ because the tools are more mature.

    Two other tips:

    1. Use Clang (part of LLVM) as your compiler. The error messages are vastly easier to interpret, which should cut down on both learning and development time. Note that Clang supports both Objective C and C++.

    2. If you do go for C++, make sure to start learning on C++11 or C++14. C++11 significantly changes quite a lot about the language, and if you start with older C++ books, you'll have to unlearn a lot of stuff if you want to develop modern C++. C++14 has mostly just minor fixes to C++11.

    • 2. If you do go for C++, make sure to start learning on C++11 or C++14. C++11 significantly changes quite a lot about the language, and if you start with older C++ books, you'll have to unlearn a lot of stuff if you want to develop modern C++. C++14 has mostly just minor fixes to C++11.

      You mean using C++ like it is compiled javascript? pffffffffffffffffff

    • Re: (Score:3, Insightful)

      C++11 seems to be somewhat useable. However, before that it was a complete disaster. Every time I looked at it, I saw code bases that endlessly re-implemented data structures and storage management solutions.

      Even with the standard libraries, there were rarely systems without a lot of custom storage code. By it's own claimed abilities for code reuse, C++ was a failure before C++11.

      Every time I brought this up, the C++ fanboys had a fit. I'm rather sure that I was forced out of some jobs because I said this

      • >Debugging has always been a problem. One of the other posts here suggested using CLANG because of it's better error reporting. Thats right now, after 25 years. Let's face it, C++ is legendary for the obscurity of it's compile and link time error reporting. Beyond that, it's not like the run time debugging environment is any better. All that it supports is the kind of break point debugging that was in C. No value added beyond K&R.

        This is true. I teach introductory computer science using C++, and one

  • Why not Pascal? (Score:5, Interesting)

    by Megol ( 3135005 ) on Monday March 02, 2015 @09:07PM (#49168439)

    Object Pascal that is. It's available in Free Pascal for a lot of operating systems and is a small and fast development environment.

  • Basically some asshat at NeXT chose Objective-C and that has sort of percolated through Apple. Originally the only way to do iOS apps was Objective-C; so I learned Objective-C. I hated every minute of it. All those damned, [][]][[. The moment I found an environment where I could go back to C++ I was gone.

    So if you have to make an iOS app and you must use the iOS SDK then I guess you should learn objective-c. But under any other circumstances learn C++.
  • Who cares (Score:4, Insightful)

    by Anonymous Coward on Monday March 02, 2015 @09:10PM (#49168459)

    I don't get the whole debate. Programming is independent of language any good programmer should be able to learn a new language in a few days. In my career I've developed applications in four different assembly languages, java, Pascal, C++, basic, etc. It's just a matter of reviewing the syntax and doing the same things in slightly different ways.

  • by msobkow ( 48369 ) on Monday March 02, 2015 @09:10PM (#49168461) Homepage Journal

    Apple has made it clear their development future lies in Swift, not Objective-C.

    That means you're choosing between a popular, well supported language and a dead end.

    The choice should be obvious.

    • by maccodemonkey ( 1438585 ) on Monday March 02, 2015 @11:25PM (#49169049)

      Apple has made it clear their development future lies in Swift, not Objective-C.

      That means you're choosing between a popular, well supported language and a dead end.

      The choice should be obvious.

      They've done no such thing. The biggest writer and maintainer of Obj-C code is Apple. They're sitting on a huge source base they'll continue developing on. Please link me to where Apple has said Swift is replacing Obj-C. Because they haven't. And they've said the opposite many times. Everything I've read/heard is that Obj-C will continue to be a first class language on iOS and Mac (with Swift and Obj-C both being considered first class languages.) You can have more than one language on a single platform. Shocking, I know.

      Not to mention, for such a dead end, Apple's still writing a lot of new Obj-C. The iWatch OS (what runs on the watch itself) is Obj-C. Apple has not shipped a single API on Mac or iOS written in Swift. Not one. So it makes zero sense that Apple would consider Obj-C a dead language, and yet continue to write source they'll have to maintain for years in it. And if you think Apple is going to rewrite the millions of lines of Obj-C in Mac OS X and iOS in Swift, you really don't understand software engineering very well.

      Another problem is that Swift is missing basic language features. Obj-C can link to C++ code. Swift? Nope. That alone means Swift can't replace Obj-C code. Everyone has C++ code they need to link to. Apple has C++ they need to link to in their own APIs. So does Adobe. Microsoft. And they'll probably fix it in the future. But you can't even approach suggesting Swift is going to replace Obj-C with a straight face until that is fixed.

      Now look, I'm not trying to argue against Swift here. It's a valuable language to use and learn. This isn't a desperate "Obj-C forever!" post. But if you think Obj-C is going anywhere in the next decade or two... It can't. Apple will continue upgrading it, and continue supporting it, or else they're going to end up putting themselves in a corner where they can't even maintain their own software. That's not opinion, that's realism. It's knowing when a tool is right for a problem. And we're nowhere near Swift even being able to entirely replace Obj-C in usage.

      Heck, the last Xcode beta even shipped with some upgrades to Obj-C. So I don't even need to argue that point. It's not a question of if Apple will keep advancing Obj-C. They are.

      • by msobkow ( 48369 )

        The fact that Apple has to maintain internals using Objective-C does not conflict with the fact that they're pushing platform developers to use Swift. There are pieces of Apple's stack written in C, C++, and probably even other languages as well, seeing as the vast majority of their code base comes from open source.

        Of course Apple hasn't said Objective-C is a dead end. There would be a revolt and a mass fleeing from the platform if they did that.

        But they sure as hell aren't encouraging people to stay

        • by maccodemonkey ( 1438585 ) on Tuesday March 03, 2015 @12:00AM (#49169183)

          Of course Apple hasn't said Objective-C is a dead end. There would be a revolt and a mass fleeing from the platform if they did that.

          ...from their own developers? Again, out of the whole community, they have the largest Obj-C source base. If they abandon Obj-C within the next 10 years, they won't be able to ship anything. And it's going to take at least a decade to rewrite everything, if that was even their goal. During which time they ship no features. Apple can't abandon Obj-C because they need to use Obj-C. If they abandon Obj-C, they abandon Mac OS X and iOS. And they will be done in the market. And given that new API is still written in Obj-C, that's a process they haven't even started yet. In April they're shipping a brand new hardware platform that still runs on Obj-C.

          For a past data point, Microsoft said with Vista they were going to rewrite Windows in C#. How did that go? Replacing an entire language is simply not realistic. If you're an engineer, you should know that.

          Furthermore, once you're talking about the pain and suffering in moving everything to Swift, maintaining Obj-C looks like a far easier and more desirable costume. And that's what Apple is doing.

          But they sure as hell aren't encouraging people to stay on Objective-C instead of moving to Swift.

          I've talked with engineers on the Swift team who've said that's not the intention (and are wondering why the public thinks that). But please. Do go on.

          I've read several articles and summaries (including on Slashdot) that have made it clear Apple wants people to use Swift.

          "I've read articles from other people who think they know what they are talking about, and they wrote something that they think is right. Look at me! I'm such an expert!"

          Oh, wait. Never mind. Apple person. You don't deal with the same reality as the rest of the world.

          I... deal with the realities on the Apple platform?

  • I'll admit I haven't seen much of Objective C (apart from on OSX) - while C++ is pretty much available on anything and anywhere. However I'd also recommend having a look at C#.

    If you are not allergic to Microsoft products it's got a lot to recommend it:

    Good frameworks

    Available on Windows, OSX & Linux

    Cross-platform tools like Xamarin (which as an interesting ecosystem for cross-platform mobile apps)

    • by Shados ( 741919 )

      Generally when people say compiled language, and they refer to things like Objective C and C++, they usually mean compile to as close to native code as possible. I love C#, but its fairly obvious that bytecode languages were not options this time around.

      C++/Boost is their best bet.

      • by Touvan ( 868256 )

        MS is switching C# to an AOT system using their very mature C++ backend. Unity3D is doing something similar, and Xamarin does AOT on iOS already (though not through a mature C++ backend). It's still memory managed, but going forward it will be as compiled as anything else.

    • I'll admit I haven't seen much of Objective C (apart from on OSX) - while C++ is pretty much available on anything and anywhere. However I'd also recommend having a look at C#. If you are not allergic to Microsoft products it's got a lot to recommend it:

      But stay away from Entity Framework and Nuget. EF is slow, and Nuget....well, even Microsoft evangelists [youtube.com] criticize it.

      Cross-platform tools like Xamarin (which as an interesting ecosystem for cross-platform mobile apps)

      If you do want to do cross-platform development, you should stay away from advanced C# features like code-contracts. In fact, if you really want to do that, then you should have at least one person developing on Linux, so you stay aware of all the little incompatibilities.

      • by Shados ( 741919 )

        Entity Framework being slow isn't the problem with it. The performance of an ORM only really depend on 2 things. The time it takes to do the mapping, which is trivialized by the actual queries and is really a micro-optimization, and the SQL generated.

        The later is fine in almost all of the mainstream ORMs, and the only real issues come from N+1 queries, and not aggregating queries that can be by using the context and futures. ActiveRecord based ORMs have issues because of the way context vs model objects is

        • The reason Entity Framework sucks is that its API is poorly documented

          That is true too.

          You can get perfectly good performance out of EF, it has all the features an ORM needs to achieve it.

          I don't believe it. I've worked pretty hard at it (one example, inserting a large number of rows into two tables, one that has a foreign key into the other table, can take 1000 times longer than simple SQL queries).

  • by BlackHawk-666 ( 560896 ) on Monday March 02, 2015 @09:21PM (#49168525)

    You should learn c++ unless your real intent is to write a lot of software for an Apple only environment in a language they are looking at deprecating.

    You can get a c++ build chain for pretty much any platform worth working on, and those without it will have a c build chain. There are literally billions of lines of c++ code out there, working in every possible environment. Programmers are churning out millions of more lines every year. You will never be out of work if you are a c++ programmer.

  • by manu0601 ( 2221348 ) on Monday March 02, 2015 @09:35PM (#49168597)

    Submitter wants a "widespread compiled language that has good ties into FOSS".

    What about plain old C? Otherwise, second best choice seems C++

    • I'd go for C (Score:5, Interesting)

      by Zobeid ( 314469 ) on Monday March 02, 2015 @10:08PM (#49168769)

      Yes... You can do OOP in C. With todays toolchains, libraries and techniques, C is more viable than a lot of people give credit for.

      I personally have always disliked C++, and I know I'm not the only one. I've been OK with Obj-C, but... It is a bit eccentric, and it's probably on the way out with Apple now promoting Swift.

      C, on the other hand, is eternal and evergreen.

  • Does anybody actually do that? Isn't the only reason that language isn't extinct the fact that you can do fancy OSX/iOS apps with it? C++ all the way.
  • by Savage-Rabbit ( 308260 ) on Monday March 02, 2015 @09:41PM (#49168635)

    I've been trying to pick up a classic, object-oriented, compiled language since the early 90s, but have never gotten around to it. C++ was always on my radar, but I'm a little torn to-and-fro with Objective-C. Objective-C is the obvious choice if you also want to make money developing for Mac OS X, but for the stuff I want to do, both languages would suffice on all platforms. I do want to start out on x86 Linux, though, and also use it as my main development platform. Yes, I know quite a few other languages, but I want to get into a widespread compiled language that has good ties into FOSS. Both Objective-C and C++ fit that bill. What do you recommend? How do these two programming languages compare with each other, and how easy is cross-platform development in either? (Primarily GUI-free, "headless" applications.)

    I would only bother with Objective-C if I was anticipating having to develop a lot of code for OS X or iOS which might be worth your time since there is money to be made there and IMHO it is a fun language to code in. There is a FOSS Cocoa implementation for Linux, GNUstep [wikipedia.org] but I don't know how current it is or how much cross platform development it allows. Integrating C++ code in Objective C programs (aka. Objective-C++) is as easy as integrating C code into a C++ program so for cross platform purposes you'd be best advised to write as much of your business logic in C++ or even C and use more platform specific languages like Objective-C for view and controller logic. Basically write as much in C++ or C as you can since both can be used in Objective-C apps. That way, if you also want to, say... have an Android version you could write Java wrappers for your C/C++ code. Finally be very careful about what system calls and libraries you use. Just because something is available on Linux does not mean it is available on OS X, the other *NIX'es or Windows. I have all to often seen people end up with egg on their faces after spending significant amounts of time developing something on Linux and using everything Linux offer with wild abandon only to find out hat several key functions or even entire libraries are not available on other target platforms like, say Sun OS or AIX or that even if these are available they behave in a totally different way (example: Lex/Yacc). When doing CP development, even if it is just across multiple Linux/Unix platforms, it pays to write unit tests and regularly compile your software and run the entire test battery on target platforms other than the one you do most of your development work on (which is likely to be Linux).

  • by thisisauniqueid ( 825395 ) on Monday March 02, 2015 @10:00PM (#49168737)
    This is like asking "which medical technique should I use for treating headaches, trepanning or inhaling mercury vapors?"
  • Why do you want to learn a classic object oriented compiled language?

    If you are planning a career switch, C++. No question.

    Just to teach something to you to do some hobby work? Pick something and go. You are over thinking it. You don't need the best in class, no pun intended, just anything will do.

    If you are planning to create a course to offer to some college students, go with Java or something

    If all you want is to troll the slashdotters to argue endlessly, congratulations, you have done it. Let me

  • Objective-C++!

    (Yes, there is such a thing. [archive.org] And yes, I'm being facetious.)

    Yaz

  • I picked up objective-c when ios became big. it's fine and all, but what i find myself doing is writing as much as i can in c++ and then just calling into it from objective-c where i need to. xcode will happily compile the two languages (technically i'm using objective-c++). really, even in apple's apis objective-c only gets you so far. sooner or later you will find yourself calling into c apis. heck even some of their examples only feature a rough skeleton of objective-c working with a big c library.

    my
  • There is a continuum of langauges along the "how strong is the type system" scale. C++ is on the strongest end of the scale. (And here, I have in mind C++11). Let's say C++ is a 9/10. Let's say a scripting language like Ruby is a 1/10. On the scale, Objective C is maybe a 7/10.
    A strong type system is essential for high-producitivity, low-error programming of complex projects. If you are programming smaller things, a less-strong type system can be a benefit, due to the speed of programming and the flexi

    • And haskell is about 10/10, being able to expressively type functions, and make custom types. Point being some may find 7/10 good enought to catch stupid errors, while letting the code be a bit terser and more readable. I'm not sure the tradeoff is at the couple hundred lines territory, as there are often ways to add in additional type restriction in dynamicly typed languages, and you may just want to start with a quick and dirty prototype as a template for the final version.
  • Pick Objective-C. The language is small and simple to understand. If you're already a good programmer with knowledge of C you can learn it in 2 weeks to a month. The frameworks will take longer but the language you can learn in a few weeks. C++ on the other hand will take you forever to learn, it's a large complex language.

  • Out of curiosity: is there a point with ObjC++ or are the advantages of C++ and ObjC redundant? Secondly : is C++ still a superset of C89 or have they diverged further?
  • Sigh (Score:4, Interesting)

    by Cafe Alpha ( 891670 ) on Tuesday March 03, 2015 @03:04AM (#49169621) Journal

    I'm not happy with any language that's available, but that's because I have interests in hard to program stuff.

    I have lots and lots of experience with C++, but I wouldn't recommend it, except as a form of torture. Java too, is gets in your way far too often, though it's better than C++.

    To me, objects are a way of organizing APIs, so I DO like OO...

    What to write it in depends on what features you need. Do you need it to be fast? How fast? Do you need to take advantage of multiple processors? Do you need to share data between them?

    Is programmer time more important than running speed?

    Is reliability more important than programming time?

    One system I'm enjoying these days, though it's far from perfect is Lua, through the amazingly good trace compiler/jit Luajit.
    It is every inefficient in terms of memory. It doesn't support multiple threads. It doesn't even have standard object system, though it's not hard to implement a prototype based one in it... But it's kind of like programming in Self or Ruby with the complexity knob turned all the way down.

    It also has the advantage of running on everything. There's even an ARM version of the JIT.

    If you don't need the speed, Python doesn't look too bad and has lots of libraries.

    If you need something that can be data-center-sized then find a .net language or java... There's a lot of choices under .net and it probably scales the best. Depending on what I was trying to do, I might use F# or ClojureCLR or IronPython...

    The best OO language that time forgot is Dylan. I'm disappointed that Apple never really finished developing it.

  • The Rust Language (Score:5, Interesting)

    by Trevelyan ( 535381 ) on Tuesday March 03, 2015 @05:38AM (#49169979)
    I have been mulling similar question for myself for some time. i.e. where should I spend my limited hobby time: learning Obj-C or C++?

    In the last few months Rust [rust-lang.org] has caught my attention. Even then it's not yet at verstion 1 (at time of writing its at alpha-1), I really like the concept and what they are try to achieve with the language.

    My comment will probably be burried, but if you do read it, spend a few minutes wondering around their web site. For exmaple their 30 minute introduction to Rust [rust-lang.org].
  • by suy ( 1908306 ) on Tuesday March 03, 2015 @01:40PM (#49173017) Homepage

    Yes, I know quite a few other languages, but I want to get into a widespread compiled language that has good ties into FOSS. Both Objective-C and C++ fit that bill.

    I know plenty of open source applications, from GUIs in Qt and gtkmm to console applications and interpreters of programming languages in C++. The backbone of any Linux distribution is C and C++.

    I know 0 packages in my Linux installation that are written in Objective-C. There are some, for sure, but are they widespread? I doubt it.

"When the going gets tough, the tough get empirical." -- Jon Carroll

Working...