Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Programming / Mac Programming / November 2005



Tip: Looking for answers? Try searching our database.

Getting in to C++, too dense to figure things out

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Tokay - 02 Nov 2005 17:25 GMT
I decided I want to try learning C++, but so far it's not working out
so well....

I'm a total coding n00b (and a bit of a Mac novice as well), so I need
some help.  Here's my problem--
I'd like to be able to write and compile code on my laptop, an old
iBook clamshell style, running OS 10.3.9
I can't find any software that's install-and-go that will run on my old
iBook.  Everything I find that's free and open source (GCC and Eclipse
are it so far) comes in source code.  Who's idea was it to distribute a
C++ compiler in source code?  It's like locking your keys in the car!
Is this the price of open source?

CodeWarrior is a bit out of my price range right now, Xcode 2.1 won't
run on 10.3, and I can't understand how to get GCC running!

I feel like there's something very obvious I'm missing, because I don't
know what I'm looking for...

Any help is appreciated, thanks
Chris
Dave Seaman - 02 Nov 2005 17:49 GMT
> I decided I want to try learning C++, but so far it's not working out
> so well....

> I'm a total coding n00b (and a bit of a Mac novice as well), so I need
> some help.  Here's my problem--
[quoted text clipped - 5 lines]
> C++ compiler in source code?  It's like locking your keys in the car!
> Is this the price of open source?

You need to install Xcode.  You may find an installer in
/Applications/Installers.  If not, look on your Panther system disks or
on the install disks that came with your Mac.  There should be an Xcode
CD included.

> CodeWarrior is a bit out of my price range right now, Xcode 2.1 won't
> run on 10.3, and I can't understand how to get GCC running!

Xcode 2.1 is not the version on your Panther disks or on the system disks
that came with your Mac.  If you can't find the right version, you can
download Xcode from the developer site.

Signature

Dave Seaman
Judge Yohn's mistakes revealed in Mumia Abu-Jamal ruling.
<http://www.commoncouragepress.com/index.cfm?action=book&bookid=228>

Tokay - 02 Nov 2005 18:51 GMT
I bought the iBook used, so I don't have discs for Panther.  I have the
Tiger discs from my Mini.
But I bought it from a friend, so I suppose I can get the disc if need
be.

Also, I have OS 9.2 installed as well (just in case), if there's any
old tools....

I did see that Codewarrior is $99, but that's steep for an art student
who just wants to learn code as a hobby...

If it's really a good program, I may pick it up in a few weeks, but how
does it compare to XCode?
Patrick Machielse - 02 Nov 2005 19:51 GMT
> I bought the iBook used, so I don't have discs for Panther.  I have the
> Tiger discs from my Mini.

In that case you'll need Xcode 1.5. You can download this from the Apple
Developer Connection (ADC). You must first become an ADC member, but you
can sign up as an 'online' member, for free.

> Also, I have OS 9.2 installed as well (just in case), if there's any
> old tools....

Apple used to have Macintosh Programmers Workshop (MPW) for classic,
which you could (and possibly still can) download for free. Xcode is the
one you want though.

> If it's really a good program, I may pick it up in a few weeks, but how
> does it compare to XCode?

CodeWarrior is now 'End Of Life', so this is not the time to start
learning it...

patrick
toby - 02 Nov 2005 21:20 GMT
> > I bought the iBook used, so I don't have discs for Panther.  I have the
> > Tiger discs from my Mini.
>
> In that case you'll need Xcode 1.5.

Or you could throw Tiger on the iBook and use the latest Xcode.
In-place updates from 10.3 to 10.4 that I (and others I know) have done
have been easy and trouble-free (but take a backup anyway :).

> You can download this from the Apple
> Developer Connection (ADC). You must first become an ADC member, but you
[quoted text clipped - 5 lines]
> Apple used to have Macintosh Programmers Workshop (MPW) for classic,
> which you could (and possibly still can) download for free.

Still available; still great (especially if you need to build PEFs,
which Xcode cannot).

> Xcode is the
> one you want though.

Or, depending on what you're doing, Eclipse, which is superior to Xcode
in many ways - especially for Java or cross-platform work (but probably
Xcode is best for native Mac development).

> > If it's really a good program, I may pick it up in a few weeks, but how
> > does it compare to XCode?
[quoted text clipped - 3 lines]
>
> patrick
Allen Brunson - 02 Nov 2005 20:24 GMT
> I did see that Codewarrior is $99, but that's steep for an art student
> who just wants to learn code as a hobby...
>
> If it's really a good program, I may pick it up in a few weeks, but how
> does it compare to XCode?

