UNIHIVE

Study Hub UNIPORT CSC 396

CSC 396 · Automata theory, Computability and Formal Languages

Language design and evaluation criteria

Readability, writability, reliability and cost, the features that affect each, and the trade-offs designers face.

Our notes

2 min read

Why criteria

Languages are chosen for long-lived projects, so we need a way to judge them. The classic criteria are readability, writability, reliability and cost.

Readability

How easily programs can be read and understood.

  • Simplicity: a small number of basic features. Too many ways to do the same thing (in C, x = x + 1, x += 1, x++, ++x) make reading harder.
  • Orthogonality: a small set of features that combine freely and consistently. Lack of it causes surprises (in C, arrays cannot be returned from functions but structures can).
  • Control structures: structured loops and selections instead of jumps.
  • Data types: a real boolean type is clearer than using 0 and 1.
  • Syntax: meaningful keywords, clear endings for blocks (end if, end loop).

Writability

How easily programs can be written for the problem: simplicity and orthogonality again, plus abstraction (procedures, classes, generic code) and expressivity (convenient operators such as a for loop instead of a while with a counter).

Reliability

Whether programs behave as intended:

  • Type checking (at compile time is cheapest),
  • Exception handling (catching run-time errors and recovering),
  • Restricted aliasing (two names for the same memory make errors likely),
  • readability and writability themselves.

Cost

Training programmers, writing programs, compiling, running, the language system (free or not), reliability (failures can be very costly) and maintenance (usually the largest cost).

Other criteria

Portability (standardised languages such as C and Java move between systems), generality and well-definedness (a precise official definition).

Trade-offs

  • Reliability against cost of execution: Java checks every array index (safer, a little slower); C does not.
  • Readability against writability: APL's powerful symbols make very short but cryptic programs.
  • Flexibility against safety: C's pointers allow anything, including serious bugs.

Influences on design

Computer architecture (the von Neumann machine shaped imperative languages: variables model memory cells, assignment models storing), and programming methods (structured programming in the 1970s, object orientation in the 1980s and 1990s, concurrency and safety today, as in Rust).

Exams usually ask

  • Explain the main evaluation criteria and the features that affect each.
  • Define orthogonality with an example.
  • Discuss trade-offs in language design.

Common mistake

Equating simplicity with fewer lines of code. A language can be short to write and very hard to read; simplicity is about a small, consistent set of concepts.

Written by the UniHive team in our own words. Spotted a mistake? Tell us on WhatsApp.

No reading links here yet

Our team adds free books, videos and practice for each topic, and opens every link before it goes up.

All CSC 396 topics

Report

Sign in to report this. It is free.

Is this your work (a lecturer, author or publisher)? Ask us to take it down.