Docsity

ALGOL-60 Elegance - Programming Languages - Slides | CS 403, Study notes of Programming Languages

Toggle sidebar
bg1
1
Fall 2002 CS 403 Class Notes Page 1
CS 403 -9/24/2002
•Exam 1 date: Oct 8th.
•Writing assignment 2 and programming
journal due today.
•New writing assignment!
•Today
–Finish Chapter 4: ALGOL-60 Elegance
•Reading Assignment for Tuesday
–Chapter 5
•No class Thursday 10/3 –“E-Day”
Fall 2002 CS 403 Class Notes Page 2
Association of Computing Machinery
“The First Society in Computing”
First Meeting of the Year: Thursday, September 26, 2002
Time and Place: EE 119 at 6:00 p.m.
Join us on Thursday for FREE FOOD, and announcements of
upcoming ACM events including a programming contest.
Guest Speaker: Shane Merritt, a UA CS grad, currently
Director of Network and Computing Support at Seebeck
For more info, visit us at acm.eng.ua.edu
Fall 2002 CS 403 Class Notes Page 3
Reading Quiz
pf3
pf4
pf5

Partial preview of the text

Download ALGOL-60 Elegance - Programming Languages - Slides | CS 403 and more Study notes Programming Languages in PDF only on Docsity!

Fall 2002 CS 403 Class Notes (^) Page 1

CS 403 - 9/24/

  • Exam 1 date: Oct 8th.
  • Writing assignment 2 and programming journal due today.
  • New writing assignment!
  • Today
    • Finish Chapter 4: ALGOL-60 Elegance
  • Reading Assignment for Tuesday
    • Chapter 5
  • No class Thursday 10/3 – “E-Day”

Fall 2002 CS 403 Class Notes (^) Page 2

Association of Computing Machinery “The First Society in Computing”

First Meeting of the Year: Thursday, September 26, 2002 Time and Place: EE 119 at 6:00 p.m.

Join us on Thursday for FREE FOOD, and announcements of upcoming ACM events including a programming contest. Guest Speaker: Shane Merritt , a UA CS grad, currently Director of Network and Computing Support at Seebeck For more info, visit us at acm.eng.ua.edu

Fall 2002 CS 403 Class Notes (^) Page 3

Reading Quiz

Fall 2002 CS 403 Class Notes (^) Page 4

4.3 Design: Elegance

  • “Elegance” is partly an aesthetic concept: “How beautiful is the code?”
  • It has a direct effect on “How readable, how understandable is the code?”
  • Which leads to “How maintainable is the code?”
  • Remember: Maintenance costs dominate the total cost of software!

Fall 2002 CS 403 Class Notes (^) Page 5

Design has three dimensions

  • Efficiency
  • Economy
  • Elegance
  • Textbook uses the analogy of building a

bridge to help clarify these issues.

  • What other analogies could apply?

Fall 2002 CS 403 Class Notes (^) Page 6

Efficiency

  • Goal: minimize the resources used.
    • Sometimes your program must run in less that 512K RAM.
    • Real-time programming must have a response time of less than ‘e’ (epsilon, ie. 0.01 second)
    • Problems with run-time = O(n^3 ) must run efficiently!
    • But don’t confuse compile time with run time, etc.
      • Some languages take forever to compile, but run very efficiently! COBOL is one example of this.

Fall 2002 CS 403 Class Notes (^) Page 10

Elegance

  • If it looks bad, it probably is bad.
  • If it looks good, it’s much more likely to be good.
  • Function follows form. (Structure Principle)
  • Elegance Principle:
    • Confine your attention to designs that look good because they are good.

Fall 2002 CS 403 Class Notes (^) Page 11

Beauty and Work

  • Have you toured the Gulf States Paper Co. offices? You should! (It’s free!) - Jack Warner believes that employees work better in the midst of beauty. - He didn’t get to be one of the richest men in the state by making stupid decisions!
  • You will do better work if you are surrounded by beauty.
  • Your work will be better if you try to make it beautiful.

Fall 2002 CS 403 Class Notes (^) Page 12

Creating Beauty

  • Buckminster Fuller:
    • “When I work on a problem, I never think about beauty. But when I am finished, if it is not beautiful, I know it is wrong.”
  • If the programs you produce don’t have some form of beauty about them: - They’ll be harder to read and understand. - They’ll be more expensive to maintain. - Probably be more prone to bugs & problems
  • So – A good programming language should encourage elegance & beauty.

Fall 2002 CS 403 Class Notes (^) Page 13

4.4 Algol: Evaluation & Epilogue

  • Never achieved widespread use
  • Had no input-output statements
    • Machine independence was a goal.
    • There was no standard for I-O, so there was no machine independent way to specify it.
    • Designers expected to call on library procedures.
  • Competed with the already-established FORTRAN

Fall 2002 CS 403 Class Notes (^) Page 14

Algol was a Major Milestone

  • New terms & concepts
    • Type
    • Formal parameters & Actual parameters
    • Block
    • Call by value
    • Call by name
    • Scope
    • Dynamic arrays
    • Global, local & non-local variables

Fall 2002 CS 403 Class Notes (^) Page 15

Other developments due to Algol

  • [These are discussed in chapter 6]
    • Activation records
    • Thunks
    • Displays
    • Static & dynamic chains (for scoping)
  • BNF
  • Nearly all languages today are “Algol-

like”:

  • Block structured
  • Nested
  • Recursive
  • Free form

Fall 2002 CS 403 Class Notes (^) Page 19

End of class

  • Read chapter 5 for Tuesday.
  • Check web page for Forum notices
  • Check web page for details on 3 rd^ writing assignment.