Jener Posted June 18, 2007 Share Posted June 18, 2007 I wonder why Apple chose Objective-C as Mac OS default programming language. The syntax is difficult to read, it just seems a mess. #import <Foundation/NSObject.h> @interface Fraction: NSObject { int numerator; int denominator; } -(void) print; -(void) setNumerator: (int) d; -(void) setDenominator: (int) d; -(int) numerator; -(int) denominator; @end I wish Apple had selected something more mainstream like C++. The following C++, I think, is way more ellegant and easier to read. #include <Foundation/NSObject.h> class Fraction : NSObject { int numerator; int denominator; void print(); void setNumerator(int d); void setDenominator(int d); } Link to comment https://www.insanelymac.com/forum/topic/54330-objective-c-what-an-awful-programming-language/ Share on other sites More sharing options...
Colonel Posted June 18, 2007 Share Posted June 18, 2007 It was originally developed in the 80's. Give it a break. Link to comment https://www.insanelymac.com/forum/topic/54330-objective-c-what-an-awful-programming-language/#findComment-388575 Share on other sites More sharing options...
Headrush69 Posted June 18, 2007 Share Posted June 18, 2007 I would hardly say it is a mess, especially using the examples you showed. (pretty minor differences) I'm sure if it's widespread use preceded C++, people would be saying the opposite. I'll admit it took a little bit to get use to, but after using it a while its no big deal. The separation of variable types using () can be helpful. Some C++ code is god awful and poorly documented and this syntax can help to quickly spot elements rather then needing to look at the code in more detail. But to each his own. Link to comment https://www.insanelymac.com/forum/topic/54330-objective-c-what-an-awful-programming-language/#findComment-388586 Share on other sites More sharing options...
NeSuKuN Posted June 18, 2007 Share Posted June 18, 2007 I wish Apple had selected something more mainstream like C++.The following C++, I think, is way more ellegant and easier to read. And exactly what stops you from using it? :/ Just use what you like and suits your needs, criticizing isn't necessary it's just a matter of preferences. Link to comment https://www.insanelymac.com/forum/topic/54330-objective-c-what-an-awful-programming-language/#findComment-388633 Share on other sites More sharing options...
bxsci(macuser) Posted June 18, 2007 Share Posted June 18, 2007 the objective C looks more organized to me Link to comment https://www.insanelymac.com/forum/topic/54330-objective-c-what-an-awful-programming-language/#findComment-388690 Share on other sites More sharing options...
AWhiteFlame Posted June 18, 2007 Share Posted June 18, 2007 I have to agree with you. Objective-C hurts my eyes. Link to comment https://www.insanelymac.com/forum/topic/54330-objective-c-what-an-awful-programming-language/#findComment-388806 Share on other sites More sharing options...
Sabr Posted June 19, 2007 Share Posted June 19, 2007 Yeah, I think, from those two extracts, that C++ looks much easier and neater. However, it is just personal preference at the end of the day. : - Sb. Link to comment https://www.insanelymac.com/forum/topic/54330-objective-c-what-an-awful-programming-language/#findComment-388962 Share on other sites More sharing options...
bwhsh8r Posted June 19, 2007 Share Posted June 19, 2007 c isnt bad... i had to teach myself it for robotics team (i decided not to join...) but uh, c++ is just an extention of c, so really there arnt that many differences..... just minor {censored}..... but why does it matter, you can get stuff done in c, and im sure if you wanted to you could program and comple in c++? Link to comment https://www.insanelymac.com/forum/topic/54330-objective-c-what-an-awful-programming-language/#findComment-388986 Share on other sites More sharing options...
U.C. Posted June 19, 2007 Share Posted June 19, 2007 C++ can be used as C, with just a few differences. But the main benefit of C++ is constructors, destructors, functions, public private datatypes, and other Object Oriented concepts...........which I dont understand, but still. I guess they are useful Link to comment https://www.insanelymac.com/forum/topic/54330-objective-c-what-an-awful-programming-language/#findComment-389122 Share on other sites More sharing options...
hecker Posted June 19, 2007 Share Posted June 19, 2007 No such thing as a bad programming language. Only bad programmers hecker Link to comment https://www.insanelymac.com/forum/topic/54330-objective-c-what-an-awful-programming-language/#findComment-389295 Share on other sites More sharing options...
Dainix Posted June 19, 2007 Share Posted June 19, 2007 You can always change the language to C++ in XCode. Nothing's stopping you there. Link to comment https://www.insanelymac.com/forum/topic/54330-objective-c-what-an-awful-programming-language/#findComment-389333 Share on other sites More sharing options...
HotBreeze Posted June 19, 2007 Share Posted June 19, 2007 I'm wondering some Parallel port control with Objective C - Cocoa app. with XCode but I can use the same headers that I use with borland TurboC (stdio.h, conio.h, iostream.h and others). Anyone can tell me how I do to control Parallel port with XCode... The commands that I used before was: main(){ printf("Opening Gate 1") outportb(0x378, 1) /* This will activate the pin 2 - that connected to a circuit, can activate a light */ } and now... what I do... I think that conio.h in MacOS X doesnt exists, because it are used to CONsole. Thanks in advance. Link to comment https://www.insanelymac.com/forum/topic/54330-objective-c-what-an-awful-programming-language/#findComment-389350 Share on other sites More sharing options...
Guest Ramm Posted July 15, 2007 Share Posted July 15, 2007 If conio.h didn't exist, Xcode would return an error. Link to comment https://www.insanelymac.com/forum/topic/54330-objective-c-what-an-awful-programming-language/#findComment-408361 Share on other sites More sharing options...
rezwits Posted August 1, 2007 Share Posted August 1, 2007 The thing with objective-c (cocoa) is you look at the source code of an example and see like 15 lines of code and viola you got a text edit application... and you're like but how does it get all that from that code, where's the "real code", that's my problem with it... Link to comment https://www.insanelymac.com/forum/topic/54330-objective-c-what-an-awful-programming-language/#findComment-418915 Share on other sites More sharing options...
Headrush69 Posted August 1, 2007 Share Posted August 1, 2007 The thing with objective-c (cocoa) is you look at the source code of an example and see like 15 lines of code and viola you got a text edit application... and you're like but how does it get all that from that code, where's the "real code", that's my problem with it... That's not because of Objective-C, its because of the API it is used with. You could have the same thing using C++ with Qt, or C with GTK, you name it. Link to comment https://www.insanelymac.com/forum/topic/54330-objective-c-what-an-awful-programming-language/#findComment-418928 Share on other sites More sharing options...
NeSuKuN Posted August 2, 2007 Share Posted August 2, 2007 Objective-C != Cocoa Link to comment https://www.insanelymac.com/forum/topic/54330-objective-c-what-an-awful-programming-language/#findComment-419129 Share on other sites More sharing options...
Headrush69 Posted August 4, 2007 Share Posted August 4, 2007 Objective-C != Cocoa Who said it was, not me. Link to comment https://www.insanelymac.com/forum/topic/54330-objective-c-what-an-awful-programming-language/#findComment-420538 Share on other sites More sharing options...
rezwits Posted August 18, 2007 Share Posted August 18, 2007 Cocoa is Objective-C but Objective-C is not Cocoa, there, Coca-Cola is Caffeine but Caffeine is not Coca-Cola, there that should be clearer... Carbon is C, but C is not Carbon, logically fit now? Link to comment https://www.insanelymac.com/forum/topic/54330-objective-c-what-an-awful-programming-language/#findComment-430400 Share on other sites More sharing options...
Headrush69 Posted August 18, 2007 Share Posted August 18, 2007 Cocoa is Objective-C but Objective-C is not Cocoa, there, Coca-Cola is Caffeine but Caffeine is not Coca-Cola, there that should be clearer... Carbon is C, but C is not Carbon, logically fit now? Actually Cocoa is not Objective-C. Cocoa is an API not a programming language Although Cocoa was written in Objective-C, user programs can access the API with languages like Python, Perl, Ruby with the aid of bridging mechanisms such as PyObjC, CamelBones and RubyCocoa, respectively P.S. Coca-Cola has caffeine, not is caffeine. Link to comment https://www.insanelymac.com/forum/topic/54330-objective-c-what-an-awful-programming-language/#findComment-430463 Share on other sites More sharing options...
bofors Posted August 19, 2007 Share Posted August 19, 2007 It was originally developed in the 80's. Give it a break. Two points: (1) Anyone says Obj-C is a simply "awful" programming language does not understand the beauty of its simplicity nor its runtime machine. (2) Apple is making improvements to Obc-C with version 2.0 in Leopard (OS X 10.5). Link to comment https://www.insanelymac.com/forum/topic/54330-objective-c-what-an-awful-programming-language/#findComment-430815 Share on other sites More sharing options...
rezwits Posted August 20, 2007 Share Posted August 20, 2007 Here's one Cookie is Chocolate Chip, Chocolate Chip is not Cookie Where do you stand on the word "is", are "is" and "=" equivalent to you? They are similar but depending on how you use "is" they can be miles apart... this is fun LOGIC yea... Link to comment https://www.insanelymac.com/forum/topic/54330-objective-c-what-an-awful-programming-language/#findComment-431358 Share on other sites More sharing options...
Headrush69 Posted August 20, 2007 Share Posted August 20, 2007 Where do you stand on the word "is", are "is" and "=" equivalent to you? They are similar but depending on how you use "is" they can be miles apart... I know where you are going with this, but for the sake of this comparison, (Objective-C & Cocoa), it is a poor description for people new to programming. It makes it sound like the same relationship as: C++ is C, but C is not C++. A superset, while they are actually completely different. Two points: (1) Anyone says Obj-C is a simply "awful" programming language does not understand the beauty of its simplicity nor its runtime machine. (2) Apple is making improvements to Obc-C with version 2.0 in Leopard (OS X 10.5). True. Learning a new programming language you are always 'tainted' since you're used to something else. Coming from C/C++ it surely looks different but after a while you appreciate it. Can't wait for Xcode 3 and the Objective-C changes. Guess one of the big ones is automatic garbage collection. (Although never a problem in my code. ) Link to comment https://www.insanelymac.com/forum/topic/54330-objective-c-what-an-awful-programming-language/#findComment-431463 Share on other sites More sharing options...
bofors Posted August 20, 2007 Share Posted August 20, 2007 True. Learning a new programming language you are always 'tainted' since you're used to something else. Coming from C/C++ it surely looks different but after a while you appreciate it. I came to Cocoa from Java, but I have no problems accepting Obj-C, it is very simple. The Cocoa frameworks however take a total different approach to application building than Java. Guess one of the big ones is automatic garbage collection. One of the big plusses of Cocoa, is that once you learn the frameworks, you can build applcations very quickly. Garbage collection and other improvement in Obj-C 2.0 will make it even faster. Link to comment https://www.insanelymac.com/forum/topic/54330-objective-c-what-an-awful-programming-language/#findComment-431603 Share on other sites More sharing options...
rezwits Posted August 20, 2007 Share Posted August 20, 2007 Does anyone know if Xcode 3.0 will work with 10.4.x. I am assuming NO. 10.5.x+ only... Link to comment https://www.insanelymac.com/forum/topic/54330-objective-c-what-an-awful-programming-language/#findComment-431679 Share on other sites More sharing options...
bofors Posted August 20, 2007 Share Posted August 20, 2007 Does anyone know if Xcode 3.0 will work with 10.4.x. No, XCode 3.0 was rewritten in Obj-C 2.0 so you will need 10.5 to run it. Link to comment https://www.insanelymac.com/forum/topic/54330-objective-c-what-an-awful-programming-language/#findComment-431714 Share on other sites More sharing options...
Recommended Posts