Is there a good programming language out there - PowerPoint PPT Presentation


PPT – Is there a good programming language out there PowerPoint presentation | free to view - id: a5e73-ZWQ4O


The Adobe Flash plugin is needed to view this content

Get the plugin now

View by Category
About This Presentation

Is there a good programming language out there


A good programming language is a conceptual universe for thinking about programming. ... Good development environments (IDEs)? 4. Is there a good programming language? ... – PowerPoint PPT presentation

Number of Views:93
Avg rating:3.0/5.0
Slides: 44
Provided by: allent


Write a Comment
User Comments (0)
Transcript and Presenter's Notes

Title: Is there a good programming language out there

Is there a good programming language out there?
  • Allen Tucker September 19, 2008
  • http//

A good programming language is a conceptual
universe for thinking about programming. A.
  • This raises four questions
  • 1. Whats in this conceptual universe?
  • 2. How should we think about programming?
  • 3. What should a good programming language look
  • 4. Is there a good programming language?

1. A languages conceptual universe
  • Concepts about computing environment
  • Machine architecture/platform
  • Run-time behavior
  • User interface
  • Networking clients and servers
  • Data persistence
  • Concepts about programmers and programming
  • Application domain
  • Programmer skills
  • Organization individual vs team
  • Program goals

2. How should we think about programming?
  • Programming combines modeling and coding.
  • Elements of modeling
  • Literate style
  • Programming in the large (frameworks)?
  • System and network platform
  • Application requirements and use cases
  • Elements of coding
  • Syntax and semantics
  • Abstraction
  • Efficiency
  • Development environment (IDE, version control)?
  • Correctness and documentation

3. What should a good programming language look
  • Historical influences
  • Application domains
  • Programming paradigms
  • Quality metrics

3a) Historical influences
  • Programming languages evolve over time
  • 1960 - there were 4 (count em) major languages
  • Algol, Fortran, Cobol, and Lisp
  • 1977 - I wrote a book that covered 6 prominent
  • Algol, Fortran, Cobol, PL/I, RPG, and Snobol
  • 1986 - the 2nd edition covered 11 languages
  • Pascal, Fortran, Cobol, PL/I, Snobol, APL, C,
    Lisp, Prolog, Ada, Modula-2
  • 2001 Bob Noonan and I wrote a book covering 4
    languages and 6 paradigms
  • Java, C, Scheme, Prolog
  • 2007 - the 2nd edition covered 9 languages
  • Java, C, Ada, Perl, Smalltalk, Python, Scheme,
    Haskell, Prolog

(No Transcript)
3b) Application domains also have language
  • Artificial Intelligence
  • Scheme, C, Prolog
  • Computer Science Education
  • C, C, Java, Python
  • Science and Engineering
  • Fortran, C
  • Information Systems
  • Cobol, SQL
  • Systems and Networks
  • C, C, Ada
  • World Wide Web
  • Perl, PHP, Python

3c) Programming Paradigms
  • A paradigm is a problem-solving pattern that
    utilizes a conceptual universe for thinking about
  • So a paradigm utilizes a programming language.
  • Here are six very different paradigms
  • Imperative
  • Object-oriented
  • Functional
  • Logic (declarative)?
  • Event-driven
  • Concurrent
  • But different paradigms utilize different

Imperative Programming
  • Based on the von Neumann-Eckert computing model
  • Program and data coexist in memory
  • Program a sequence of commands
  • State values of all variables at run time
  • Large programs use procedural abstraction
  • Example imperative languages
  • Cobol, Fortran, C, Ada, Perl

The von Neumann-Eckert Computing Environment
3d) Quality Metrics
  • A good language should have ten qualities
  • Literacy
  • Semantic clarity
  • Rich primitive types and structures
  • Abstraction
  • Reliability
  • Efficiency
  • Objects and events
  • Concurrency in the large
  • Correctness tools
  • Support

