This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Mackan90096's profile picture

What's best?

Started by Mackan90096, 09 June 2013 - 12:54 AM
Mackan90096 #1
Posted 09 June 2013 - 02:54 AM
What is best to program in?

Obj-C or C++ ?

I mean.. What's the difference between the two?

Which have the most features?

Why should I choose it?
Kingdaro #2
Posted 09 June 2013 - 03:17 AM
I would imagine that C++ is more commonly supported by IDEs and text editors, but I'm no expert on the subject. All I know is brackets.
Xenthera #3
Posted 09 June 2013 - 03:24 AM
In a completely biased general use opinion, Objective-C is like brushing your teeth with barbed wire. While C++ is like sleeping on the finest silk pillow, With the occasional nail through the eyeball.
GravityScore #4
Posted 09 June 2013 - 03:29 AM
Well for a start - ObjC code will only work on a Mac (or iOS if you go that route, but I don't think you can use C++ for iOS dev).

If for a GUI application (cross platform): C++ using QT Framework (google it :P/>)
For a GUI app (mac only): ObjC
For a game (cross platform): C++ using OpenGL (or SMFL)
For a game (mac only): C++ using OpenGL :P/>

ObjC is really epic - such a beautiful and nice language - and has all the features of C++ if you use Objective-C++. Not sure what basis you're going off Xenthera :P/>
C++ is better cross platform but (in my opinion) harder and not as nice/pretty as ObjC.
ElvishJerricco #5
Posted 09 June 2013 - 04:03 AM
Well for a start - ObjC code will only work on a Mac (or iOS if you go that route, but I don't think you can use C++ for iOS dev).

If for a GUI application (cross platform): C++ using QT Framework (google it :P/>/>)
For a GUI app (mac only): ObjC
For a game (cross platform): C++ using OpenGL (or SMFL)
For a game (mac only): C++ using OpenGL :P/>/>

ObjC is really epic - such a beautiful and nice language - and has all the features of C++ if you use Objective-C++. Not sure what basis you're going off Xenthera :P/>/>
C++ is better cross platform but (in my opinion) harder and not as nice/pretty as ObjC.

Just FYI, iOS does support C++.

Now, personally, I recommend learning C before either language so you can grasp the important concepts of those languages. There's so much to the theory of how computers work that you just can learn as well using any other language.

Anyway, I have a fairly simple way of summing up the differences between the two languages:
  • C++ takes the C ideals and makes them Object Oriented.
  • Objective-C takes the Object Oriented Programming ideals and makes them into C.

If you ask me, Objective-C is the nicer language. And the only reason you can't use it on other platforms is because of a lack of the standard foundation library it uses at runtime. It technically compiles just fine. And there are implementations of that library for linux. Dunno about windows though.

Objective-C follows the ideals of OOP perfectly. True OOP dictates that you don't have access to an object's data, and you don't explicitly call functions. You send messages and the object handles it how it wants. Even when you do

obj.var = something
you are sending a message instead of doing a C assignment (this is because you can create setters and getters for your object's instance variables that get called automatically when you assign). But anyway here's a page that describes some of the best parts of the language. And it's from 2008. There's been even more additions since then that are really awesome.

Not to mention Apple's libraries (most of which are for Objective-C, some of which are just C) are amazing. There does not exist a company who has built the same quantity and quality of API for anything. It's really a shame how much untapped power exists in OS X.

C++ is a different beast. As I said, it focuses more on the C side of things. There's not as good a way to be dynamic about it, but you always know what you're dealing with. If you have an object, you are certain of what methods it has and what they will return. That's why it's more C like than ObjC is.

The syntax is almost identical to Java, which is very similar to C already. And of course C++ has its own libraries that are pretty cool.

But yea… Objective-C makes me a happy coder.