Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

redking31591

macrumors 6502
Original poster
Jul 10, 2008
393
62
I needed a summer project and I decided to learn my very first computer language. I picked up a teach yourself C++ book at the bookstore. Was this a bad move should I have learned something else first or was this a good move just to dip my toes into writing programs? I have no aspirations to be a dev I just wanted something new to do and maybe help me with college math. Of course I have a mac. Would it have been better to have started with C or Objective-C or was this a good jumping off point?
 

chrono1081

macrumors G3
Jan 26, 2008
8,453
4,159
Isla Nublar
C++ is generally seen as not the best choice for a beginner. Reason being is it takes a long time to be able to do anything useful and there are a million pitfalls along the way. Programming can get discouraging if you can't see results in the beginning.

Also it depends what you want to learn to program as well (games, etc). Python is great for a beginner. Java is good for beginners as well.
 

lazydog

macrumors 6502a
Sep 3, 2005
709
6
Cramlington, UK
If you're interested in maths then you might find something like Maple or Mahematica more rewarding and useful. Both of these have their own programming language too.

b en
 

redking31591

macrumors 6502
Original poster
Jul 10, 2008
393
62
So would I be okay to start with say Python and then move on to C++? I have maybe a future goal of iphone development but I am in no hurry to get there. I just kind of want to know how programs work. So would this be a good route
Python/Java to C++ to Objective-C to Cocoa? I just don't want the book I bought for $35 to go to waste. Also what would be the best language to first learn on windows xp. My younger brother wants to learn some language but he uses windows.
 

miles01110

macrumors Core
Jul 24, 2006
19,260
36
The Ivory Tower (I'm not coming down)
So would I be okay to start with say Python and then move on to C++? I have maybe a future goal of iphone development but I am in no hurry to get there. I just kind of want to know how programs work. So would this be a good route
Python/Java to C++ to Objective-C to Cocoa? I just don't want the book I bought for $35 to go to waste. Also what would be the best language to first learn on windows xp. My younger brother wants to learn some language but he uses windows.

That would work. Generally languages fall into one of two broad categories: compiled and scripting languages. Compiled languages like C, C++, etc tend to be more "powerful" and robust, but scripting languages (perl, tcl, etc) are, in my opinion, more intuitive when you're first starting out.

The more important thing is to learn the general structure of programs and the methodology. Once you've got that down it's just a matter of adjusting syntax to fit whatever language you're working in.
 

redking31591

macrumors 6502
Original poster
Jul 10, 2008
393
62
That sounds good. while I said I don't want to be a full blown dev, i don't plan to quit at the end of the summer and I plan to continue this through college and on for fun maybe write a few basic programs. thats why I want to learn cocoa since thats a primary language for macs. I also figured since Cocoa is based on objective-c that learning C++ before objective-c would be easier since I have read they have similarities but that c++ is easier but that it isn't hard to jump from c++ to objective c
 

Eldritch

macrumors newbie
May 2, 2009
8
0
Personally, I would go straight to Objective-C and then to C++. I found that I got a much better grasp of OOP this way than the other way around.
 

cromwell64

macrumors regular
Jun 30, 2008
160
0
That sounds good. while I said I don't want to be a full blown dev, i don't plan to quit at the end of the summer and I plan to continue this through college and on for fun maybe write a few basic programs. thats why I want to learn cocoa since thats a primary language for macs. I also figured since Cocoa is based on objective-c that learning C++ before objective-c would be easier since I have read they have similarities but that c++ is easier but that it isn't hard to jump from c++ to objective c

There are certainly similarities between the two, but I would recommend just going straight into objective-c, especially if you would like to eventually create a few iphone or mac apps.

Once you learn one programming language, picking up others is usually fairly easy. If you are starting with C++ and then move to Objective-C, some of the object oriented syntax might look strange or seem hard to grasp at first, even though most of the syntax is pretty similar.
 

redking31591

macrumors 6502
Original poster
Jul 10, 2008
393
62
There are certainly similarities between the two, but I would recommend just going straight into objective-c, especially if you would like to eventually create a few iphone or mac apps.

Once you learn one programming language, picking up others is usually fairly easy. If you are starting with C++ and then move to Objective-C, some of the object oriented syntax might look strange or seem hard to grasp at first, even though most of the syntax is pretty similar.

Well I was planning on switching to python as my first language so you think I should go python to objective-c to c++ right? Just want to know if I should return this book I got the other day. I have read that it takes about a month or two to learn python so if I went to C++ i would keep the book but if I went into objective-C I would return it or should I just keep it no matter what so I don't have to re-buy it. Is there even a point in learning c++ after objective-c and am I better giving the book to my brother who wants to learn on windows?. I'm not really in a hurry to write mac apps, I just want to take a nice and relaxed approach that can function as a hobby throughout college.

Also how hard is the jump from objective-c to cocoa and cocoa touch?
 

admanimal

macrumors 68040
Apr 22, 2005
3,531
2
Also how hard is the jump from objective-c to cocoa and cocoa touch?

Cocoa and Cocoa Touch are Objective-C frameworks, not languages on their own. If you know Obj-C, using them is just a matter of understanding the design patterns they follow to and being able to look up the correct classes/methods to use in the documentation.
 

cromwell64

macrumors regular
Jun 30, 2008
160
0
Well I was planning on switching to python as my first language so you think I should go python to objective-c to c++ right? Just want to know if I should return this book I got the other day. I have read that it takes about a month or two to learn python so if I went to C++ i would keep the book but if I went into objective-C I would return it or should I just keep it no matter what so I don't have to re-buy it. Is there even a point in learning c++ after objective-c and am I better giving the book to my brother who wants to learn on windows?. I'm not really in a hurry to write mac apps, I just want to take a nice and relaxed approach that can function as a hobby throughout college.

Also how hard is the jump from objective-c to cocoa and cocoa touch?

If it were me, I would just start out going straight for C, then any other language you want to pick up will seem like a breeze since most will use a C-style syntax. I think that if anyone really wants to learn to program, C is easily one of the best foundations. Objective-C is essentially C with some extensions added to it, and as the previous poster noted Cocoa is a framework built with Objective-C. So if you want to eventually use Cocoa, then definitely go straight for C or Objective-C.
 
Jun 30, 2009
318
0
I find C++ to be an easy language if you've got the right material. I, for one, am using Brian Overland's C++ Without Fear. It's probably the most basic and gentle introduction to the language. It teaches you more of the basic PROGRAMMING concepts, instead of getting into C++ specific language features.

Next, you could go for Bruce Eckel's Thinking in C++, which has two volumes, teaches you many advanced concepts, and probably the best of all, it's FREE :)

