Chapter 22 - Software ideals and history Software Bjarne...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Software ideals and history Software Bjarne Stroustrup Abstract Abstract This is a very brief and very selective history of This software as it relates to programming, and especially as it relates to programming languages and C++. The aim is to give a background and a perspective to the ideas presented in this course. ideas We would have loved to talk about operating systems, We data bases, networking, the web, scripting, etc., but you’ll have to find those important and useful areas of software and programming in other courses. software Stroustrup/Programming 2 Overview Overview Ideals Aims, heroes, techniques Languages and language designers Early languages to C++ (There is so much more than what we can cover) Stroustrup/Programming 3 History and ideas History One opinion Another opinion History is bunk He who does not know history is condemned to repeat it Our view There can be no professionalism without history There no If you know too little of the background of your field you are If gullible gullible History is littered with plausible ideas that didn’t work “I have a bridge I’d like to sell you” Ideas and ideals are crucial for practical use And they are the real “meat” of history Stroustrup/Programming 4 What is a programming language? What A tool for instructing machines A notation for algorithms A means for communication among programmers A tool for experimentation A means for controlling computer-controlled gadgets A means for controlling computerized devices A way of expressing relationships among concepts A means for expressing high-level designs All of the above! And more Stroustrup/Programming 5 Greek heroes Greek Every culture and profession must have ideals and heroes Physics: Newton, Einstein, Bohr, Feynman Math: Euclid, Euler, Hilbert Medicine: Hippocrates, Pasteur, Fleming Stroustrup/Programming 6 Geek heroes Geek Brian Kernighan Programmer and writer Programmer extraordinaire extraordinaire Stroustrup/Programming Dennis Ritchie Designer and original Designer implementer of C implementer 7 Another geek hero Another Kristen Nygaard Co-inventor (with OleJohan Dahl) of Simula67 Johan and of object-oriented Programming and object-oriented design object-oriented Stroustrup/Programming 8 Yet another geek hero Yet Alex Stepanov Inventor of the STL and Inventor generic programming pioneer pioneer Stroustrup/Programming 9 Two extremes Two Academic beauty/perfection/purity Commercial expediency The pressures towards both are immense Both extremes must be avoided for serious progress to occur Both extremes encourage overstatement of results (hype) and Both understatement (or worse) of alternatives and ancestor languages understatement Stroustrup/Programming 10 Ideals Ideals The fundamental aims of good design Represent ideas directly in code Represent independent ideas independently in code Represent relationships among ideas directly in code Combine ideas expressed in code freely From these follow where and only where combinations make sense where Correctness Maintainability Performance Apply these to the widest possible range of applications Stroustrup/Programming 11 Ideals have practical uses Ideals During the start of a project, reviews them to get ideas When you are stuck late at night, step back and see When where your code has most departed from the ideals – this is where the bugs are most likely to lurk and the design problems are most likely to occur design Don’t just keep looking in the same place and trying the Don’t same techniques to find the bug same “The bug is always where you are not looking – or you would have The not found it already” found Stroustrup/Programming 12 Ideals are personal Ideals Chose yours well Stroustrup/Programming 13 Styles/paradigms Styles/paradigms Procedural programming Data abstraction Object-oriented programming Generic programming Functional programming, Logic programming, rulebased programming, constraints-based programming, based aspect-oriented programming, … aspect-oriented Stroustrup/Programming 14 Styles/paradigms Styles/paradigms template<class Iter> void draw_all(Iter b, Iter e) { for_each(b,e,mem_fun(&Shape::draw)); // draw all shapes in [b:e) for_each(b,e,mem_fun(&Shape::draw)); draw } Point p(100,100); Shape* a = { new Circle(p,50), new Rectangle(p, 250, 250) }; draw_all(a,a+2); Which programming styles/paradigms did we use here? Procedural, data abstractions, OOP, and GP Stroustrup/Programming 15 Some fundamentals Some Portability is good Type safety is good High performance is good Anything that eases debugging is good Access to system resources is good Stability over decades is good Ease of learning is good Small is good Whatever helps analysis is good Having lots of facilities is good You can’t have all at the same time: engineering tradeoffs Stroustrup/Programming 16 Programming languages Programming Machine code Assembler First: Fortran and COBOL Rate of language invention Registers, load, store, integer add, floating point add, … Each new machine had its own assembler Higher level languages Bits, octal, or at most decimal numbers At least 2000 a decade Major languages today Really solid statistics are hard to come by IDS: about 9 million professional programmers COBOL, Fortran, C, C++, Visual Basic, PERL, Java, Javascript Ada, C#, PHP, … Stroustrup/Programming 17 Early programming languages Early 1950s: 1960s: 1970s: Simula Lisp Algol60 Algol68 Fortran Pascal BCPL COBOL Classic C PL\1 Red==major commercial use Yellow==will produce important “offspring” Stroustrup/Programming 18 Modern programming languages Modern Lisp Smalltalk Python PHP Fortran77 Simula67 C89 Java95 Eiffel C++ Ada Pascal COBOL89 Java04 C++0x C++98 Ada98 C# Object Pascal COBOL04 Visual Basic Stroustrup/Programming PERL Javascript 19 Why do we design and evolve languages? Why There are many diverse applications areas Programmers have diverse backgrounds and skills Over the years, computers are applied in new areas and to new problems Computers change No one language can be best for everybody Problems change No one language can be the best for everything Over the decades, hardware characteristics and tradeoffs change Progress happens Over the decades, we learn better ways to design and implement Over languages languages Stroustrup/Programming 20 First modern computer – first compiler First David Wheeler University of Cambridge Exceptional problem solver: hardware, software, algorithms, libraries First computer science Ph.D. (1951) (Thesis advisor for Bjarne Stroustrup ) (Thesis Stroustrup/Programming 21 Early languages – 1952 Early One language for each machine Special features for processor Special features for “operating system” Most had very assembler-like facilities It was easy to understand which instructions would be generated No portability of code Stroustrup/Programming 22 Fortran Fortran John Backus IBM FORTRAN, the first high level computer language to be developed. We did not know what we wanted and how to do it. It just sort of grew. We The Backus-Naur Form (BNF), a standard notation to describe the The syntax of a high level programming language. A functional programming language called FP, which advocates a functional mathematical approach to programming. mathematical Stroustrup/Programming 23 23 Fortran – 1956 Fortran Allowed programmers to write linear algebra much as they Allowed found it in textbooks found Arrays and loops Standard mathematical functions Fortran code could often be moved from computer to computer with Fortran only minor modification only This was a huge improvement This huge Users’ own functions The notation was largely machine independent libraries Arguably the largest single improvement in the history of programming Arguably languages languages Continuous evolution: II, IV, 77, 90, 0x Stroustrup/Programming 24 COBOL COBOL “Rear Admiral Dr. Grace Murray Hopper (US Rear Navy) was a remarkable woman who grandly rose to the challenges of programming the first computers. During her lifetime as a leader in the field of software development concepts, she contributed to the transition from primitive programming techniques to the use of sophisticated compilers. She believed that ‘we've always done it that way’ was not necessarily a good reason to continue to do so.” Stroustrup/Programming 25 25 Cobol – 1960 Cobol Cobol was (and sometimes still is) for business programmers Cobol what Fortran was (and sometimes still is) for scientific programmers programmers The emphasis was on data manipulation Copying Storing and retrieving (record keeping) Printing (reports) Calculation/computation was seen as a minor matter It was hoped/claimed that Cobol was so close to business It English that managers could program and programmers would soon become redundant soon Continuous evolution: 60, 61, 65, 68, 70, 80, 90, 04 Stroustrup/Programming 26 Lisp Lisp John McCarthy Stanford University AI pioneer Stroustrup/Programming 27 Lisp – 1960 Lisp List/symbolic processing Initially (and often still) interpreted Dozens (most likely hundreds) of dialects “Lisp has an implied plural” Common Lisp Scheme This family of languages has been (and is) the This mainstay of artificial intelligence (AI) research mainstay though delivered products have often been in C or C++ Stroustrup/Programming 28 Algol Algol Peter Naur Danish Technical University and Regnecentralen BNF Edsger Dijkstra Mathematisch Centrum, Amsterdam, Eindhoven University of Mathematisch Technology, Burroughs Corporation , University of Texas (Austin) Technology, Mathematical logic in programming, algorithms THE operating system Stroustrup/Programming 29 Algol – 1960 Algol The breakthrough of modern programming language concepts Language description Scope Type The notion of “general purpose programming language” BNF; separation of lexical, syntactic, and semantic concerns Before that languages were either scientific (e.g., Fortran), business (e.g., Before Cobol), string manipulation (e.g., Lisp), simulation, … Cobol), Never reached major non-academic use Simula67 Algol58 Algol60 Stroustrup/Programming Algol68 Pascal 30 Simula 67 Simula Kristen Nygaard and Ole-Johan Dahl Norwegian Computing Center Oslo University The start of object-oriented programming and object-oriented design Stroustrup/Programming 31 Simula 1967 Simula Address all applications domains rather then a specific domain Model real-world phenomena in code As Fortran, COBOL, etc. did Aims to become a true general-purpose programming language represent ideas as classes and class objects represent hierarchical relations as class hierarchies Classes, inheritance, virtual functions, object-oriented design A program becomes a set of interacting objects rather than a program monolith monolith Has major (positive) implications for error rates Stroustrup/Programming 32 Dennis Ritchie Bell Labs C and helped with Unix C Ken Thompson Bell Labs Unix Doug McIlroy Bell Labs Everybody’s favorite critic, Everybody’s discussion partner, and ideas man (influenced C, C++, Unix, and much more) more) Stroustrup/Programming 33 Bell Labs – Murray Hill Bell Stroustrup/Programming 34 C – 1978 1978 (Relatively) high-level programming language for systems (Relatively) programming programming Very widely used, relatively low-level, weakly typed, systems Very programming language programming Associated with Unix and through that with Linux and the open source Associated movement movement Performance becomes somewhat portable Designed and implemented by Dennis Ritchie 1974-78 Bjarne Stroustrup, BTL, 1985 Dennis Ritchie, BTL, 1974 Ken Thompson, BTL, 1972 C++ C89 CPL BCPL B C++98 C++0x C99 Classic C Martin Richards, Cambridge, 1967 Christopher Strachey, Cambridge, mid-1960s Stroustrup/Programming 35 C++ C++ Bjarne Stroustrup AT&T Bell labs Texas A&M University making abstraction techniques affordable and making manageable for mainstream projects pioneered the use of object-oriented and generic pioneered programming techniques in application areas where efficiency is a premium Stroustrup/Programming 36 36 My ideals – in 1980 and still in 2008 in “To make life easier for the serious programmer” i.e., primarily me and my friends/colleagues I love writing code I like reading code I hate debugging Elegant and efficient code I really dislike choosing between the two Elegance, efficiency, and correctness are closely related Elegance, in many application domains in Inelegance/verbosity is a major source of bugs and inefficiencies Stroustrup/Programming 37 C++ – 1985 C++ C++ is a general-purpose programming language C++ with a bias towards systems programming that with is a better C supports data abstraction supports object-oriented programming supports generic programming C++98 1978-89 ARM C++ Classic C C with Classes Simula 67 C++0c C++ 1979-84 Stroustrup/Programming 1989 38 More information More More language designer links/photos A few examples of languages: Textbooks Michael L. Scott, Programming Language Pragmatics, Morgan Michael Programming Morgan Kaufmann, 2000, ISBN 1-55860-442-1 Kaufmann, Robert W. Sebesta, Concepts of programming languages, Robert Concepts Addison-Wesley, 2003, ISBN 0-321-19362-8 Addison-Wesley, History books Jean Sammet, Programming Languages: History and Jean Fundamentals, Prentice-Hall, 1969, ISBN 0-13-729988-5 Fundamentals Richard L. Wexelblat, History of Programming Languages, Richard History Academic Press, 1981, ISBN 0-12-745040-8 Academic T. J. Bergin and R. G. Gibson, History of Programming T. Languages – II, Addison-Wesley, 1996, ISBN 0-201-89502-1 Languages Stroustrup/Programming 39 ...
View Full Document

This note was uploaded on 02/18/2012 for the course CSCE 121 taught by Professor Walter daugherity during the Fall '09 term at Texas A&M.

Ask a homework question - tutors are online