Generative AI for Technical Writer or Information Developers
22 ideals
1. Software ideals and historySoftware ideals and history
Bjarne StroustrupBjarne Stroustrup
www.stroustrup.com/Programmingwww.stroustrup.com/Programming
Arun Prakash MArun Prakash M - GUVI- GUVI
( Tamil Narration)( Tamil Narration)
3. OverviewOverview
IdealsIdeals
Aims, heroes, techniquesAims, heroes, techniques
Languages and language designersLanguages and language designers
Early languages to C++Early languages to C++
(There is so much more than(There is so much more than
what we can cover)what we can cover)
44Stroustrup/ProgrammingStroustrup/Programming
4. History and ideasHistory and ideas
One opinionOne opinion
History is bunkHistory is bunk
Another opinionAnother opinion
He who does not know history is condemned to repeat itHe who does not know history is condemned to repeat it
Our viewOur view
There can beThere can be no professionalism without historyno professionalism without history
If you know too little of the background of your field you areIf you know too little of the background of your field you are
gulliblegullible
History is littered with plausible ideas that didn’t workHistory is littered with plausible ideas that didn’t work
““I have a bridge I’d like to sell you”I have a bridge I’d like to sell you”
Ideas and ideals are crucial for practical useIdeas and ideals are crucial for practical use
And they are the real “meat” of historyAnd they are the real “meat” of history
55Stroustrup/ProgrammingStroustrup/Programming
5. What is a programming language?What is a programming language?
A tool for instructing machinesA tool for instructing machines
A notation for algorithmsA notation for algorithms
A means for communication among programmersA means for communication among programmers
A tool for experimentationA tool for experimentation
A means for controlling computer-controlled gadgetsA means for controlling computer-controlled gadgets
A means for controlling computerized devicesA means for controlling computerized devices
A way of expressing relationships among conceptsA way of expressing relationships among concepts
A means for expressing high-level designsA means for expressing high-level designs
All of the above!All of the above!
And moreAnd more
66Stroustrup/ProgrammingStroustrup/Programming
6. Greek heroesGreek heroes
Every culture and profession must have ideals and heroesEvery culture and profession must have ideals and heroes
Physics: Newton, Einstein, Bohr, FeynmanPhysics: Newton, Einstein, Bohr, Feynman
Math: Euclid, Euler, HilbertMath: Euclid, Euler, Hilbert
Medicine: Hippocrates, Pasteur, FlemingMedicine: Hippocrates, Pasteur, Fleming
77Stroustrup/ProgrammingStroustrup/Programming
7. Geek heroesGeek heroes
Brian KernighanBrian Kernighan
Programmer and writerProgrammer and writer
extraordinaireextraordinaire
88
Dennis RitchieDennis Ritchie
Designer and originalDesigner and original
implementer of Cimplementer of C
Stroustrup/ProgrammingStroustrup/Programming
8. Another geek heroAnother geek hero
Kristen NygaardKristen Nygaard
Co-inventor (with Ole-Co-inventor (with Ole-
Johan Dahl) of Simula67Johan Dahl) of Simula67
and of object-orientedand of object-oriented
Programming andProgramming and
object-oriented designobject-oriented design
99Stroustrup/ProgrammingStroustrup/Programming
9. Yet another geek heroYet another geek hero
Alex StepanovAlex Stepanov
Inventor of the STL andInventor of the STL and
generic programminggeneric programming
pioneerpioneer
1010Stroustrup/ProgrammingStroustrup/Programming
10. Two extremesTwo extremes
Academic beauty/perfection/purityAcademic beauty/perfection/purity
Commercial expediencyCommercial expediency
The pressures towards both are immenseThe pressures towards both are immense
Both extremes must be avoided for serious progress to occurBoth extremes must be avoided for serious progress to occur
Both extremes encourage overstatement of results (hype) andBoth extremes encourage overstatement of results (hype) and
understatement (or worse) of alternatives and ancestor languagesunderstatement (or worse) of alternatives and ancestor languages
1111Stroustrup/ProgrammingStroustrup/Programming
11. IdealsIdeals
The fundamental aims of good designThe fundamental aims of good design
Represent ideas directly in codeRepresent ideas directly in code
Represent independent ideas independently in codeRepresent independent ideas independently in code
Represent relationships among ideas directly in codeRepresent relationships among ideas directly in code
Combine ideas expressed in code freelyCombine ideas expressed in code freely
where and only where combinations make sensewhere and only where combinations make sense
From these followFrom these follow
CorrectnessCorrectness
MaintainabilityMaintainability
PerformancePerformance
Apply these to the widest possible range ofApply these to the widest possible range of
applicationsapplications
1212Stroustrup/ProgrammingStroustrup/Programming
12. Ideals have practical usesIdeals have practical uses
During the start of a project, reviews them to get ideasDuring the start of a project, reviews them to get ideas
When you are stuck late at night, step back and seeWhen you are stuck late at night, step back and see
where your code has most departed from the ideals –where your code has most departed from the ideals –
this is where the bugs are most likely to lurk and thethis is where the bugs are most likely to lurk and the
design problems are most likely to occurdesign problems are most likely to occur
Don’t just keep looking in the same place and trying theDon’t just keep looking in the same place and trying the
same techniques to find the bugsame techniques to find the bug
““The bug is always where you areThe bug is always where you are notnot looking – or you would havelooking – or you would have
found it already”found it already”
1313Stroustrup/ProgrammingStroustrup/Programming
13. Ideals are personalIdeals are personal
Chose yours wellChose yours well
1414Stroustrup/ProgrammingStroustrup/Programming
15. Styles/paradigmsStyles/paradigms
template<class Iter> void draw_all(Iter b, Iter e)template<class Iter> void draw_all(Iter b, Iter e)
{{
for_each(b,e,mem_fun(&Shape::draw)); //for_each(b,e,mem_fun(&Shape::draw)); // draw all shapes in [b:e)draw all shapes in [b:e)
}}
Point p(100,100);Point p(100,100);
Shape* a[] = { new Circle(p,50), new Rectangle(p, 250, 250) };Shape* a[] = { new Circle(p,50), new Rectangle(p, 250, 250) };
draw_all(a,a+2);draw_all(a,a+2);
Which programming styles/paradigms did we use here?Which programming styles/paradigms did we use here?
Procedural, data abstractions, OOP, and GPProcedural, data abstractions, OOP, and GP
1616Stroustrup/ProgrammingStroustrup/Programming
16. Some fundamentalsSome fundamentals
Portability is goodPortability is good
Type safety is goodType safety is good
High performance is goodHigh performance is good
Anything that eases debugging is goodAnything that eases debugging is good
Access to system resources is goodAccess to system resources is good
Stability over decades is goodStability over decades is good
Ease of learning is goodEase of learning is good
Small is goodSmall is good
Whatever helps analysis is goodWhatever helps analysis is good
Having lots of facilities is goodHaving lots of facilities is good
You can’t have all at the same time: engineering tradeoffsYou can’t have all at the same time: engineering tradeoffs
1717Stroustrup/ProgrammingStroustrup/Programming
17. Programming languagesProgramming languages
Machine codeMachine code
Bits, octal, or at most decimal numbersBits, octal, or at most decimal numbers
AssemblerAssembler
Registers, load, store, integer add, floating point add, …Registers, load, store, integer add, floating point add, …
Each new machine had its own assemblerEach new machine had its own assembler
Higher level languagesHigher level languages
First: Fortran and COBOLFirst: Fortran and COBOL
Rate of language inventionRate of language invention
At least 2000 a decadeAt least 2000 a decade
Major languages todayMajor languages today
Really solid statistics are hard to come byReally solid statistics are hard to come by
IDS: about 9 million professional programmersIDS: about 9 million professional programmers
COBOL, Fortran, C, C++, Visual Basic, PERL, Java, JavascriptCOBOL, Fortran, C, C++, Visual Basic, PERL, Java, Javascript
Ada, C#, PHP, …Ada, C#, PHP, …
1818Stroustrup/ProgrammingStroustrup/Programming
18. Early programming languagesEarly programming languages
1919
Classic C
Simula
Pascal
Algol68
BCPL
Fortran
Lisp
COBOL
Algol60
PL1
1950s: 1960s: 1970s:
Red==major commercial use
Yellow==will produce important “offspring”
Stroustrup/ProgrammingStroustrup/Programming
19. Modern programming languagesModern programming languages
2020
Object Pascal
C++
Java95
C#Ada98
C++98
Java04
C++0x
PythonLisp
Smalltalk
Fortran77
Ada
Eiffel
Simula67
COBOL89
PHP
C89
Pascal
PERL
Visual Basic
COBOL04 Javascript
Stroustrup/ProgrammingStroustrup/Programming
20. Why do we design and evolve languages?Why do we design and evolve languages?
There are many diverse applications areasThere are many diverse applications areas
No one language can be the best for everythingNo one language can be the best for everything
Programmers have diverse backgrounds and skillsProgrammers have diverse backgrounds and skills
No one language can be best for everybodyNo one language can be best for everybody
Problems changeProblems change
Over the years, computers are applied in new areas and to new problemsOver the years, computers are applied in new areas and to new problems
Computers changeComputers change
Over the decades, hardware characteristics and tradeoffs changeOver the decades, hardware characteristics and tradeoffs change
Progress happensProgress happens
Over the decades, we learn better ways to design and implementOver the decades, we learn better ways to design and implement
languageslanguages
2121Stroustrup/ProgrammingStroustrup/Programming
21. First modern computer – first compilerFirst modern computer – first compiler
David WheelerDavid Wheeler
University of CambridgeUniversity of Cambridge
Exceptional problem solver: hardware, software, algorithms, librariesExceptional problem solver: hardware, software, algorithms, libraries
First computer science Ph.D. (1951)First computer science Ph.D. (1951)
First paper on how to write correct, reusable, and maintainable code (1951)First paper on how to write correct, reusable, and maintainable code (1951)
(Thesis advisor for Bjarne Stroustrup(Thesis advisor for Bjarne Stroustrup ))
2222Stroustrup/ProgrammingStroustrup/Programming
22. Early languages – 1952Early languages – 1952
One language for each machineOne language for each machine
Special features for processorSpecial features for processor
Special features for “operating system”Special features for “operating system”
Most had very assembler-like facilitiesMost had very assembler-like facilities
It was easy to understand which instructions would be generatedIt was easy to understand which instructions would be generated
No portability of codeNo portability of code
2323Stroustrup/ProgrammingStroustrup/Programming
23. FortranFortran
John BackusJohn Backus
IBMIBM
FORTRAN, the first high level computer language to be developed.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 did not know what we wanted and how to do it. It just sort of grew.
The Backus-Naur Form (BNF), a standard notation to describe theThe Backus-Naur Form (BNF), a standard notation to describe the
syntax of a high level programming language.syntax of a high level programming language.
A functional programming language called FP, which advocates aA functional programming language called FP, which advocates a
mathematical approach to programmingmathematical approach to programming..
2424Stroustrup/ProgrammingStroustrup/Programming
24. Fortran – 1956Fortran – 1956
Allowed programmers to write linear algebra much as theyAllowed programmers to write linear algebra much as they
found it in textbooksfound it in textbooks
Arrays and loopsArrays and loops
Standard mathematical functionsStandard mathematical functions
librarieslibraries
Users’ own functionsUsers’ own functions
The notation was largely machine independentThe notation was largely machine independent
Fortran code could often be moved from computer to computer withFortran code could often be moved from computer to computer with
only minor modificationonly minor modification
This was aThis was a hugehuge improvementimprovement
Arguably the largest single improvement in the history of programmingArguably the largest single improvement in the history of programming
languageslanguages
Continuous evolution: II, IV, 77, 90, 0xContinuous evolution: II, IV, 77, 90, 0x
2525Stroustrup/ProgrammingStroustrup/Programming
25. COBOLCOBOL
““Rear Admiral Dr. Grace Murray Hopper (USRear Admiral Dr. Grace Murray Hopper (US
Navy) was a remarkable woman who grandlyNavy) was a remarkable woman who grandly
rose to the challenges of programming the firstrose to the challenges of programming the first
computers. During her lifetime as a leader incomputers. During her lifetime as a leader in
the field of software development concepts, shethe field of software development concepts, she
contributed to the transition from primitivecontributed to the transition from primitive
programming techniques to the use ofprogramming techniques to the use of
sophisticated compilers. She believed thatsophisticated compilers. She believed that
‘we've always done it that way’ was not‘we've always done it that way’ was not
necessarily a good reason to continue to do so.”necessarily a good reason to continue to do so.”
2626Stroustrup/ProgrammingStroustrup/Programming
26. Cobol – 1960Cobol – 1960
Cobol was (and sometimes still is) for business programmersCobol was (and sometimes still is) for business programmers
what Fortran was (and sometimes still is) for scientificwhat Fortran was (and sometimes still is) for scientific
programmersprogrammers
The emphasis was on data manipulationThe emphasis was on data manipulation
CopyingCopying
Storing and retrieving (record keeping)Storing and retrieving (record keeping)
Printing (reports)Printing (reports)
Calculation/computation was seen as a minor matterCalculation/computation was seen as a minor matter
It was hoped/claimed that Cobol was so close to businessIt was hoped/claimed that Cobol was so close to business
English that managers could program and programmers wouldEnglish that managers could program and programmers would
soon become redundantsoon become redundant
Continuous evolution: 60, 61, 65, 68, 70, 80, 90, 04Continuous evolution: 60, 61, 65, 68, 70, 80, 90, 04
2727Stroustrup/ProgrammingStroustrup/Programming
27. LispLisp
John McCarthyJohn McCarthy
Stanford UniversityStanford University
AI pioneerAI pioneer
2828Stroustrup/ProgrammingStroustrup/Programming
28. Lisp – 1960Lisp – 1960
List/symbolic processingList/symbolic processing
Initially (and often still) interpretedInitially (and often still) interpreted
Dozens (most likely hundreds) of dialectsDozens (most likely hundreds) of dialects
““Lisp has an implied plural”Lisp has an implied plural”
Common LispCommon Lisp
SchemeScheme
This family of languages has been (and is) theThis family of languages has been (and is) the
mainstay of artificial intelligence (AI) researchmainstay of artificial intelligence (AI) research
though delivered products have often been in C or C++though delivered products have often been in C or C++
2929Stroustrup/ProgrammingStroustrup/Programming
29. AlgolAlgol
Peter NaurPeter Naur
Danish Technical University and RegnecentralenDanish Technical University and Regnecentralen
BNFBNF
Edsger DijkstraEdsger Dijkstra
Mathematisch Centrum, Amsterdam, Eindhoven University ofMathematisch Centrum, Amsterdam, Eindhoven University of
Technology, Burroughs Corporation , University of Texas (Austin)Technology, Burroughs Corporation , University of Texas (Austin)
Mathematical logic in programming, algorithmsMathematical logic in programming, algorithms
THE operating systemTHE operating system
3030Stroustrup/ProgrammingStroustrup/Programming
30. Algol – 1960Algol – 1960
The breakthrough of modern programming language conceptsThe breakthrough of modern programming language concepts
Language descriptionLanguage description
BNF; separation of lexical, syntactic, and semantic concernsBNF; separation of lexical, syntactic, and semantic concerns
ScopeScope
TypeType
The notion of “general purpose programming language”The notion of “general purpose programming language”
Before that languages were either scientific (e.g., Fortran), business (e.g.,Before that languages were either scientific (e.g., Fortran), business (e.g.,
Cobol), string manipulation (e.g., Lisp), simulation, …Cobol), string manipulation (e.g., Lisp), simulation, …
Never reached major non-academic useNever reached major non-academic use
3131
Algol58 Algol60
Simula67
Algol68
PascalStroustrup/ProgrammingStroustrup/Programming
31. Simula 67Simula 67
Kristen Nygaard and Ole-Johan DahlKristen Nygaard and Ole-Johan Dahl
Norwegian Computing CenterNorwegian Computing Center
Oslo UniversityOslo University
The start of object-oriented programming and object-oriented designThe start of object-oriented programming and object-oriented design
3232Stroustrup/ProgrammingStroustrup/Programming
32. Simula 1967Simula 1967
Address all applications domains rather then a specific domainAddress all applications domains rather then a specific domain
As Fortran, COBOL, etc. didAs Fortran, COBOL, etc. did
Aims to become a true general-purpose programming languageAims to become a true general-purpose programming language
Model real-world phenomena in codeModel real-world phenomena in code
represent ideas as classes and class objectsrepresent ideas as classes and class objects
represent hierarchical relations as class hierarchiesrepresent hierarchical relations as class hierarchies
Classes, inheritance, virtual functions, object-oriented designClasses, inheritance, virtual functions, object-oriented design
A program becomes a set of interacting objects rather than aA program becomes a set of interacting objects rather than a
monolithmonolith
Has major (positive) implications for error ratesHas major (positive) implications for error rates
3333Stroustrup/ProgrammingStroustrup/Programming
33. CC Dennis RitchieDennis Ritchie
Bell LabsBell Labs
C and helped with UnixC and helped with Unix
Ken ThompsonKen Thompson
Bell LabsBell Labs
UnixUnix
3434
Doug McIlroyDoug McIlroy
Bell LabsBell Labs
Everybody’s favorite critic,Everybody’s favorite critic,
discussion partner, anddiscussion partner, and
ideas man (influenced C,ideas man (influenced C,
C++, Unix, and muchC++, Unix, and much
more)more)
Stroustrup/ProgrammingStroustrup/Programming
34. Bell Labs – Murray HillBell Labs – Murray Hill
3535Stroustrup/ProgrammingStroustrup/Programming
35. C – 1978C – 1978
(Relatively) high-level programming language for systems(Relatively) high-level programming language for systems
programmingprogramming
Very widely used, relatively low-level, weakly typed, systemsVery widely used, relatively low-level, weakly typed, systems
programming languageprogramming language
Associated with Unix and through that with Linux and the open sourceAssociated with Unix and through that with Linux and the open source
movementmovement
Performance becomes somewhat portablePerformance becomes somewhat portable
Designed and implemented by Dennis Ritchie 1974-78Designed and implemented by Dennis Ritchie 1974-78
3636
CPL BCPL B
C99
C++
C89
Classic C
C++98
Christopher Strachey, Cambridge, mid-
1960s
Martin Richards, Cambridge, 1967
Ken Thompson, BTL, 1972
Stroustrup/ProgrammingStroustrup/Programming
Dennis Ritchie, BTL, 1974
C++0x
Bjarne Stroustrup, BTL, 1985
36. C++C++
Bjarne StroustrupBjarne Stroustrup
AT&T Bell labsAT&T Bell labs
Texas A&M UniversityTexas A&M University
making abstraction techniques affordable andmaking abstraction techniques affordable and
manageable for mainstream projectsmanageable for mainstream projects
pioneered the use of object-oriented and genericpioneered the use of object-oriented and generic
programming techniques in application areas whereprogramming techniques in application areas where
efficiency is a premiumefficiency is a premium
3737Stroustrup/ProgrammingStroustrup/Programming
37. My ideals –My ideals – in 1980 and still in 2008in 1980 and still in 2008
““To make life easier for the serious programmer”To make life easier for the serious programmer”
i.e., primarily me and my friends/colleaguesi.e., primarily me and my friends/colleagues
I love writing codeI love writing code
I like reading codeI like reading code
I hate debuggingI hate debugging
Elegant and efficient codeElegant and efficient code
I really dislike choosing between the twoI really dislike choosing between the two
Elegance, efficiency, and correctness are closely relatedElegance, efficiency, and correctness are closely related
in many application domainsin many application domains
Inelegance/verbosity is a major source of bugs and inefficienciesInelegance/verbosity is a major source of bugs and inefficiencies
3838Stroustrup/ProgrammingStroustrup/Programming
38. C++ – 1985C++ – 1985
C++ is a general-purpose programming languageC++ is a general-purpose programming language
with a bias towards systems programming thatwith a bias towards systems programming that
is a better Cis a better C
supports data abstractionsupports data abstraction
supports object-oriented programmingsupports object-oriented programming
supports generic programmingsupports generic programming
3939
Classic C
Simula 67
C++C with Classes
C++98
ARM C++
1979-84
1978-89
1989
Stroustrup/ProgrammingStroustrup/Programming
C++0c
39. More informationMore information
More language designer links/photosMore language designer links/photos
http://www.angelfire.com/tx4/cus/people/http://www.angelfire.com/tx4/cus/people/
A few examples of languages:A few examples of languages:
http://dmoz.org/Computers/Programming/Languages/http://dmoz.org/Computers/Programming/Languages/
TextbooksTextbooks
Michael L. Scott,Michael L. Scott, Programming Language PragmaticsProgramming Language Pragmatics, Morgan, Morgan
Kaufmann, 2000, ISBN 1-55860-442-1Kaufmann, 2000, ISBN 1-55860-442-1
Robert W. Sebesta,Robert W. Sebesta, Concepts of programming languagesConcepts of programming languages,,
Addison-Wesley, 2003, ISBN 0-321-19362-8Addison-Wesley, 2003, ISBN 0-321-19362-8
History booksHistory books
Jean Sammet,Jean Sammet, Programming Languages: History andProgramming Languages: History and
FundamentalsFundamentals, Prentice-Hall, 1969, ISBN 0-13-729988-5, Prentice-Hall, 1969, ISBN 0-13-729988-5
Richard L. Wexelblat,Richard L. Wexelblat, History of Programming LanguagesHistory of Programming Languages,,
Academic Press, 1981, ISBN 0-12-745040-8Academic Press, 1981, ISBN 0-12-745040-8
T. J. Bergin and R. G. Gibson,T. J. Bergin and R. G. Gibson, History of ProgrammingHistory of Programming
Languages – IILanguages – II, Addison-Wesley, 1996, ISBN 0-201-89502-1, Addison-Wesley, 1996, ISBN 0-201-89502-1
4040Stroustrup/ProgrammingStroustrup/Programming