Practices
  Home arrow Practices arrow Basic Ideas
Dev Shed Forums  
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
VPS Hosting  
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid  
Request Media Kit
Contact Us  
Site Map  
Privacy Policy  
Support  
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
Google.com  
PRACTICES

Basic Ideas
By: Apress Publishing
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 16
    2005-03-23


    Table of Contents:
  • Basic Ideas
  • Interpreted vs. Compiled Program Execution
  • A Simple C Program
  • Names Using Extended Character Sets
  • C Statements and Statement Blocks
  • Creating an Executable from Your Source Files
  • C Source Characters
  • Whitespace in Statements
  • Procedural and Object-Oriented Programming

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article

     
     
    ADVERTISEMENT


    Basic Ideas
    ( Page 1 of 9 )

    This article will give you a good understanding of the basic concepts and practices of the C++ language, so that you will have the foundation to eventually learn these ideas in detail as you continue working with the language. It is excerpted from Ivor Horton's Beginning ANSI C++ The Complete Language (Apress, 2004; ISBN 1590592271).

    AT FIRST SIGHT, a connection between learning C++ programming and poultry would seem to be unlikely, but there is—it’s the chicken-and-egg problem. Particularly in the early stages of understanding C++, you’ll often have to make use of things in examples before you properly understand them. This chapter is intended to solve the chicken-and-egg problem by giving you an overview of the C++ language and how it hangs together, and by introducing a few of the working concepts for things that you’ll be using before you have a chance to understand them in detail.

    All the concepts that you’ll read about here are covered in more detail in later chapters. Most of this information is just to set the scene before you get into the specifics of writing C++ programs. You’ll see what a simple C++ program looks like, and then you’ll pull it to pieces to get a rough idea of what the various bits do. You’ll also look at the broad concepts of programming in C++ and how you create an executable program from the source code files you’ll be writing.

    Don’t try to memorize all the information in this chapter. Concentrate on getting a feel for the ideas presented here. Everything mentioned in this chapter will come up again in later chapters. Here’s an overview of what this chapter covers:

    • What the features of C++ are that make it so popular

    • What the elements of a basic C++ program are

    • How to document your program source code

    • How your source code becomes an executable program

    • How object-oriented programming differs from procedural programming

    Programming Languages

    You’re probably familiar with the basic ideas of programming and programming languages, but to make sure we’re on common ground, let’s do a quick survey of some of the terms you’ll encounter as you progress through the book. You can also put C++ into perspective in relation to some of the other programming languages you’ll have heard of.

    There are lots of programming languages, each with its advantages and disadvantages, and its protagonists and detractors. Along with C++, other languages that you’re likely to have come across include Java, BASIC (an acronym for Beginner’s All-purpose Symbolic Instruction Code), COBOL (an acronym for Common Business-Oriented Language), FORTRAN (an acronym for formula translator), Pascal (after Blaise Pascal, a French mathematician), and C (simply because it was a successor to a language called B). All of these are referred to collectively as high-level languages, because they’re designed to make it easy for you to express what the computer is to do, and they aren’t tied to a particular computer. Each source statement in a high-level language will typically map to several native machine instructions. A low-level language is one that is close to the native machine instructions and is usually referred to as an assembler language. A given assembler language will be specific to a particular hardware design, and typically one assembler instruction will map to one native machine instruction.

    A Potted History

    FORTRAN was the first high-level language to be developed, and the first FORTRAN compiler was written in the late 1950s. Even though FORTRAN has been around for over 40 years, it’s still used today for scientific and engineering calculations although C++ and other languages have eroded much of its usage.

    COBOL is a language exclusively for business data processing applications, and it’s almost as old as FORTRAN. Although relatively little new code is written in COBOL, there is an immense amount of code that was written years ago that’s still in use and still has to be maintained. Again, C++ has become the language of choice for many business data processing programs.

    BASIC emerged in the 1970s when the idea of a personal computer was being conceived. Interestingly, the first product sold by Microsoft was a BASIC interpreter. The ease of use inherent in the language resulted in a rapid growth in its popularity that continues to this day.

    Java was developed in the 1990s. Its original incarnation as a language called Oak was really intended for programming small consumer electronics devices. In 1995 Oak evolved into the Java language for embedding code in web pages and from there into what it is today. The primary reason for the success of Java is its portability. A Java program can run unchanged on any hardware platform that supports it. The syntax of the Java language has many characteristics that make it look similar to C++, but there are significant differences. Although Java gains over C++ on portability, it can’t match C++ in execution performance.

    C was developed in the early 1970s as a high-level language that could be used for low-level programming, such as implementing operating systems. Most of the Unix operating system is written in C.

    C++ was developed by Bjarne Stroustrup in the early 1980s as an object-oriented language based on C. Hence the name, C++, which in C++ means C incremented. Because C++ is based on C, the two languages share a common subset of syntax and functionality, and all of the capabilities in C for low-level programming are retained in C++. However, C++ is a much richer and more versatile language than its ancestor. The vastly improved memory management features and the object-oriented capabilities of C++ means that C functionality represents a very small subset of C++. C++ is still unrivaled in scope, performance, and power. For this reason, the majority of high-performance applications and systems are still written in C++ today.

    This article is excerpted from Beginning ANSI C++ The Complete Language by Ivor Horton (Apress, 2004; ISBN  1590592271). Check it out at your favorite bookstore today. Buy this book now.



     
     
    >>> More Practices Articles          >>> More By Apress Publishing
     

       

    PRACTICES ARTICLES

    - More Techniques for Finding Things
    - Finding Things
    - Finishing the System`s Outlines
    - The System in So Many Words
    - Basic Data Types and Calculations
    - What`s the Address? Pointers
    - Design with ArgoUML
    - Pragmatic Guidelines: Diagrams That Work
    - Five-Step UML: OOAD for Short Attention Span...
    - Five-Step UML: OOAD for Short Attention Span...
    - Introducing UML: Object-Oriented Analysis an...
    - Class and Object Diagrams
    - Class Relationships
    - Classes
    - Basic Ideas





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 2 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek