Thread: ISO or C++/CLI?

  1. #1
    Registered User
    Join Date
    Sep 2006
    Posts
    230

    ISO or C++/CLI?

    Hi,
    I want to start learning C++. I'm using the book "Ivor Hortons Beginning Visual C++" to learn. It first teaches command line C++, then proceeds on with the GUIs.

    I have a few questions:
    1. Does anyone know if this is a good book?
    2. (important question) The book teaches both native C++ (ISO) and C++/CLI. Since C++/CLI is an improved version of ISO C++, in every chapter it teaches ISO then C++/CLI. Should I go for C++/CLI? From what I read in the book I understand that it is portable (you don't even have to recompile the code) since it runs in the CLR. It also eases GUI programming by using Windows Forms.
    However, I'm afraid I won't have that much support (e.g. from this community) and that it is not used a lot.

    So, what do you think?

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    2. (important question) The book teaches both native C++ (ISO) and C++/CLI. Since C++/CLI is an improved version of ISO C++, in every chapter it teaches ISO then C++/CLI. Should I go for C++/CLI? From what I read in the book I understand that it is portable (you don't even have to recompile the code) since it runs in the CLR. It also eases GUI programming by using Windows Forms.
    You might want to read Stroustrup's FAQ on What do you think of C++/CLI?

    However, I'm afraid I won't have that much support (e.g. from this community) and that it is not used a lot.
    You will probably not have much support from this community if you go the C++/CLI route. I have noticed that the few C++/CLI specific questions that get asked from time to time go mostly unanswered.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    and the hat of sweating
    Join Date
    Aug 2007
    Location
    Toronto, ON
    Posts
    3,545
    Quote Originally Posted by Abda92 View Post
    I understand that it is portable (you don't even have to recompile the code) since it runs in the CLR. It also eases GUI programming by using Windows Forms.
    I guess theoretically it could be portable, but I've never heard of a non-Windows .NET platform.

    Besides, have you looked at the C++ .NET syntax. YUK!
    I think if you want to learn .NET, then C# would be much better to use.

  4. #4
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    C++/CLI is probably the most unportable of all .Net languages. Microsoft's compiler is the only one that understands it. In comparison, there are three, if not more, compilers that understand C#, and one and an experimental one that understand VB.Net. As for the generated code, C++/CLI is considerably more likely to include native code parts than code written in the other languages, so it's less portable there, too.
    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

  5. #5
    Registered User
    Join Date
    Nov 2006
    Posts
    42
    Quote Originally Posted by cpjust View Post
    I guess theoretically it could be portable, but I've never heard of a non-Windows .NET platform.
    There's a Project Mono, attempting to make .NET available on other platforms (I've seen it running on Linux).

    I'd also recommend going for C# when it's about .NET and sticking to native C++ otherwise.

    Cheers,
    ~

  6. #6
    Hardware Engineer
    Join Date
    Sep 2001
    Posts
    1,398
    I don't own this book, but, I've heard of it and I have an opinion!

    The book is very compressed & accelerated. I don't think you'll get much "depth" in Standard C++. For example, if you were taking Computer Science in college, you would take one or two full semesters of Standard C++ before taking a GUI programming class. ANSI/ISO C++ is a complex language... You can't even find a book (other than the actual language standard) that covers all of ANSI/ISO C++ !

    Learning Standard C++ first, is the traditional more "structured" approach. It helps you build a foundation. You will need Standard C++ to make your program "do something" useful.

    But, if you want to get into GUI programming right away, the Horton book is probably your best option (unless you want to go with java or Visual Basic). Just be aware that you might need to go-back and dig-into the C++ basics.

    However, I'm afraid I won't have that much support (e.g. from this community) and that it is not used a lot.
    The C++ forum is mostly about ANSI/ISO C++. But, it's OK to discuss non-standard C++ libraries as long as you mention what library/compiler you are using. And, there is a cprogramming.com Windows Forum for Windows-specific issues. ...You might get harassed a bit (on either forum) for asking "beginning questions", while trying to write a GUI program, because most people will expect you to learn C++ first. ...It's really hard to help someone with their GUI program if they don't know how to make a loop, or how to use pointers, etc.

  7. #7
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    C++/CLI quite honestly is hideous and I do not agree with the statement it is better than ISO C++. C++/CLI is bastardized C++ that has been altered for the express purpose of functioning under .NET and thus really just for Windows. Altering a standardized language like that is to me attempting to take over something that isn't quite yours in the first place.

    I highly recommend you learn ISO C++ first and then if you want to move to .NET. If you start with .NET and come back to C++ you will have picked up some very bad habits and some very bad object oriented design methods IMO. Not to mention the C++/CLI syntax is a bit different and they use the ^ (XOR?) operator for something completely different.

    Stay far away from books that claim C++/CLI is better or somehow superior to ISO C++. That is a completely ignorant and arrogant statement and is like comparing apples to oranges. Usually, but not always, it is written by someone who does not completely understand C++ or despises the power that it allows you to use and abuse (if you want).
    Last edited by VirtualAce; 11-20-2007 at 07:04 PM.

  8. #8
    Registered User
    Join Date
    Sep 2006
    Posts
    230
    OK thanks everyone. I guess I'll just start with standard C++ first. If I ever want to program GUIs for Windows I'll just have to use one of the libraries (I'll have to look into that once I get to it).

    What I understood from some of your replies is that this book is not the best for teaching standard C++. Any suggestions for other books?
    Please note that I do know some C (but not too much) so I have the basic syntax and all the basic stuff covered. However, I have no idea about object oriented programming (I know what it means but I've never learned it).

    Thanks for your help.

  9. #9
    Registered User
    Join Date
    Jan 2005
    Posts
    7,366
    See the stickied C++ book recommendations thread. Accelerated C++ by Koenig and Moo is my recommendation.

  10. #10
    Registered User
    Join Date
    Sep 2006
    Posts
    230
    Oh ya sorry. Forgot there's a sticky for that.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. ISO 8583 Message Parser in C?
    By nadeer78 in forum Projects and Job Recruitment
    Replies: 7
    Last Post: 06-16-2008, 12:56 AM
  2. help burning linux liveos iso!
    By Yarin in forum Tech Board
    Replies: 41
    Last Post: 04-03-2008, 11:20 PM
  3. Dev-cpp - compiler options
    By tretton in forum C Programming
    Replies: 7
    Last Post: 01-06-2006, 06:20 PM
  4. iso file iregularity
    By iain in forum A Brief History of Cprogramming.com
    Replies: 17
    Last Post: 12-02-2002, 10:02 AM