The Design of Software (CLOSED)

A public forum for discussing the design of software, from the user interface to the code architecture. Now closed.

The "Design of Software" discussion group has been merged with the main Joel on Software discussion group.

The archives will remain online indefinitely.

Learning C++

I wana start learning C++..where should i start? what compilers are available for windows? I am a C# programmer
anon
Monday, April 23, 2007
 
 
I would start by buying "The C++ Programming Language" by Bjarne Stroustrup.  It is a good introduction to C++ aimed at people who already know how to program.  It gives a balanced view to the features of C++ without focusing overly on one area.  This is the book that I learned C++ from after I knew java.

Visual C++ 2005 Express Edition is a free IDE and highly recommended by most.  I use VS2003 toolkit with Code::Blocks IDE because I don't like the MS IDE.
Tom C
Monday, April 23, 2007
 
 
++ for Visual C++ Express Edition, you can even, with a little bit of work, install the Win32 Platform SDK and build non.NET apps with it.

http://msdn.microsoft.com/vstudio/express/visualc/

You can also install Cygwin and g++/gcc for a traditional command line compiler. For straight C++ (not Windows-specific stuff) this is probably the most standards compliant tool that you can get for free.

http://cygwin.com

Finally, there are Borland C++Builder and Borland C++ 5.5 for either limited trial (C++Builder has a 30 day trial) or free download (the Borland C++ 5.5 command line tools are available for free download).

