The best starting language for mac...?

Nibbie
Posts: 4
Joined: 2010.02
Post: #1
Let me start by saying that my ultimate goal it to program a simple iPhone app/game...

With that said, i've done some research on different programming languages and whatnot, but this is all very new to me. The only experience I have is about 70 pages into "C++ for dummies". My question is as a mac user, what language is best to start with?

I started this C++ book, but now I'm having doubts as to how relevant its going to be for mac > Objective C > Cocoa (which as far as I know is the order it should go). I've hear (or read) C might be better to start with or maybe even Java.

Any advice would be greatly appreciated, thanks.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #2
For the iPhone, C, C++ and Objective-C are the easiest to use. Java is nearly impossible.

You will need to know some Objective-C for a game, and lots for an app.

I personally think that C++ is a horrible language. Certainly it's incredibly complex, which makes learning it quite tricky compared to the other two languages. I therefore recommend starting with C or Objective C, whichever you can find the best resources for. Objective-C is a superset of C, so every bit of C you learn is directly applicable to Objective-C.
Quote this message in a reply
Member
Posts: 26
Joined: 2010.01
Post: #3
If you have no previous programming experience, this is going to be a significant amount of work and learning. Sorry to be the bearer of bad news Wink

I'd suggest starting with C, as it's simpler than either Objective-C or C++ but still compatible. Then the only real way to get the skills needed is to write code, and then write some more, any old projects until you get the hang of it. And read as much about code architecture and game tech on top as you can manage, but that's secondary. I'm not trying to put you off, but realistically I'd say that if you are smart enough (say some kind of scientific uni background), motivated, and organised, it may be possible to get to the point where you can write a small game in about six to nine months full-time.

It has to be said that these days there are easier options for people wanting to try from a cold start, such as writing a website game in Flash, which requires a lot less technical programming knowledge.