it's *not* a "really good program."  my opinion is that codewarrior is only
for people who got into it back when it was still good, in the mid-nineties,
say.  for someone coming to it without any previous codewarrior experience, it
is really, really horrible.  i bought it during the cw 8 days a couple of
years ago, which was far and away the worst 500 bucks i've ever spent.  not to
mention, any time spent learning it on the mac is time wasted, because it's a
dead-end product.

find somebody who still has xcode 1.5, which works on 10.3.  i not only have
it, but i'm still using it, because i haven't upgraded to 10.4 yet.  it's a
really huge download though, almost 400MB.  are you sure they don't still have
it on apple's developer site?
Milton Aupperle - 02 Nov 2005 21:21 GMT
> > I did see that Codewarrior is $99, but that's steep for an art student
> > who just wants to learn code as a hobby...
[quoted text clipped - 14 lines]
> really huge download though, almost 400MB.  are you sure they don't still have
> it on apple's developer site?

XLoad 2.2 still doens't come close to the code gen speed. Altivec code
is 50% slower with XLoad that CW 9 is. Of course most people wouldn't
know a benchmark statistic if it smacked them upside the head, so it
hardly matters now.

But it doesn't matter any how because x86 is where Apple is headed and
if you want to write Mac software, you have to use XLoad.

Milton Aupperle
20+ years of Mac and Apple development.
Chris Baum - 02 Nov 2005 20:45 GMT
> I did see that Codewarrior is $99, but that's steep for an art student
> who just wants to learn code as a hobby...

There is a free educational version (of the new CW10).  I believe it is
limited to 32 source files.
Doc O'Leary - 02 Nov 2005 21:28 GMT
> that's steep for an art student
> who just wants to learn code as a hobby...

Everyone has already addressed getting the proper version of Xcode for
your OS, so let me be the one to say that you're f.cking nuts if you're
looking to start C++ as a hobby.  Mac programming is best done in Cocoa,
and that's best done with Objective-C, and that's best added to a C
foundation.  C++ is an "only if I have to" OO language, and you never
*really* have to.
Not Important - 02 Nov 2005 23:54 GMT
In article
<droleary.usenet-F0DCAE.14282202112005@corp.supernews.com>,

> > that's steep for an art student
> > who just wants to learn code as a hobby...
[quoted text clipped - 5 lines]
> foundation.  C++ is an "only if I have to" OO language, and you never
> *really* have to.

Would you guys pick your nuts up off the floor before someone
steps on them.
Tokay - 03 Nov 2005 18:39 GMT
Thanks for the help, everyone; I did find Xcode 1.5 on ADC, I guess I
just wasn't looking hard enough due to a case of rectal-cranial
inversion.

My main purpose for learning C++ is that I'd like to make some small PC
games just for fun, and I thought C++ would be a nice "everybody can
play" sort of a language, that'd be easy to port from platform to
platform.  I *could* do it in Java, but I really don't care for it.

I've also heard that C++ is a good starter language, not because it's
easy, but because there's so many similarities to other languages that
the others would be a breeze to learn.
clvrmnky - 03 Nov 2005 20:46 GMT
> Thanks for the help, everyone; I did find Xcode 1.5 on ADC, I guess I
> just wasn't looking hard enough due to a case of rectal-cranial
[quoted text clipped - 8 lines]
> easy, but because there's so many similarities to other languages that
> the others would be a breeze to learn.

More like language poisoning so you conflate all syntaxes equally.
Where the language truly counts it is incredibly unique from anything else.

However, if you are primarily concerned with being able to code on a
non-Mac platform, I guess C++ is as good as any.  I stay away from it as
much as I can.

I'm not sure how much of a "breeze" it will be to hack on some other
language knowing C++.  We get all sorts of fresh graduates here who have
been taught basic C++ and are seriously saddened when they try to touch
our legacy C code.
Patrick Machielse - 03 Nov 2005 21:19 GMT
> My main purpose for learning C++ is that I'd like to make some small PC
> games just for fun, and I thought C++ would be a nice "everybody can
> play" sort of a language, that'd be easy to port from platform to
> platform.  I *could* do it in Java, but I really don't care for it.

When you move beyond text adventures, Java does have a big advantage in
that is is a complete solution: it has integrated gui support. If you
write your games in C++, you can make the 'buisness end' (model) cross
platform, but you will probably have to create custom gui
(view/controller) for each platform. Also, in terms of object
orientation you're much better of with Java, and if you already know
Java, C++ will drive you (yes, let's use that word again:) nuts. I
promise :-)

patrick
Doc O'Leary - 03 Nov 2005 22:07 GMT
> My main purpose for learning C++ is that I'd like to make some small PC
> games just for fun, and I thought C++ would be a nice "everybody can
> play" sort of a language, that'd be easy to port from platform to
> platform.

