HOW TO BEGIN PROGRAMMING IN C/C++ This article is meant to be a guideline for those with no programming knowledge, and those with prior programming experience in other languages. It is not a tutorial, and it is not written to present any absolutes. It is written to explain some terminology. To explain what is needed to begin programming in C/C++, and where to get these items. DIFFERENCES BETWEEN C AND C++ While C and C++ are two distinct languages, the distinction between the language has became blurred in recent years. With compiler vendors building and marketing compilers as C/C++ compilers this has became even more blurred. C was written as a structured language. A structured language has various modules and segments that can be written and tested separately and then combined to form a working application. C was also written originally for the UNIX operating system, much as you would use GW BASIC or BASICA for the DOS operating system. C and structured programming were found to be so useful it was quickly adapted for other operating systems. C was written to allow bit-wise manipulations, in order to manipulate the language as no high level language has done before. C also includes a large library of pre-written modules that can shorten development time. This is why C has become the main programming language for system engineers and software designers world wide. This portability allows people to be trained on any operating system and easily use the language and skills on other operating systems. However, C has some restrictions, it has poor type checking, and is not very suitable for run time manipulations. C is also extremely hard to use as an Object Oriented Language. Seeking an improved method C++ was developed from C, also using Simula67 and ADA as guidelines. C++ can be used to write structured programming and the additions it made to C in type checking and uses of references, greatly add to C's power. C++ also has added a much improved method of adding comments to the code. C++ power and its wide spread use is in writing Object Oriented Programming ( OOP ). Structured programming allows the program to be broken down into smaller testable modules. In large programs, the inter-linking of these modules, and the sheer volume of them required an immense amount of time re-writing code, and tracking what has already been written. It could be said that OOP instead of interlinking modules, combines several mini-programs into one large program. By making each module an entity of it's own it protects data, while at the same time allow reuse of the basic code in a module born from it. Simply put, Structured Languages let you build a home radio, and then use that technology to design a car radio, or a portable radio for the beach. Object Oriented Language allows you to build one radio, and then reuse that radio for your car, at the beach and at home. C++ is based on C, and it is an improved C. Most modern C/C++ compilers integrate both C and C++ into one basic compiler--allowing you to use C++ additions when writing a structured language. C++ programming using OOP still requires the programmer to know and utilize the basic foundations of C and it's vast library of reusable code. CAN I LEARN C AS A FIRST LANGUAGE You can learn C as a first language--since all languages consist of the same basic techniques. Inputting and outputting of data, manipulating that data, and making a decision about that data are all necessary to make a program. Other languages such as BASIC and PASCAL are easier to learn the basic techniques. BASIC usually comes ( in some form ) with your operating system, and thereby cheap to learn. You can learn the same thing using C as a first language. C will just force you to learn in higher detail the intricacies of how a system operates. C compilers while relatively inexpensive still, are an investment for someone that is not sure that he will actually enjoy programming. I usually recommend that any person with no programming experience, buy a book, and experiment with the BASIC that came with your system. A few weeks learning how to input data, make a decision on that data, and output it, should enable you to tell if you are cut out to be a programmer. Programming is a craft, and like any craft it is a mixture of raw talent, learning, and practice. Like any craft, what might appear to be fun, and rewarding for others is not fun and rewarding for you personally. The low price for most C/C++ standard compilers now, allow you to use C as a first language. So, if you are sure of your desire to program is genuine, there is not any reason not to start with C/C++ programming as a first language. SHOULD I LEARN C FIRST OR C++ This is a tough decision. You will have to learn C in either event. You will either learn C first or learn C as you learn C++ techniques. I normally recommend you learn the basics of the C language before learn C++. I feel that trying to learn C++ as an Object Oriented Language initially, deprives the programmer of vital necessary skills that need to be learnt. Borland compilers, and some books seem not to differentiate between C and C++. Instead, they differentiate between Structured and Object Oriented Languages. Those that learn C++ as a structured language with the C++ additions to C included, can easily learn C while they learn C++. Generally speaking and for this discussion, I will consider C as a Structured Language and C++ as an Object Oriented Language. Restraints on the size of a book, and limits to how much a person is willing to learn with no appreciable gain, have caused authors of books to make certain choices. Generally a book that teaches C++ ( OOP ) will not be able to delve into the nuances and arcane programming skills that make C such a powerful language. The C++ books for beginners quickly rush through these and other areas. Leaving the reader with only a half understanding of the material in some cases, and no knowledge in other cases. Beginner C books, usually go into much greater detail, and can leisurely pace itself on the fundamental material. They, however, spend a lot of wasted time teaching formatting of input and output. While this is useful in C, and it allows the reader to get quick gratification for his hard work, it is a very minor part of programming in total. C++ also uses an entirely different procedure for input and output. Formatting input and output in C, is a skill, while not wasted, is not extremely useful. Being able to read standard C formatting techniques is necessary when adapting old source code, or maintaining old code. I think, if you want to be a professional programmer, and understand how to write efficient code in C++ you should learn C first. If you are a hobbyist, and looking for a quick way to learn to program, and will go back and learn more as it becomes necessary, then you can start as a C++ Programmer. WHAT DO I NEED TO OWN You need a compiler and a source of information on how to program. First lets talk about sources of information. BOOKS There are several excellent C Language books developed for beginners. SAMS, QUE, Microsoft Press, McGraw Hill and The Waite Group Press among others all put out some excellent books. I personally recommend different books depending on the experience and the time that a person wants to spend learning C/C++. C BOOKS There are several books concerned with C as a beginner's language, or moving from another language to C among them are: Teach Yourself C Herb Schildt McGraw Hill Pub. ISBN 881596-7 An excellent tutorial for anyone learning at home, integrated and overlapping segments allows the beginner to reinforce his skills. This book also delves into the more intricate items in C. C Programming Augie Hansen Addison-Wesley Pub. ISBN 0-201-19444-9 A well-developed tutorial, for anyone learning at home, but might include techniques and phrases that might need some simple explanations for anyone who has never programmed before. The Waite Group's New C Primer Plus Mitchell Waite and Stephen Prata SAMS Pub. ISBN 0-672-22687-1 An excellent tutorial for learning at home, quite often adds a humorous example that lets the student feel more ease. This humor will often making the learning experience more interesting. It does not fully explore many of C's finer points. C++ BOOKS There are several books dealing with C++ as a beginning language and for moving from C or another language to C++ among them are: The Waite Group's C++ Primer Plus Stephen Prata Waite Group Press ISBN 1-878739-02-6 This book is a well-written tutorial for learning at home. This book was written for someone with no knowledge in C or C++. It adds humorous items to the text and makes the learning more enjoyable. The book attempts to do to much and can not go into depth on any one subject. It often omits some of the finer points of the C language. Teach Yourself C++ Herb Schildt McGraw Hill ISBN 0-07-881760-9 Excellent tutorial for anyone that knows the C language. This book starts with the assumption that the student knows C and it's intricacies. It teaches C++ and OOP by reinforcing one segment after another. The Waite Group's C++ Programming John Berry SAMS Pub. ISBN 0-672-22619-7 This book was written for C programmers learning C++ and Object Oriented Programming. This book is dated and not current with present standards and methodology. This book is not recommended for home study at all. Learning C++ by Tom Swan SAMS Pub. ISBN 0-672-22785-1 This book is kind of dry and written more towards programmers moving from C to C++. This is an old book, not fully up to date with the latest standards or techniques. The only advantage to this book is it does come with a C++ compiler that you can use as you learn. COMPILER SPECIFIC BOOKS There are several books many put out by The Waite Group that are excellent tutorials, for a specific vendor's compiler. Object Oriented Programming From Square One Ed Mitchell QUE Pub. ISBN 1-56529-160-3 While written for Turbo C++ and Turbo C++ for Windows this is an excellent book for the beginner, and anyone moving from C to C++. It has basic chapters on Installing Turbo C++, using the IDE, Turbo Vision, Templates, and Object Windows that are missing from general books. Object Oriented Programming in Microsoft C++ Object Oriented Programming in Borland C++ Robert LaFore Waite Group Press MS C++: ISBN 1-878739-08-5 BC++: ISBN unknown This is an excellent book to learn specifics about your compiler. It includes information on all aspects of C++ from a beginning level upwards. For DOS programming, however uses many of the same techniques used in Windows programming. The Waite Group, either through various publishers or the Waite Group Press have written "Bibles" for Borland and Microsoft C and C++ compilers. They write several good tutorials for C programmers for Borland and Microsoft Compilers, that include information that you can not find in a generalized book. BOOKS TO BE AWARE OF There are several 'quick teach' books, that will teach you C/C++ quickly. These books do not teach anything quickly they simply have examples that you can modify without knowing how they work. I have yet to find one that I find satisfactory or in any way educational. I believe these types of books hurt the Programming profession if misused. They are written for programmers who are proficient in one language that need to quickly use another language for a one time program. There usually are various books that accompany the compiler. Usually the whole effort of these books it to employ functions that a particular vendor has written. This enables that particular vendor to resell his product again and again as the user is not familiar with the more portable procedures. Many also include 'quick learn' techniques that will let you learn how to do one particular application quickly and easily. However, they leave a lot to be desired for any other program. Avoid the K & R C Language book, as well as the Stroustrup C++ Programming Language book. These books were written to set a standard for developers of the language. They make awful tutorials, are hard to read, and generally just discourage the novice programmer. They are however good to win bar bets if you hang out at a programmer's bar. INTERACTIVE TUTORIALS There are several interactive tutorials, some shareware some commercial products. They are useful, but generally teach a very limited amount of the language and require rigorous stylistic approach. VIDEOS There are several C/C++ programming videos Borland has an excellent set. However they are far too expensive for a non corporation to purchase. ON-LINE COURSES America OnLine and IES offer various courses on C and C++. These courses are not associated with any college or university. However, they do offer the best price per dollar for your education. JUNIOR COLLEGES AND UNIVERSITIES Very few junior colleges offer C and most Universities require previous classes be taken before you can enroll in the C class. They are however, the finest way to fully learn C/C++. Students quite often are eligible for discounts on software and books that could make up for some of the tuition. WHAT'S A COMPILER AND WHERE DO I GET IT When you create a C program it normally will be broken down into smaller modules. There are also pre-written modules that are included with your compiler. These pre-written modules are called libraries. A compiler will take the modules that you have written and check them for syntax errors ( errors in programming code ). It will then compile a syntax correctly written program into a type of code called an object file. Next the compiler will combine, or link each of the modules written with the pre-written libraries that are needed into one executable file. TYPES OF COMPILERS AVAILABLE There basically are two types of compilers available, those with integrated editors and debuggers, and those that are command line compilers requiring a separate editor and possibly separate debugger. Borland C++, and the various Borland Turbo C++, Microsoft C++, Visual C++ and QuickC, and Symantec C++ all come with an integrated editor debugger. They generally offer extra tools as well. The command line compilers, require a separate editor, although you can use any text editor such as MS DOS's Edit or Windows Notepad. For a beginner, they are often not easy to use, and error checking is much harder to do with these compilers. Also, you will need to learn and understand how to create a script program called a makefile that tracks and updates your various modules. Command line compilers seem to fall into two categories. That of shareware, or expensive tailored to fit compilers. PROFESSIONAL VERSUS STANDARD MODELS Symantec C++ ( formerly Zortech C++ ) and Microsoft Visual C++, both come in a professional and standard model. Borland International, has decided to call its professional model 'Borland C++' and it's standard model 'Turbo C++.' Normally the professional model will compile both DOS and Windows programming. They normally include an assembler, superior debugger and other programmer tools--which are not included in the standard version. STANDARD MODELS Note: Requirements are estimates, and versions are subject to change. Symantec C++ either now offers or plans to offer a standard version of its professional compiler. I am unable to make any comments about this product. Microsoft Visual C++ standard edition creates only Windows programs, however it allows the user to create a quasi DOS program. This QuickWin program creates a window that looks and reacts like the DOS prompt in Windows would. There are several limitations and it is merely used to teach the language and not a true DOS programming tool. This requires Windows, 4 MB RAM, and about 20 MB minimum disk space. There are a few third party books out for this compiler and is very popular. You should not have to hard of a time finding help for this compiler. Microsoft also offers QuickC that is a true DOS only compiler. It does include all the graphical and mathematical libraries necessary to write full featured DOS applications. It is small and compact and will run in a system with 1 MB of memory, taking up less than 5 MB of space. It is a C compiler and will not write C++ Programs. I believe that you can use QuickC to upgrade to a professional C++ Program at about the same price as if you bought the C/C++ professional compiler at normal price. There are several third party books out for this compiler and is very popular. You would not have a hard time finding help for this compiler. Turbo C++ for Windows, possibly now called Turbo C++ Visual Edition, creates only Windows programs, however it allows the user to create a quasi DOS program. This emulated DOS program creates a window that looks and reacts like the DOS prompt in Windows would. There are several limitations and it is merely used to teach the language and not a true DOS programming tool. This requires Windows, 4 MB RAM, and about 20 MB minimum disk space. The visual edition seems to have not been well thought out and integrated at this time. There are however several Turbo C++ books from third parties and it is a very popular compiler. You would not have a hard time finding help for this compiler. Turbo C++ for DOS, creates only DOS applications--it can however, be ran from within Windows. This is an excellent beginner's compiler. TC++ will run from DOS but requires a minimum of 2MB RAM and about 10 MB of disk space for full installation. I believe that you can use Turbo C++ to upgrade to a professional C++ Program at about the same price as if you bought the C/C++ professional compiler at normal price. There are probably more users of this compiler, and it has been better documented than any other compiler. You will not have any trouble finding help for this compiler. PROFESSIONAL MODELS Symantec C++ ( formerly Zortech C++ ) is an excellent compiler. It is fully integrated with a built in code writing tool for Windows. It has an excellent debugger, and editor. The interface of Symantec is a departure from previous compilers, choosing to run an object oriented interface. The user can select from a folder looking tool bar various options and screens to appear for debugging, editing, building and other functions. Once set up this by far the finest interface on the market, but is a departure from others and does take a while to set up so you are fully comfortable. All programming tools necessary to create full functioned Windows programs are included. There are some limitations on DOS programs and a graphics package is not included. It will create Win32s applications, as well as DOS 32 bit applications. Outstanding manuals are included. However, very few third party books are available for this system. Microsoft Visual C++ is an excellent compiler. It is fully integrated with a built in code writing tool for Windows. It has an excellent editor and debugger. The interface is more the standard method with windows inside of a window and options pulled down from a tool bar. Full functioned in both DOS and Windows all tools necessary to create a Windows application are included. The manuals for this compiler, were written for professionals, with prior programming knowledge. You will need to buy one of the many third party books to fully understand how to use this system well. Borland C++ is an excellent compiler. A new version of the Borland Compiler BC++ 4.0 was just introduced and not yet reviewed. The previous version was Borland C++ 3.1 and Borland C++3.1 with Application Framework. The BC++ 3.1 consisted basically of Turbo C++ for Windows and Turbo C++ for DOS in one system with some extra tools available. The Application Frameworks version included a Windows programming system that was excellent but has become dated. I believe the newest version of Borland C++ 4.0 will be comparable with Symantec and Visual C++ in integration, and functionality. WHAT IS RECOMMENDED FOR THE BEGINNER I recommend either Turbo C++ or QuickC for the novice programmer if they have no programming experience. If you want to program in Windows immediately, Visual C++ Standard version is an alternative. If you already understand programming and know you enjoy it, I then recommend you purchase Symantec C++, Borland C++ 4.0, or Microsoft Visual C++, and bypass the standard version. I believe that software has a look and feel to it, and if you are not comfortable with the look and feel, you will not be able to produce the finest code possible. If you are able to sample the software, or get a demo tape, or disk, I recommend that you do so. There is not that much difference between any one vendor that cannot be made up by feeling at ease when you program. WHERE DO I GET THE SOFTWARE? You can get the software at various places, software stores, discount stores, discount programming mail order firms, and directly from the manufacturer. There seems to be no advantage in way of support from buying from any one place over another. Prices range from approximately $65 for QC and TC++, and range from approximately $400 for the more popular professional models. You can pay thousands of dollars for a custom command line compiler. Shareware compilers are available. The two most popular are Small C and GNU C/C++. While these are available for the price of a download, I hesitate to recommend either one of these for a beginner. Small C is old has almost no functionality and is primarily designed to show how a compiler is built not to be actually used. Small C creates and assembly code that uses another shareware assembler to create the actual executable file. GNU C/C++ ( Delorie C/C++ ) is a free compiler that was developed for the UNIX system, and adapted to run on DOS protected mode. It requires special configuration settings during boot up, and requires an interpreter to run its output files on DOS. It is full featured and includes several libraries and a debugger. None of which is integrated, and very poorly or non existent documentation. IS THIS INFORMATION UP TO DATE, AND WHERE CAN I GET MORE INFORMATION Stop by the America OnLine PC Development Forum keyword < PDV > and chat to one of the forum hosts. Ask others that program, as well as sales representatives. Read brochures and send away for information. An educated buyer creates a better program that raises the esteem of all programmers. Turbo C++ and Borland C++ are registered trademarks of Borland International. Visual C++ and QuickC are registered trademarks and Windows is a trademark of Microsoft Corporation. Symantec C++, Zortech C/C++ are registered trademarks of Symantec Corporation. AOL and America OnLine are registered trademarks of America OnLine.