Good luck!
Quote this message in a reply
Member
Posts: 65
Joined: 2009.01
Post: #4
As one who teaches this stuff, I would say that C++ is NOT a good first choice. And certainly not a "for Dummies" book, since you can't dumb down C++ significantly.
Assuming you are an adult learner, I would recommend spending some time learning about programming first. Cocoa for Mac OS X would be a better place to start than the iPhone, due to certain things being easier there, and you would be able to transfer those skills to the iPhone later.
In fact, it doesn't really matter what language you're using in the beginning - you need to learn programming basics like what a framework/library is, what the compiler does, how to write an expression, why we use data types, how to call a function, how to use pointers and arrays, and how to use conditionals and looping. These are the fundamentals of computer programming.
From there you probably could tackle C and Objective-C concurrently, since they are closely related (though you could never tell that just by looking at them. Though not for beginners, Kernighan and Ritchie is pretty easy to read. For Objective-C resources you could subscribe to Safari Online and check out the books online there.
Quote this message in a reply
Member
Posts: 260
Joined: 2005.05
Post: #5
I question whether iPhone is a good point to start programming. Objective-C is a very strange breed, mixing two languages into one and the result is confusing.

I have already written about my language preferences so I won't bore you with that. But it could be interesting to hear johncmurphy's opinion on what the ideal beginner language would be.

Kerome's comment "it may be possible to get to the point where you can write a small game in about six to nine months full-time" means that things have definitely not gotten better over time. Where is the easy start? It shouldn't be that hard to write a small game! Way back, I wrote a "Snake" game for every computer I could find. It usually took an hour or two, from the moment I got the API documentation. (I did that on the Mac too, took a bit longer but not more than a few days. Maybe two days.) And when I learned programming, I wrote my very first playable game the first day! (It wasn't great but it worked.) Isn't that an interesting comparison?
Quote this message in a reply
Member
Posts: 65
Joined: 2009.01
Post: #6
Ingemar Wrote:it could be interesting to hear johncmurphy's opinion on what the ideal beginner language would be.
Unfortunately, I don't think there is one.
Here in the United States, Java seems to be the most popular as a first language in Computer Science curricula. C++ is also (surprisingly) often used. In fact, at my local engineering college (Stevens in NJ) they make the music majors take a course in C++!Shock
The problem with the teaching of computer science does not seem to be in which is the best language to teach, but with the overall curriculum itself. I am a professor of medicine (who teaches computer programming on the side.) Teachers of medicine have thousands of years worth of teaching that they can look at to get an idea of how to teach. Computer science is a relatively young field, and since licensing is not mandatory, standard curricula don't exist yet.
Think about how so many of us learned. We had some programming task that we wanted or needed to get done, which forced us to learn just enough to get it to work. After that, we gradually picked up stuff along the way. Maybe be read the K&R. Most of us who tried to read a textbook on programming ended up not finishing it, usually because it was not relevant to what we wanted to learn. For example, Donald Knuth's The Art of Computer Programming, which begins the Arabic origin of the word "algorithm", next goes into some complex mathematics, and then into the basics of assembly language. On pg 186 he finally begins discussing programming fundamentals with a discussion of subroutines in assembly language. It's a wonder any of us learned to program!
So to answer your question, I think C is as good as any language to learn first, though Java is not a bad choice either.
Quote this message in a reply
Member
Posts: 26
Joined: 2010.01
Post: #7
Well, it does all depend on context. When I was 13 I wrote a (slightly broken) Space Invaders clone in a few weekly computing classes using basic on an Apple II while knowing literally nothing about computers. Back then the bar was a lot lower - you had low-res screens, no sound to speak of, and desktop multiprocessing was a dim glint in a chip designer's eye. You could do things like write directly to the backbuffer which was at a fixed location in memory. But nowadays, people expect textured, lit 3D models, proper shadows, whizzy particle effects, stereo sound with streaming background music, and sophisticated UI's.

The problem is, current programming models are aimed at these new requirements. Learning some OpenGL, maybe the audio parts of iPhone OS, maybe some shaders, file streaming, the ins and outs of collision detection and some bits about physics engines not only requires good general coding skills but also a significant amount of maths, algorithms, and the basics of data pipelines. Even for a sprite-based game like Castle Crashers or Pocket God that is close to the minimum. Learning it all just doesn't happen overnight. Then getting to the point where you can publish, rather than have a tech demo, is another step.

So yes, I'd say it hasn't become simpler at all. It may be easier to build big software with C++ and modern API's and patterns than it was with basic or pascal, but the technologies you use are more complex too. There are shortcuts - something like Unity can take a major part of the strain, since you end up doing more scripting than engine programming, there's GLUT, and there are game toolkits out there for Windows at least. But going the bottom-up route with complete control over the source is definitely the toughest route. Even using another's engine like Oolong is a double-edged sword if you don't already possess the coding skills to have built it yourself.

So choose your tech base wisely Wink As an ideal starting language out of everything out there, I'd go with C# right now. Modern concepts without a lot of the hassle of C++. Or perhaps Python, for ease of use, though it not being strongly-typed causes me some misgivings.
Quote this message in a reply
Moderator
Posts: 3,577
Joined: 2003.06
Post: #8
BumPer Wrote:Let me start by saying that my ultimate goal it to program a simple iPhone app/game...

Echoing advice already found in this thread: If iPhone is your intention, then it'd be best to start with C and later learn a little Objective-C (or possibly concurrently if you can handle that). For a game, you'll only need to know enough Objective-C to communicate with the operating system for basic needs. One thing you will probably also need to learn is OpenGL. You can start learning that on the Mac, using GLUT, as soon as you learn C.

This is no small task for anyone. You might consider checking out unity3d.com first and see if that might work for you instead. It's for 3D games, but I'd say it'd be a heckuva lot easier than doing it the C/Obj-C/OpenGL way yourself!

Kerome Wrote:It's easier to build big software with C++ and modern API's and patterns than it was in basic or pascal...

I disagree with the very last part: Pascal was much easier to make complex software with than C++ has ever been for me! Rasp

But yeah, programming is definitely much more difficult nowadays as a whole than it ever has been. A lot of that obviously has to do with the complexity of the systems being supported. I'm glad I don't have to write a 3D rasterizer!
Quote this message in a reply
Member
Posts: 749
Joined: 2003.01
Post: #9
C is a relatively simple language (though doing some things one would consider "basic" turns out to be pretty hard for a beginner (and tedious for the rest), like making resizeable arrays, manipulating strings etc.)

Practically speaking, the libraries needed to write a game in C are bloody hard for a beginner.

And when you are struggling to understand what programming actually is, the learning curve is going to be a bloody wall.

I suggest using a TOOL (i.e. easy language+easy integrated libraries for games) like processing ( http://processing.org/ ) to understand how programming (and game programming) works and make sure you can apply your knowledge by making a simple game before you go into the world of C game programming.

Personally it took me more than a year to get my skin tough enough for C game programming, I'm sure some people started straight with C but I bet most programmers started with something easier.


It would be cool to have a follow up to these posts, to see how many people end up learning to program and how many get lost in the way.

©h€ck øut µy stuƒƒ åt ragdollsoft.com
New game in development Rubber Ninjas - Mac Games Downloads
Quote this message in a reply
Member
Posts: 194
Joined: 2009.02
Post: #10
First put the idea of programming on the iphone on hold for just a little while, hell just provisioning the device is almost as difficult as learning to programWink

Learn C, this is will be the hardest part and will probably take a at least a month. Aside from getting a good book on C, download source code examples and try to work out what's going on in the code on your own.

When C clicks for you, learn just enough cocoa so that you know how to setup a cocoa application, this shouldn't be too difficult.

Then start immediately learning opengl, you'll use opengl for everything graphics related from drawing 2d sprites to rendering 3d scenes.

At this point feel free to start programming on your iphone.

Keep realistic goals, this will help carry you through all of the frustration that's likely to come about when first learning. Oh and don't try to program a 3d mmorpg as your first game, a lot of people seem to go this route.
Quote this message in a reply
Member
Posts: 260
Joined: 2005.05
Post: #11
johncmurphy Wrote:Unfortunately, I don't think there is one.
Here in the United States, Java seems to be the most popular as a first language in Computer Science curricula. C++ is also (surprisingly) often used.
Interesting, and I agree with you. I find both Java and C++ downright awful as starting languages. They are simply too complex to start with.

I read the introduction on a Java book used in high school. The very first "simple" example is only partially explained, since there is so much that has to be handled later (like subclassing). That is not a good sign. And a result is that many students get scared of programming and choose scripting languages just to get away from the complex "real programming" languages, or draw the conclusion that they should avoid programming altogether.

In my computer graphics course, we use plain C. It is far from perfect, but much, much better than Java, which I used in the past.
Quote this message in a reply
Moderator
Posts: 1,140
Joined: 2005.07
Post: #12
I agree that starting with C is probably the best way to go. That way you can begin learning the basics about variables, flow of control, functions, pointers etc. Those basics will help you in just about any language. After that, if you wish to focus on the Mac and iPhone, you'll probably want to move to ObjectiveC.

C++ does get a lot of flack, and not without reason, but it does still have a place. If you want to write a large performance-critical application, especially if you want it to be multi-platform, it can still be a good choice. For example, the game industry is still primarily C++, as are a lot of other real-time systems. I wouldn't recommend it to a beginner, though, because in order to use it effectively requires good discipline and general knowledge about programming. Though very powerful, it is also very easy to screw yourself over with it.
Quote this message in a reply
Moderator
Posts: 3,577
Joined: 2003.06
Post: #13
akb825 Wrote:C++ does get a lot of flack, and not without reason, but it does still have a place. If you want to write a large performance-critical application, especially if you want it to be multi-platform, it can still be a good choice. ...

A counter example to it being a "good choice": the FBX API/SDK Rasp

Only poking fun. Bad software can be written in any language.

[off-topic] I had a dream last night (more like a nightmare) that I wound up taking a test in C++ for a job interview. The other interviewees were finished in twenty minutes, but it took me three hours and everyone was mad at me for holding up the show. The only solution that actually worked was mine, but I didn't get the job because I took too long. The other job candidates all got hired because they played along with the corporate culture, even though they cranked out sloppy code that didn't work! LOL
Quote this message in a reply
Moderator
Posts: 1,140
Joined: 2005.07
Post: #14
AnotherJake Wrote:A counter example to it being a "good choice": the FBX API/SDK Rasp

Only poking fun. Bad software can be written in any language.

[off-topic] I had a dream last night (more like a nightmare) that I wound up taking a test in C++ for a job interview. The other interviewees were finished in twenty minutes, but it took me three hours and everyone was mad at me for holding up the show. The only solution that actually worked was mine, but I didn't get the job because I took too long. The other job candidates all got hired because they played along with the corporate culture, even though they cranked out sloppy code that didn't work! LOL
Like I said, it requires good discipline and general knowledge about programming. Many developers don't have that. Rasp Of course, knowing that only a subset of developers who know C++ will not be dangerous is definitely a deterrent, but there are some applications where there's few viable choices.

Oh, and we had to integrate FBX support in our tool at work. I've heard some horror stories from the guy it integrated it: memory leaks everywhere, features that don't work, lack of instancing etc.
Quote this message in a reply
Founder
Posts: 1,138
Joined: 2002.04
Post: #15
Ingemar,
No mention of Pascal? I'm saddened!

Carlos A. Camacho,
Founder
iDevGames
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Hello, starting first project, looking for advice in language and tools aqua_scummm 15 7,578 Jan 31, 2008 06:39 AM
Last Post: ynda20