![]() |
| | #1 |
| Registered User Join Date: Oct 2008
Posts: 77
| Advice on next steps - shifting to OOP There are some clear advantages to going down the objC route (such as it is native language and the mac system is set up for this language), but I also see some problems. e.g. ObjC doesn't seem to have the same (excellent) support from communities such as this, fewer tutorials and the learning curve looks extremely steep from the articles I have seen (I have Aaron Hildegras book). C++ on the other hand has more support and looks less complex to get started with, but is not the native mac language as far as I can tell. My options I think are: a) Stick it out with C because it can ultimately do everything that other languages can do b) Start learning an OOP language i) Go for C++ and then (possibly) graduate to ObjC ii) Go straight for ObjC c) Have a cup of tea I'd appreciate any thoughts on this. In meantime, back to C I think... |
| officedog is offline | |
| | #2 | |
| Super Moderator Join Date: Aug 2001
Posts: 7,819
| Quote:
Object oriented principles are not about this language or that language. That comes down to a matter of semantics on how to implement this or that OOP pattern in the language. The principles remain the same. I would recommend reading up on design patterns in general and would not focus on any certain language. A book on UML would also be a good read. Then once you understand the concepts you can choose which language you want to employ those concepts in.
__________________ If you aim at everything you will hit something but you won't know what it is. | |
| Bubba is offline | |
| | #3 | |
| Cat without Hat Join Date: Apr 2003
Posts: 8,492
| Quote:
Now, I've never actually used ObjC, not having a mac, so the following opinion is based on just a few tutorials and may be extremely unfairly prejudiced, but I think Objective-C is an absurd language. It's C, with some weakly typed, extremely foreign syntax tacked on to support object-orientation that's somewhere between Smalltalk and stricter OO languages.
__________________ All the buzzt! CornedBee"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code." - Flon's Law | |
| CornedBee is offline | |
| | #4 |
| Registered User Join Date: Oct 2008
Posts: 77
| Thanks for suggestions Bubba. Had a look at UML - I'll have to think more on this, I can see it's useful for organising/structuring the overall program. I suppose the basic issue I face at the moment is that with some earlier help here I've started trying to implement an "oop" style using C structs and function pointers. It's great, it works, but what a lot of typing... leading me to this question! And thanks CornedBee - your comments mirror my thoughts about the learning curve. Makes me think I may be best sticking with C for now and return to this question later. |
| officedog is offline | |
| | #5 | ||||
| Mysterious C++ User Join Date: Oct 2007
Posts: 14,785
| Quote:
Quote:
Quote:
![]() But honestly, if you are going to be writing anything like computer software or games, then you really should use a modern language. C is not a modern language, nor is ObjC. The preferred language for games is C++ mainly due to its speed and its modern features that can even give modern languages a real challenge. C is good for embedded projects where requirements aren't high, but for other projects, I would really recommend a moder modern language.
__________________ Using: Microsoft Windows™ 7 Professional (x64), Microsoft Visual Studio™ 2008 Team System I dedicated my life to helping others. This is only a small sample of what they said: "Thanks Elysia. You're a programming master! How the hell do you know every thing?" Quoted... at least once. Quote:
| ||||
| Elysia is offline | |
| | #6 |
| Woof, woof! Join Date: Mar 2007 Location: Australia
Posts: 3,297
| > No, it cannot. It's very weak in that area. Sure it can. Just that more and more 3rd party libraries seem to be moving to OO, and hence C++. I'd say go for C++, but still keep knowledge and use of C. You never know! I don't know what a modern language is!? But C is procedural, the idea of OOP is (fairly) modern. C and C++ are (very) roughly from the same era. If you want truly modern, then you should be looking at something a bit more managed. Choose the tool for the job, that doesn't mean the newest tool in the shop either. I see no problem with maintaining 2 or more types of programming paradigms being procedural and object orientated. It could even make you more employable! I myself know very little C++ (being syntax and keywords -- but I do have a "good" understanding of OOP), instead I doodle with C and Java. I do plan to make more use of C++ once I have a fairly large C project completed. That way I'll have something to show on my resume :-) > The preferred language for games is C++ Careful! The big troll is pushing C# something wicked. PS: UML is wonderful, defiantly worth the effort. Although it does suffer from a few flaws. Did you end up trying GLFW officedog? |
| zacs7 is online now | |
| | #7 | ||
| Mysterious C++ User Join Date: Oct 2007
Posts: 14,785
| Quote:
No classes, hence no RAII, smart pointers, etc. No template support - so no type-safe or powerful ways of creating generic code, etc. Libraries can always be found, of course...
__________________ Using: Microsoft Windows™ 7 Professional (x64), Microsoft Visual Studio™ 2008 Team System I dedicated my life to helping others. This is only a small sample of what they said: "Thanks Elysia. You're a programming master! How the hell do you know every thing?" Quoted... at least once. Quote:
| ||
| Elysia is offline | |
| | #8 |
| The Right Honourable Join Date: Mar 2004 Location: Where circles begin.
Posts: 1,068
| Personally, I would learn C++, and use Obj-C++ for any Cocoa/GUI stuff (unless you insist on using Carbon). The syntax (among other things) is a little weird at first, but I didn't find it to hard to pick up on. Pretty much like learning any other language. EDIT: Post #1000!
__________________ Memorial University of Newfoundland Computer Science Mac and OpenGL evangelist. |
| psychopath is offline | |
| | #9 | |
| Reverse Engineer Join Date: Aug 2005 Location: Estonia
Posts: 2,260
| Quote:
To OP - you should definitely learn C++ since it's the most widely used portable programming language.
__________________ The duck is irrelevant to my point. Last edited by maxorator; 11-28-2008 at 10:27 AM. | |
| maxorator is offline | |
| | #10 |
| Registered User Join Date: Oct 2008
Posts: 77
| hi zacs7 - thanks for comments on this. Sadly I was unable to get GLFW working on the system and was too wrapped up with the GUI project to tackle how to get it loaded up. So... GLUT is still the thing I know. I'll have to sort this out soon as it looked very nice. I might just experiment with one of the GUI libraries provided automatically within the apple's developer package and see where that goes. psychopath - thanks for that reassuring comment. I think the problem I had was that objC is so closely linked up with all the NSObjects and wotnot and also trying to figure out how to work with XCode - I had difficulty breaking the learning into simpler steps. In the end I came back to creating simple command line "standard tool" programs in C and built up openGL on top of that - which has been very successful so far. I guess your solution might be one to keep in mind for later if I want to work off the foundation and appkit libraries, but I'll need a little more learning before I get there. Thanks Elysia for sharing your thoughts. Just out of curiosity, what counts as a 'modern' language. Are you talking about Ruby or python or.... ? I'm definitely going to get on with C++ now, so it was as I said, just out of curiosity. Maxorator - thanks for the clear advice. Well thank you everyone for sharing your thoughts - very helpful in shaping up a plan. I decided in the end to get out my C++ notes from the tutorials here and am currently trying to go quickly through Bruce Eckell's book. |
| officedog is offline | |
| | #11 | ||
| Mysterious C++ User Join Date: Oct 2007
Posts: 14,785
| Quote:
Not very knowledgeable about languages.
__________________ Using: Microsoft Windows™ 7 Professional (x64), Microsoft Visual Studio™ 2008 Team System I dedicated my life to helping others. This is only a small sample of what they said: "Thanks Elysia. You're a programming master! How the hell do you know every thing?" Quoted... at least once. Quote:
| ||
| Elysia is offline | |
| | #12 | |
| C++ Witch Join Date: Oct 2003 Location: Singapore
Posts: 11,372
| Quote:
__________________ C + C++ Compiler: MinGW port of GCC Build + Version Control System: SCons + Bazaar Look up a C/C++ Reference and learn How To Ask Questions The Smart Way | |
| laserlight is offline | |
| | #13 | |
| Mysterious C++ User Join Date: Oct 2007
Posts: 14,785
| Features and ease to develop modern applications. And as far as I'm concerned, Obj-C is just a rip-off of C that we could do well without. If you need object oriented and C, I would choose C++. But I'm known to be biased.
__________________ Using: Microsoft Windows™ 7 Professional (x64), Microsoft Visual Studio™ 2008 Team System I dedicated my life to helping others. This is only a small sample of what they said: "Thanks Elysia. You're a programming master! How the hell do you know every thing?" Quoted... at least once. Quote:
| |
| Elysia is offline | |
| | #14 | |
| MENTAL DETECTOR Join Date: Apr 2006 Location: United States
Posts: 3,295
| Quote:
__________________ <Niggawatts> Writing is both mechanical and organic <Niggawatts> It's like a cyborg dragon. <Niggawatts> Writing is like a cyborg dragon. | |
| whiteflags is offline | |
| | #15 | |
| Super Moderator Join Date: Aug 2001
Posts: 7,819
| Quote:
C# is a great language and very useful albeit I feel Microsoft is pushing it for something it really was not designed for just to keep it relevant. I believe it's relevance comes in the fact that it is so simple to create GUI apps and the idea of no headers which I must say I do enjoy. I could be wrong but with games even pushing the speed envelope using C++ I seriously doubt any company is going to risk using a completely different language. Mainly because I don't see what it brings to the table that C++ does not and most of the game engines at companies are already in C/C++ so migrating to C# would be a pain. I've also noticed that most of Microsoft's so-called C++ code look strangely like C programs. If you look at the DXUT you will see one file has over 6000 lines in it. Does not look like C++ to me. So we have a company that does not appear to push good object oriented code pushing some new object oriented language? Makes me feel all warm and fuzzy inside. Microsoft is masterful at C but not with C++. Most of their programmers are probably hard-core C programmers and you can tell it when you look at their supposed C++ code.
__________________ If you aim at everything you will hit something but you won't know what it is. Last edited by Bubba; 11-28-2008 at 12:28 PM. | |
| Bubba is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| OOP flu | Hussain Hani | General Discussions | 15 | 06-27-2009 02:02 AM |
| Data Mapping and Moving Relationships | Mario F. | Tech Board | 7 | 12-14-2006 10:32 AM |
| Logical errors with seach function | Taka | C Programming | 4 | 09-18-2006 05:20 AM |
| recommendation for a good OOP book | Mario F. | C++ Programming | 2 | 06-15-2006 04:28 PM |
| Folding@Home Cboard team? | jverkoey | General Discussions | 398 | 10-11-2005 08:44 AM |