You're wrong on all counts.  Nothing about C++ is fun, and nothing about
using it for games is particularly portable.  For most games,
portability lies in using OpenGL, which is a straight C API.

> I *could* do it in Java, but I really don't care for it.

Why not?  It wipes the floor with C++ from an OO perspective, though it
really doesn't give you anything new compared to OO languages that came
before it.  If you're just looking at toy/newbie development, though,
consider using JavaScript to make a Dashboard widget game.

> I've also heard that C++ is a good starter language, not because it's
> easy, but because there's so many similarities to other languages that
> the others would be a breeze to learn.

You have been lied to.
Tokay - 03 Nov 2005 23:30 GMT
Well, I *am* looking for a challenge.  I do intend to learn a few
different languages, this just seemed like the most logical choice
based on what I heard.  I guess not so much...

So, what would be a good starter language that would be a good stepping
stone?
Ben Artin - 04 Nov 2005 00:26 GMT
> So, what would be a good starter language that would be a good stepping
> stone?

Java and Python are both excellent starter languages IMO.

Ben

Signature

If this message helped you, consider buying an item
from my wish list: <http://artins.org/ben/wishlist>

I changed my name: <http://periodic-kingdom.org/People/NameChange.php>

Bruce Hoult - 04 Nov 2005 06:31 GMT
> Well, I *am* looking for a challenge.  I do intend to learn a few
> different languages, this just seemed like the most logical choice
> based on what I heard.  I guess not so much...
>
> So, what would be a good starter language that would be a good stepping
> stone?

Scheme, using the PLT environment and a book such as _How to Design
Programs_.

Advantages:

- a language with a small number of features that fit together so nicely
that you can do anything a complex language such as C++ can.

- a wonderful IDE

- portable to OS X, Linux, Windows

- comes with many example programs, including games, web servers and
other cool stuff.

- a language with an ISO standard with many implementations

Signature

Bruce |  41.1670S | \  spoken |          -+-
Hoult | 174.8263E | /\ here.  | ----------O----------

David Phillip Oster - 04 Nov 2005 17:56 GMT
> > Well, I *am* looking for a challenge.  I do intend to learn a few
> > different languages, this just seemed like the most logical choice
[quoted text clipped - 19 lines]
>
> - a language with an ISO standard with many implementations

I'd go with Scheme, also. Get a copy of "Structure and Interpretation of
Computer Programs" by Abelson and Sussman. It uses scheme and is the
book they used in their intro to Computer Science course at M. I. T. The
book is an introduction to computer science, and while teaching you the
theoretical fundamentals, uses writing language interpreters, compilers,
digital circuit simulation, and symbolic math packages as examples.

If you want something easier, I'd recommend "Accelerated C++" by Koenig
and Moo. It is designed for beginners, and will teach you useful
concepts.

Signature

David Phillip Oster

Tokay - 04 Nov 2005 20:19 GMT
I think I may stick with C++, because it may help me advance my career
as well (It unfortunatelly has to do with MS rather than Mac).  But
thanks for all the good advice.
Doc O'Leary - 04 Nov 2005 23:28 GMT
> Well, I *am* looking for a challenge.

What you need to understand is that programming has some inherent
necessary complexity, and then languages can introduce their own
unnecessary complexity.  For what C++ offers, there is so much
unnecessary complexity included that makes it worthless, and I contend
that using it as an OO foundation actually damages the programmer.

> So, what would be a good starter language that would be a good stepping
> stone?