http://codegear.com
Jeff Dutky Send private email
Monday, April 23, 2007
 
 
I would stay away from g++ due to its poor error messages.  With a visual studio compiler you usually get an excellent error message
Tom C
Monday, April 23, 2007
 
 
Tom, I had the exact opposite of the problem.. I could understand g++ error messages, but VC++ error messages usually had me rooting around in MSDN to identify what the code means :)
Vaidhy
Tuesday, April 24, 2007
 
 
wxDevC++ (http://wxdsgn.sourceforge.net/index.php) is a nice IDE and includes MinGW (g++ for windows) all in a single easily installed package.
Honu Send private email
Tuesday, April 24, 2007
 
 
Some online resources/references:
C++ in Action (http://www.relisoft.com/book/index.htm)
Data Structs & Algos with OO Des Pats in C++ (http://www.brpreiss.com/books/opus4)
Stroustrup's C++ site (http://www.research.att.com/~bs/C++.html)

cheers
Honu Send private email
Tuesday, April 24, 2007
 
 
Try Turbo C++ Explorer from CodeGear:

http://www.turboexplorer.com
*myName
Tuesday, April 24, 2007
 
 
If you're already a C# programmer, chances are you're using the Microsoft IDE. You may as well use the Microsoft Visual C++ Express - it's free, and you will only have to learn C++ rather than C++ and another IDE.

C# code is not so very different from C++ code in most respects. The main hurdle is learning to live happily without the garbage collector. I'd advise you to completely skip raw C++ pointers and use the boost library (shared_ptr etc) from the start. You'll need to download this separately, but it will save you plenty of frustration.

The other thing you need to know is stl's vector, deque, map etc. Don't bother trying to read the stl code, just read the documentation for stl, and use it.
Duncan Sharpe
Tuesday, April 24, 2007
 
 
Pointers are an advanced topic anyway.  So are arrays unfortunately.  Actually here is a way that you can tell the quality of a C++ tutorial: if it introduces pointers before references and std::string then it is a bad tutorial.  If it introduces arrays before std::vector then it is a bad tutorial.
Tom C
Tuesday, April 24, 2007
 
 
"Thinking in C++" by Brucel Eckel
Phil Gates Send private email
Wednesday, April 25, 2007
 
 
'Bruce' that is.
Phil Gates Send private email
Wednesday, April 25, 2007
 
 
If you're using C# stick with MS products. Why bother with open source command line nonsense when Microsoft an excellent C++ IDE for free in the form of Visual C++ Express?

Also, it's a good idea to use proper grammar and spelling when posting. Especially on a Joel forum.

chris
chris Send private email
Wednesday, April 25, 2007
 
 
Uh, I meant "Microsoft HAS an excellent"

chris
chris Send private email
Wednesday, April 25, 2007
 
 
Also a C# person here. While I have played with C++ in the past, I would really like to learn it. I think some of the advice is good here about learning the basics from any online tutorial, then jump to the STL and BOOST .. any other recommendations along these lines?
the.hidden.dude
Wednesday, April 25, 2007
 
 
no, STL is part of a basic understanding of C++.  For example C++ has array primatives.  They are complicated.  C++ has a class called vector which is very much like an array.  It is relatively simple.  Thus vector should be learned before arrays.  Likewise the string class should be learned before the old-fashioned char* string conventions, even though in C++ string literals are not strings.  Yeah, that is the sad part, string literals are not strings.
Tom C
Wednesday, April 25, 2007
 
 
I just started in C++ two weeks ago (as avid followers of JoS forum are undoubtedly aware).  This is what I did to start:

Books:
Stroustrup, The C++ Programming Language - Good, but not easy reading, even for the experienced non-C++ developer
Eckel, Thinking in C++ - Good, but the opposite, not dense enough
Dewhurst, C++ Common Knowledge: Essential Intermediate Programming - Excellent, alot of stuff that's not obvious to a Java or C# guy.
Cogswell, et al, C++ Cookbook - I haven't gone back to this one much.
Deitel & Deitel, C++ How to Program, 5e - This is the one I go back to the most.  Skim the first 6 chapters, it starts getting useful at chapter 7
Lischner, C++ in a Nutshell - Disappointing, I loved Java in a Nutshell starting with the 1st edition so I had high hopes.  He doesn't explain things too clearly, so you need to understand it already in order to understand it.  duh
Lippman, C++ Primer - Looks good but I haven't gotten into this one that much.

Disclaimer, I haven't sat down and _READ_ any of these books (haven't had time).  I have them and when I've got a question (which is every few lines of code it seems) I open them and start digging.  That's the level of my familiarity with them.

As for environment, I'm using Eclipse 3.2 with the CDT (C++ Development Tools) and minGW.  It was a process to install as most of it doesn't have an "installer".  Here are links on getting it running:
http://www.cs.umanitoba.ca/~eclipse/7-EclipseCDT.pdf
http://eclipsewiki.editme.com/InstallingCDT
http://eclipsewiki.editme.com/CDT

I second whoever said to use the Boost libraries.  But even they will seem "primitive" to someone used to the .NET libraries (or Java libraries).  And Boost has the best C++ documentation I've seen so far and it pales in comprarison to the docs that ship with the .NET library. 

You're not in Kansas anymore.
Ugnonimous
Wednesday, April 25, 2007
 
 
I simply cannot agree with the statement that "a book that mentions c-style arrays before std::vector<> is a bad book".

Try doing anything useful in C++ without knowledge of C-style arrays and char* strings.

This problem (or not, depends on how you look at it) is inevitable in a language of "evolutionary design". C++ has never attempted to replace standard C library with one of it's own.

In fact, when it was first introduced, very little "standard C++ library" existed at the time. And even these days ANSI STL does not even have hashtables!

Look at Objective-C. Same problem: "new" language (derived from C) but no new standard library.

Enough criticizing. I feel I must give an advice too! :-) Here it comes:

Avoid Windows/Microsoft-specific C++ implementation. You may accidently start using Microsoft's own C++ "improvements" without even realizing it. In fact, these days their compiler screams at you every time you use any of standard Clib functions that deals with arrays/strings, considering it "unsafe", offering you to replace it with their idiotic safe, but uncompatible replacements.
Eugueny Send private email
Friday, May 04, 2007
 
 
Another thing: I noticed that programs originally written for g++ compile very well under Visual C++ 8, but not vice versa.

Unfortunately for GNU people it seems that MSVC++ implements full C++ standard to a greater degree than G++.

Specifically I find that G++ needs a bit more of programmer's help resolving templatized type declarations with typename keyword.

Use GNU C++, if you can find IDE or Editor/Debugger combo you are comfortable with.

I do all of my development in Visual Studio, including debugging, periodically compiling and running tests on Linux/GNU. In fact I have no clue how Linux people develop/debug things. I hear KDevelop is nice, and there is Eclipse-based C++ IDE as well.
Eugueny Send private email
Friday, May 04, 2007
 
 
I would recommend the following books:

1) Accelerated C++ by Andrew Koenig and Barbara E. Moo
      -This should be your starter book.  The one you
      read to grab basic familiarity with the language.

2) Effective C++ by Scott Meyers
      -This should be your second book.  Discusses
      the major best practices and pitfalls of C++

3) The C++ Language by Bjarne Stroustrup
      -This will be your reference manual.  Use it for
      looking up detailed information about just about
      every language and library feature.

Those guys are some of the heavy hitters of the C++
world......
JustAnotherHacker
Tuesday, May 08, 2007
 
 

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics
 
Powered by FogBugz