And of course, Bjarne Stroustrup's The C++ Programming Language.

But if you want to see results fast, I'd say web programming is the best fit. You'll spend some time (the more the better) on HTML/XHTML and CSS, which are not programming languages, but you'll get to JavaScript, PHP and SQL, which will give you a gentle introduction to programming.
The main advantage is that you will see how your web pages evolve from plain HTML, to fancy CSS and AJAX effects, to your own server-side scripts.

I've also heard on other boards that your book has many wrong lines of codes and so on.
 

Howiieque

macrumors regular
Feb 1, 2009
120
0
c is a subset of objective-c
so learning c from the beginning is a good idea
pick this: C Programming: A Modern Approach, 2nd Edition

and then i think objective-c is much easier than c++
 

Duke Leto

macrumors regular
Mar 17, 2008
166
0
Don't stress too much, though, it really is not *that* important. Personally, I hopped around randomly. I started with VB, then BlitzMax, then Actionscript, then Java, then C++, then finally ended up in Objective C.

Each language has a different feel, and each has its own advantages. However, for math, you can make simulations in Java by using Greenfoot, solve problems with C++ by making a command line tool, or make a simulation app in Objective C.

Personally, I enjoyed my time with C++. I found it interesting, and it was a tool for me to solve math problems. For example, you could make a simulation of water running through cups with holes. (User sets volume and flow rate, and the program tells you how much volume is in each container, or if one overflowed ... etc.)
 

lee1210

macrumors 68040
Jan 10, 2005
3,182
3
Dallas, TX
Sometimes when this question gets asked (which is about 1-2x/week), people just say to search the forum and read the guides linked at the top. Every once in a while, everyone jumps in and restates what has been said many times before.

As far as I'm concerned C->Objective-C is best, but it really doesn't matter. Just get programming. Don't spend a lot of deciding what to start with, you're just wasting time that you could be learning. You're not going to be eternally, irreparably crippled by picking a particular language (recovering from Fortran or BASIC might take some time, but i believe it's possible).

Just choose one and go. When you have questions, ask. Good luck!

-Lee
 

GorillaPaws

macrumors 6502a
Oct 26, 2003
932
8
Richmond, VA
Sometimes when this question gets asked (which is about 1-2x/week), people just say to search the forum and read the guides linked at the top. Every once in a while, everyone jumps in and restates what has been said many times before.

I agree in general, but the OP's situation is a bit different than most:
...just to dip my toes into writing programs? I have no aspirations to be a dev I just wanted something new to do and maybe help me with college math.

Usually, the question is more about how to get started writing Cocoa apps. From everything I've heard about Java and Python, I think either one would be a great place to start for someone just looking to learn fundamental programming concepts in general and don't really have any aspirations to learn Cocoa.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.