It all depends what you want to do.  Others have suggested Scheme, and
there is a lot of merit in starting with an interpreted language instead
of a compiled one.  I've taken a liking to Io as a small and
straightforward language (portable, too; see
<http://www.iolanguage.com>).  I still say JavaScript is easy enough
with more real-world applications that you should consider starting with
that.
Bruce Hoult - 05 Nov 2005 02:31 GMT
> > So, what would be a good starter language that would be a good stepping
> > stone?
>
> It all depends what you want to do.  Others have suggested Scheme, and
> there is a lot of merit in starting with an interpreted language instead
> of a compiled one.

Point of order: some scheme implementations are interpreters, but many
of them are compilers that produce machine code that runs anything from
almost exactly as fast as C ("Stalin") to two or three times slower
("Chicken").

>  I've taken a liking to Io as a small and straightforward language
>  (portable, too; see <http://www.iolanguage.com>).  I still say
>  JavaScript is easy enough with more real-world applications that you
>  should consider starting with that.

JavaScript would be a good choice too, if there were suitable books (I
don't know whether there are or not) and if there were better debugging
facilities than there were last time I looked at it.

One way to get a feel for the variety of language sout there is to go to
the Computer Language Shootout Benchmarks site which has source code and
performance data for about 20 short programs written in over 30
languages.

 http://shootout.alioth.debian.org/

Don't take the results a.s Gospel but .. welll in general the fast
language end up at the top andd he slow onees end up at the bottom.  
Interestingly, C++ comes in the middle.

Signature

Bruce |  41.1670S | \  spoken |          -+-
Hoult | 174.8263E | /\ here.  | ----------O----------

Chris Hanson - 05 Nov 2005 11:06 GMT
> It all depends what you want to do.  Others have suggested Scheme, and
> there is a lot of merit in starting with an interpreted language
> instead of a compiled one.

Doc, you're completely correct in saying that the original poster
shouldn't choose a needlessly complicated language when they're first
learning to program.

However, please don't spread the myth that Scheme is an "interpreted"
language.  It's not -- both Scheme and Common Lisp (Smalltalk too) will
compile code to either some sort of VM bytecode or to native machine
code before executing it.  Even when used interactively.  And not just
in high-end commercial implementations.  The common experience of a
language like Scheme, Common Lisp, or Smalltalk is different from the
experience of batch-compiled languages like C/C++/Objective-C or
Pascal, but it doesn't mean they're not compiled.

For the original poster, the MIT introductory programming course 6.001
"Structure and Interpretation of Computer Programs" has just been
converted to a video podcast that can be subscribed to via iTunes.  
This is one of the best introductory computer science courses available
and the course material including lecture videos are online free.

 http://pythonzweb.blogspot.com/2005/11/structure-and-interpretation-of.html

Whether the original poster chooses to go with Python, Scheme, Io,
JavaScript, or some other language, what's important in learning to
program is learning how to decompose problems into algorithms and
structures.  I think that's much easier to learn with a dynamic
language with fast turnaround like Scheme, Lisp, Smalltalk, Python, or
JavaScript.  Whether the language is compiled or interpreted doesn't
have much of anything to do with it.

 -- Chris
Doc O'Leary - 05 Nov 2005 23:29 GMT
> Whether the original poster chooses to go with Python, Scheme, Io,
> JavaScript, or some other language, what's important in learning to
[quoted text clipped - 3 lines]
> JavaScript.  Whether the language is compiled or interpreted doesn't
> have much of anything to do with it.

True.  I misspoke, which is easy to do these days as languages are
blending implementation strategies.  We have interpreted vs. compiled,
dynamic vs. static, interactive vs. batch.  A good beginner language
will help you along every step of the way and will allow you to test
small algorithmic expressions without a lot of cruft that accompanies
"application programming".  Many popular languages just don't fit that
bill.
Michael Ash - 03 Nov 2005 22:56 GMT
> Thanks for the help, everyone; I did find Xcode 1.5 on ADC, I guess I
> just wasn't looking hard enough due to a case of rectal-cranial
[quoted text clipped - 8 lines]
> easy, but because there's so many similarities to other languages that
> the others would be a breeze to learn.

That's not really true. Beyond the extremely superficial syntax level, C++
has a ton of features (and "features") which don't generally exist in
other languages, and knowledge of which won't be that helpful beyond C++.
Just off the top of my head, there's templates, manual memory management,
virtual/non-virtual member functions, explicitly stack-allocated objects,
and pointer arithmetic. Manual memory management and pointer arithmetic
are useful in other C-like languages, but not many other places. The rest
aren't even useful there.

If you want something that's cross-platform, easy to learn, and will teach
you concepts you can use elsewhere... well, forget about the teaching
part, most any language will fill that role. Try Python, it runs
everywhere, it's simple and yet powerful, and uses plenty of common
concepts. Its main disadvantage, its incredible blinding non-speed, is not
usually an issue for a beginner.

Signature

Michael Ash
Rogue Amoeba Software

Peter Ammon - 06 Nov 2005 01:06 GMT
> Thanks for the help, everyone; I did find Xcode 1.5 on ADC, I guess I
> just wasn't looking hard enough due to a case of rectal-cranial
[quoted text clipped - 8 lines]
> easy, but because there's so many similarities to other languages that
> the others would be a breeze to learn.

That's like saying that the dictionary is a good read because it uses
the same words as most other books.

Well, not really.  But it's the closest analogy I could think of :)

Signature

Pull out a splinter to reply.

toby - 06 Nov 2005 19:12 GMT
> > ...
> > I've also heard that C++ is a good starter language, not because it's
[quoted text clipped - 5 lines]
>
> Well, not really.  But it's the closest analogy I could think of :)

Works for me :-)
James W. Walker - 02 Nov 2005 18:20 GMT
> CodeWarrior is a bit out of my price range right now

Are you aware that CodeWarrior 10 is selling for $99?  That's a lot
less than previous versions, the catch being that there will be no more
CW upgrades for Mac.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.