Quality 1. Literacy
  • Writable
  • Small vocabulary (instruction set)?
  • E.g., Java vs. Scheme
  • Simple syntax
  • E.g., C/C/Java vs. Python
  • Readable
  • Clear structure and naming conventions
  • Documentation support

Quality 2. Semantic clarity
  • A binding associates an object with a property.
    Examples a variable and its type, or
  • a variable and its value
  • A language is strongly typed if the type of every
    variable in a program is known whenever it is
  • Strong typing is related to clarity about
    binding, which leads to semantic clarity.
  • A language is orthogonal if its semantics are
    built on a
  • small, mutually independent set of primitive
  • Fewer exceptional rules lead to semantic clarity

Quality 3. Rich Primitive Types and Structures
  • Numbers
  • Currency
  • Strings
  • Dates and times
  • Lists and list functions
  • Hash maps (associative arrays)?
  • Traversals
  • Relational databases

Quality 4. Abstraction
  • Data
  • Programmer-defined types/classes
  • Class libraries
  • Procedural
  • Programmer-defined functions
  • Function libraries

Quality 5. Reliability
  • A language is reliable if
  • A program behaves the same when run on different
  • E.g., Fortran 95 vs Fortran I
  • Type errors are detected
  • E.g., Haskell vs C
  • Semantic errors are properly trapped
  • E.g., C vs C
  • Memory leaks are prevented
  • E.g., Java vs C

Quality 6. Efficiency
  • Embedded systems
  • Real-time responsiveness (e.g., navigation)?
  • Failures of early Ada implementations
  • Web applications
  • Responsiveness to users (e.g., Google search)?
  • Database applications
  • Efficient search and updating
  • AI applications
  • Modeling human behaviors

Quality 7. Objects and Events
  • An object oriented (OO) program models a
    collection of objects that interact by passing
    state-transforming messages.
  • OO is a good way to model real-world
  • Example OO languages
  • Java, C, C, Python, PHP


  • Computation is best modeled as a community of
    persistent entities coupled together by their
    ongoing interactive behavior ... Beginning and
    end, when present, are special cases that can
    often be ignored. Lynn Stein
  • Event-driven programs do not control the sequence
    in which input events occur.
  • Example event-driven languages
  • Perl, Python, Java applets, PHP forms

