1intro.pdf - CS225 Data Structures and Software Engineering Introduction to C Jason Zych c 2001 1999 Jason Zych 2 Chapter 1 Introduction to C 1.1 Why C

1intro.pdf - CS225 Data Structures and Software Engineering...

This preview shows page 1 - 5 out of 10 pages.

CS225 : Data Structures and Software Engineering Introduction to C++ Jason Zych
c 2001, 1999 Jason Zych 2
Chapter 1 Introduction to C++ 1.1 Why C++? In this class, the data structures you learn will be taught from a general viewpoint, and the lessons you learn will be applicable regardless of the particular programming language you use. However, we do want to give you actual programming practice with these ideas as well, and in order to do that, we need to choose some language to use. So, why C++ and not Java? Well, there are three reasons: 1. First, independent of any particular language merits, knowing C++ will be helpful for you in the future just as knowing Java will be helpful for you in the future. At the completion of the first two software courses – CS125 and CS225 – you will know the two most widely used “new” languages and will be prepared to use either language in future courses and research, and also in industry work (whether job or internship). From that point of view, knowing only Java after the first two software courses would not be as beneficial for you. In addition, C++ is more or less a subset of an older language, C. Certain things you can do in C still can be done in C++, but they tend to go unused in favor of new features. However, the basics are still the same, and since a great deal of today’s legacy code is written in C, if you have a project in the future that requires you to know C, you already have a significant head start. So, before we even get into the “learn C++ for what the language itself can teach you” arguments, the case can be made that knowing C++ will likely be quite helpful for you in the future simply due to its usage in much software in the real world. 2. Second, and more importantly, there are features and concepts that are in C++ and not in Java, or that are similar to those in Java but implemented differently, and it is helpful to be familiar with those ideas. In particular, the concept of pointers – an idea not present in Java – carries with it a large number of other concepts that need to be learned, not the least of which is a solid idea of what is really going on in the computer’s memory as your program compiles and runs. This is an idea that can be glossed over in Java due to Java’s high level of abstraction. C++ has a slightly lower level of abstraction in many cases – you can program in a high-level of abstraction, but you can also explore more details in an effort to optimize your software. Learning these ideas will give you a better understanding of the interface between programs, compilers, and memory, and therefore will serve as a nice introduction to future courses, where you will be exploring machine architecture and 3
compilers in greater detail. Further, with every language you learn, the next language becomes easier to learn, and so learning the differences between C++ and Java will not only mean you know C++ for its sake, but it will help build the ability to learn new languages and ideas quickly, which is a skill that is useful in coursework, research, and industry alike.

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture