280 likes | 293 Views
Advanced Program Design with C++. Part 0: Introduction to the course Introduction to C++. Introduction to the Course. Introduction to the course: Instructor . Name: Joey Paquet Position: Associate Professor, Department of Computer Science and Software Engineering
E N D
Advanced Program Design with C++ Part 0: Introduction to the course Introduction to C++ Joey Paquet, 2007-2016
Introduction to the Course Joey Paquet, 2007-2016
Introduction to the course: Instructor • Name: Joey Paquet • Position: Associate Professor, Department of Computer Science and Software Engineering • Teaching topics: Programming languages, Compiler design, Software engineering and programming methodology • Research topics: Design and implementation of programming languages, Parallel and/or distributed computing, Demand-driven computation, Context-driven computation • Contact information: • Web: www.cse.concordia.ca/~paquet • E-mail: paquet@cse.concordia.ca • Office: EV 3-221 • Office hours: Wednesdays 10am-12pm Joey Paquet, 2007-2016
Introduction to the course: Calendar description • Prerequisite: COMP 352 previously or concurrently. Introduction to C++. I/O with stream classes. Pointers and their uses. The Standard Template Library (STL): containers, algorithms, iterators, adaptors, function objects. Class design: constructors, destructors, operator overloading, inheritance, virtual functions, exception handling, memory management. Advanced topics: libraries, locales, STL conventions, concurrency, template metaprogramming. Applications of C++: systems, engineering, games programming. Project. Lectures: three hours per week. Laboratory: two hours per week. Joey Paquet, 2007-2016
Introduction to the course: Rationale • Most of our courses are taught using the Java programming language. • C++ programming is pervasive in many key areas of the software industry: • Computer games and entertainment industry • Audio/Video processing • Computer device drivers • Control systems • Telecommunications systems • Embedded software systems • Simulation systems • Medical imaging • Though C++ and Java have many similar syntactical elements and structures, C++ has many subtleties, technicalities and features that differ from Java. • Most importantly, its implementation and runtime systems is very different from Java, which makes it well-adapted to the application areas mentioned previously. • This course aims at teaching C++ to an audience well-trained in computer programming and putting the newly acquired knowledge into practice through a challenging project. Joey Paquet, 2007-2016
Introduction to the course: Project • The project is to be undertaken by small teams (2 members) and consists of the building of a relatively large and complex C++ application. • The completion of the project is divided into 4-5 assignments, each of which implementing a part of the project. • Thus, each new assignment builds upon the code developed in the previous assignments. • During the project deliveries, you also have to demonstrate that your code includes many of the C++ features presented in the lectures. Joey Paquet, 2007-2016
Introduction to the course: Graduate attributes • As part of both the Computer Science and Software Engineering program curriculum accreditation, the content of this course includes material and exercises related to the teaching and evaluation of graduate attributes. • Graduate attributes are skills that have been identified by the Canadian Engineering Accreditation Board (CEAB) and the Canadian Information Processing Society (CIPS) as being central to the formation of Engineers, computer scientists and information technology professionals. • The accreditation criteria for the Software Engineering and Computer Science programs dictate that graduate attributes are taught and evaluated as part of the courses. • This particular course aims at teaching and evaluating 5 graduate attributes. The following is a description of these attributes, along with a description of how these attributes are incorporated in the course. Joey Paquet, 2007-2016
Introduction to the course: Graduate attributes • Graduate attribute 1: Knowledge-base • Definition: Demonstrated competence in university level mathematics, natural sciences, engineering fundamentals, and specialized engineering knowledge appropriate to the program. • Application of advanced programming principles using a mid-level programming language. Use of design patterns and architectural design. Manual/explicit memory management. Language/compiler/runtime system implementation concepts and details. • Indicator 1.3: Knowledge-base in a specific domain Joey Paquet, 2007-2016
Introduction to the course: Graduate attributes • Graduate attribute 4: Design • Definition: the ability to use appropriate knowledge and skills to identify, analyze, and solve complex engineering problems in order to reach substantiated conclusions. • The project in this course is defined in a way that requires the students to analyze the problem at hand before and determine for themselves exactly what needs to be done, and then determine how and with the help of what tools and software libraries it can be achieved. • Indicator 4.1: Problem identification and information gathering • Indicator 4.3: Architectural and detailed design • Indicator 4.4: Implementation and validation Joey Paquet, 2007-2016
Introduction to the course: Graduate attributes • Graduate attribute 5: Use of tools • Definition: the ability to create, select, apply, adapt, and extend appropriate techniques, resources, and modern engineering tools to a range of engineering activities, from simple to complex, with an understanding of the associated limitations. • The course teaches the use of the C++ language, and leaves the students free to select what programming environment and libraries that they will use in the assignments and project. Selection and use of the right tools and libraries is a crucial aspect of accomplishing the practical work. • Indicator 5.1: Ability to use appropriate tools, techniques and resources • Indicator 5.2: Ability to select appropriate tools, techniques, and resources Joey Paquet, 2007-2016
Introduction to the course: Graduate attributes • Graduate attribute 6: Individual and team work • Definition: Ability to work effectively as a member and leader in teams, preferably in a multi-disciplinary setting. • Work on a relatively large project, as well as on individual assignments related to the project. • Indicator 6.4: Delivering results Joey Paquet, 2007-2016
Introduction to the course: Graduate attributes • Graduate attribute 7: Communication skills • Definition: Ability to communicate complex engineering concepts within the profession and with society at large. Such abilities include reading, writing, speaking and listening, and the ability to comprehend and write effective reports and design documentation, and to give and effectively respond to clear instructions. • Proper code documentation using code comments, as well as simple description of design decisions. Oral presentations for project deliveries. • Indicator 7.3: Documentation • Indicator 7.4: Oral presentation Joey Paquet, 2007-2016
Introduction to the course: Evaluation • Evaluation components: • Written midterm examination: 35% • Final programming test: 35% • Assignments (4-5): 4-5 X 5-10% 30% • Additional conditions to pass the course: • Overall mark at least 50% • Write the final programming test Joey Paquet, 2007-2016
Introduction to the course: Bibliography • Y. Daniel Liang. Introduction to Programming with C++. Third Edition, Prentice-Hall, 2014. ISBN-13: 978-0-13-325281-1 • Walter Savitch. Absolute C++. Fifth Edition, Addison-Wesley, 2013. ISBN-13: 978-0-13-283071-3 • Walter Savitch. Problem Solving with C++. Ninth Edition, Pearson, 2014. ISBN-13: 978-0-13-379174-3 • Bjarne Stroustrup. A Tour of C++. Addison-Wesley, 2014. ISBN-13: 978-0-321-958310 • Bjarne Stroustrup. The C++ Programming Language. Fourth edition. Addison-Wesley, 2013. ISBN-13: 978-0-321-56384-2 • Bjarne Stroustrup. Foundations of C++. Proc. 22nd European Symposium on Programming (ESOP). Springer LNCS 7211. April 2012. • Bjarne Stroustrup. A history of C++: 1979--1991. In History of programming languages---II, Thomas J. Bergin, Jr. and Richard G. Gibson, Jr. (Eds.). ACM, New York, NY, USA 699-769. 1996. DOI:10.1145/234286.1057836 • Bjarne Stroustrup. The Design and Evolution of C++. Addison Wesley, ISBN:0-201-54330-3. March 1994 Joey Paquet, 2007-2016
Introduction to the course: Bibliography • Bjarne Stroustrup. Adding Classes to C: An Exercise in Language Evolution. Software – Practice and Experience, Vol. 13, pp. 139-161, 1983. • Bjarne Stroustrup. Classes: an abstract data type facility for the C language. SIGPLAN Not. 17, 1. January 1982, 42-51. DOI:10.1145/947886.947893 Joey Paquet, 2007-2016
Introduction to C++ History Features and goals Significance Tools Joey Paquet, 2007-2016
Introduction to C++ • C++ is a statically typed, multi-paradigm, compiled, general-purpose programming language. • It is a middle-level language, as it comprises a combination of both high-level and low-level language features. • It was developed by Bjarne Stroustrup starting in 1979 at Bell Laboratories as an enhancement to the C programming language following the object-oriented principles pioneered by Simula. BjarneStrousroup Joey Paquet, 2007-2016
Introduction to C++: Principles and goals • Bjarne Stroustrup describes some principles that he used for the design of C++: • Statically typed, general-purpose language, as efficient and portable as C • Direct and comprehensive support for multiple programming styles (procedural programming, data abstraction, object-oriented programming, and generic programming) • Give the programmer choice, even if this makes it possible for the programmer to choose incorrectly • As compatible with C as possible, providing a smooth transition from C • Avoid features that are platform specific or not general purpose • Not incur overhead for features that are not used • Function without a sophisticated programming environment • Goals: • Augment C with the notion of classes and inheritance • Keep the same performance as C • Keep same applicability as C Joey Paquet, 2007-2016
Introduction to C++: History, versions • Stroustrup began to work on C++ in 1979. • The idea of creating a new language originated from Stroustrup's experience in programming for his Ph.D. thesis. • Stroustrup found that Simula had features that were very helpful for large software development, but the language was too slow for practical use. • Remembering his Ph.D. experience, Stroustrup set out to enhance the C language with Simula-like features. • C was chosen because it was general-purpose, fast, portable and widely used. • Besides C and Simula, some other languages that inspired him were ALGOL 68 (as most modern programming languages), Ada (templates), CLU (exception handling, templates) and ML (lambda expressions). Joey Paquet, 2007-2016
Introduction to C++: History, versions • Initial modifications to C included (1980): • type checking and conversion for function parameters • classes: data structures (struct) encapsulating functions • derived classes (inheritance) • public/private access modifiers • constructors/destructors • friend classes • Later added (1981): • inline functions • default function parameters • overloading of assignment operator • The resulting language was named "C with Classes“ • Further evolutions (1983-1984): • virtual methods and dynamic binding mechanism • method and operator overloading • reference types • After this, the language was renamed as “C++”. Joey Paquet, 2007-2016
Introduction to C++: History, versions • Commercial implementations: • Release 1.0 (1985): • implemented as a C++ to C language translation system called Cfront • Release 2.0 (1989): • multiple inheritance, • abstract classes, • static member functions, • const member functions, • protected members • Release 3.0 (1990): • templates • exception handling • namespaces • new type cast operations • Boolean type Joey Paquet, 2007-2016
Introduction to C++: History, versions • Standards: • C++98 (1998): First C++ standard • C++03 (2003): Minor revision • C++11 (2011): Major revision • C++14 (2014): Small extension of C++11 Joey Paquet, 2007-2016
Introduction to C++: Positive and negative aspects • Positive aspects: • General purpose language • Language implementation focus on high performance and lean runtime system • Provides both high-level abstraction and low-level programming features • Popularity and availability of tools • Negative aspects: • Very large and complex language that requires deep technical knowledge in order to properly use it • Its low-level capacities and focus on efficiency make it an unsecure language • Many C++ developments, such as the Standard Template Library add features that add security and abstraction, and free the programmer from low-level programming, but to the detriment of performance compared to C Joey Paquet, 2007-2016
Introduction to C++: Popularity and significance • Factors for popularity: • C++ is a superset of C: a C++ compiler can compile C programs, and C code and libraries can be reused in C++ classes and programs • C++ was designed for performance similar with C • A great number of reliable C++ compilers are available for most platforms • C++ was the first object-oriented programming language suitable for the development of large commercial software • A very wide array of C++ libraries are available, both for general use and for specialized purposes • An enormous amount of C++ code has been written, which in turn either makes it prone to reuse or binds the developers to the language Joey Paquet, 2007-2016
Introduction to C++: Popularity and significance • C++ is widely used in the software industry. • In terms of usage, is one of the most popular languages ever created. • Some of its application domains include key areas of software development such as systems software, device drivers, application software, embedded software, high-performance server and client applications, video and audio processing, and entertainment software such as video games and computer animation. • C++ continues to be one of the preferred programming languages to develop professional applications. • The language has gone from being initially mostly Western to attracting programmers from all over the world. Joey Paquet, 2007-2016
Introduction to C++: Tools • Compilers and IDEs • Apple Xcode C++ • Bloodshed Dev-C++ • Code::Blocks • Cygwin • Eclipse for C++ • MINGW - "Minimalist GNU for Windows" • GNU CC • The LLVM Compiler Infrastructure • Microsoft Visual C++ 2010 • Sun Studio NetBeans Joey Paquet, 2007-2016
Introduction to C++: Libraries • General • Boost • MFC: Microsoft Foundation classes • STL: Standard Template Library • GUI • MFC GUI • Qt • SFML • WxWidgets Joey Paquet, 2007-2016
Introduction to C++: References • International Organization for Standardization. ISO/IEC 14882:1998 Programming languages – C++. 1998. • International Organization for Standardization. ISO/IEC 14882:1998 Programming languages – C++. 2003. • International Organization for Standardization. ISO/IEC 14882:1998 Information technology -- Programming languages – C++. 2011. • Bjarne Stroustrup. A Tour of C++. Addison-Wesley, 2014. ISBN-13: 978-0-321-958310 • Bjarne Stroustrup. The Design and Evolution of C++. Addison Wesley, ISBN:0-201-54330-3. March 1994 • Bjarne Stroustrup. A history of C++: 1979--1991. In History of programming languages---II, Thomas J. Bergin, Jr. and Richard G. Gibson, Jr. (Eds.). ACM, New York, NY, USA 699-769. 1996. DOI:10.1145/234286.1057836 • Bjarne Stroustrup, The C++ Programming Language. Fourth edition. Addison-Wesley, 2013. ISBN-13: 978-0-321-56384-2 Joey Paquet, 2007-2016