Imperative vs. Event-Driven Programs
Event-driven Applications
  • GUI
  • Games
  • Graphical design
  • Web-based
  • E-commerce (e.g.,
  • Volunteer scheduling (e.g.,
  • Embedded systems
  • Cell phones
  • Security alarm systems

Quality 8. Concurrency in the large
  • Two or more instruction streams (threads) running
    asynchronously and sharing data.
  • Characteristics
  • More efficient than single instruction stream
  • More realistic
  • Have unique, fundamental complexities
  • Traditionally studied in the context of operating

Concurrency example web pages
  • To render a web page (a shared resource), we
  • A thread for loading each image
  • A thread for rendering text
  • A thread for responding to user input
  • e.g., a stop button
  • Threads cannot all write to the page
  • They need asynchronous control
  • But they must be concurrent
  • They must be responsive to the user

  • Asynchronous control is needed
  • Whenever a thread requires exclusive access to
    some resource,
  • Whenever a thread needs to exchange data with
    another thread,
  • To prevent the resulting value of a shared
    variable from being different depending on the
    execution order of two threads (a race
  • To prevent a thread from waiting for an event
    that will never happen (a deadlock).

  • Concurrency in the large
  • the client-server model

Shared resource
Quality 9. Correctness tools
  • To treat programming scientifically, it must be
    possible to specify the required properties of
    programs precisely.
  • The importance of formal specifications must
    ultimately rest in their utility - in whether or
    not they are used to improve the quality of
    software or to reduce the cost of software.
  • J. Horning

Why correctness?
  • A correct program does exactly what its
    specifications require, no more and no less.
  • A formally correct program is one whose
    correctness can be proved mathematically.
  • Until recently, correctness has been just an
    academic exercise.
  • Now it is becoming a key element of
    safety-critical systems
  • Correctness can ensure higher levels of quality
    than traditional testing
  • e.g., the Paris Metro System

Practical problems with correctness
  • Scaling up
  • Teaching the methodology
  • Practicing the methodology
  • Lack of good tools
  • Duplication of effort
  • E.g., The Java elements JML and ESC/Java2
  • Correctness proof (ESC/Java2)
  • Complements traditional Unit testing (Junit)?
  • Modeling (JML)
  • Complements traditional Coding (Java)?
  • Documentation (JML)
  • Complements traditional Documentation (Javadoc)?

Quality 10. Support
  • A well-supported language has
  • Free access (open source)?
  • Good texts and tutorials
  • Significant application domain (and programming
  • Good development environments (IDEs)?

4. Is there a good programming language?

4. Is there a good programming language?
  • Yes…

4. Is there a good programming language?
  • Yes…
  • My vote goes to PHP/Apache/MySQL

But wait, you say…
  • This isnt a language
  • PHP and MySQL are two different languages, and
  • Apache is a web server.

But wait, I say…
  • This is a language
  • PHP and MySQL are well-integrated, and
  • We cant program client-server applications
    (concurrency in the large) without a web server.
  • Anyway, let's assume (for arguments sake) that
    PHP/Apache/MySQL is a language,
  • So now we can look at PHP/Apache/MySQL through
    the lens of our 10 quality criteria.

PHP/Apache/MySQLs qualities
  • Literacy yes
  • Semantic clarity yes -- even w/dynamic types
  • Rich primitive types and structures yes --
    see next slide
  • Abstraction yes
  • Reliability yes
  • Efficiency yes
  • Objects and events yes
  • Concurrency in the large yes
  • Correctness tools no -- see 2nd/3rd next slides
  • Support yes

Examples of PHP/Apache/MySQLs Rich Primitive
Types and Structures
  • Dates and times
  • today date()
  • september9 mktime(0,0,0,9,19,2008)
  • Associative Arrays
  • population array(CTgt3502309, MAgt
  • RI gt 1057832, ME gt 1317207,
  • NH gt 1315828, VT gt 621254)
  • So populationMA gives 6449755
  • MySQL integration
  • my_query SELECT state, pop FROM censusData
  • result connection-gtquery(my_query)
  • population mysql_fetch_array(result,

The challenge for integrating correctness tools
  • Documentation is essential for software
  • Javadoc (and PHPdoc) have keywords for
    specifying features of classes and methods.
  • _at_return specifies value returned by a function
  • _at_param specifies parameters required by a method
  • Formal specifications are essential for
    correctness proofs
  • JML has features for specifying the same. E.g.,
  • \ensures and \return clauses
  • \requires clauses
  • But these two are not integrated.
  • So the programmer has to write all these
    specifications twice!

PHP/Apache/Mysqls Main Weakness
  • Lack of correctness tools
  • Suggestions for fixing this weakness
  • Integrate formal specifications within PHPdoc
  • motivator for writing better documentation
  • supplement for unit testing
  • preparation for more formal proof
  • Use JML and ESC/Java2 experiences for guidance

A PHP/Apache/MySQL Application
  • RMH Homebase A volunteer scheduling for the
    Ronald McDonald House in Portland, ME
  • Web-based, client-server
  • Database
  • Designed and Programmed by four Bowdoin students
    (and me)?
  • Open source (see http//
  • Fully developed during spring semester 2008
  • See http// and login as guest
    (no password) to experiment with the system.

  • If you become a computing professional
  • prepare to spend a lot of time learning
  • Expect programming languages to be the last to
    keep pace with the evolution of computing.
  • Expand your notion of programming language
    beyond the conventional.
  • Have fun with programming languages.
  • They will have fun with you!

  • Tucker and Noonan, Programming Languages 2/e,
    McGraw-Hill 2007
  • http//
  • 2. PHP/Apache/MySQL Web sites
  • http//
  • http//
  • http//
  • PHP/Apache/MySQL Software Projects
  • http//
  • http//