Programming language features that help to catch bugs early

Posted by Christian Neumanns on Programmers See other posts from Programmers or by Christian Neumanns
Published on 2012-11-21T03:48:33Z Indexed on 2012/11/21 5:20 UTC
Read the original article Hit count: 345

Do you know any programming language features that help to detect bugs early in the software development process - ideally at compile-time or else as early as possible at run-time?

Examples of well-known and effective bug-reducing features are:

  • Static typing and generic types: type incompatibility errors are detected by the compiler
  • Design by Contract (TM), also called Contract Programming: invalid values are quickly detected at runtime (through preconditions, postconditions and class invariants)
  • Unit testing

I ask this question in the context of improving an object-oriented programming language (called Obix) which has been designed from the ground up to 'make it easy to quickly write reliable code'. Besides the features mentioned above this language also incorporates other Fail-fast features such as:

  • Objects are immutable by default
  • Void (null) values are not allowed by default

The aim is to add more Fail-fast concepts to the language. If you know other features which help to write less error-prone code then please let us know. Thank you.

© Programmers or respective owner

Related posts about code-quality

Related posts about language-design