Programming Errors

From dis-Emi-A

Jump to: navigation, search


Contents

Problems

This is a catalog of the problems/defects/issues that appear while writing programs in other languages. The goal of this new lanaguage is of course to make all these problems not possible.

Resource Problems

Logic Problems

  • infinite loop
  • unscreened/dirty input to protected function
    • -security errors
  • half-completed calculations/procedures
    • -breaks/exceptions in middle
    • -possibly irreversible
  • concurrent modifications
  • thread [dead]locking
  • non-atomic modifications
  • wrong if/conditional/while flow (ex. error_bad_return)
    • semicolons on for/while loop (empty loops)
    • contradictory/impossible conditions
  • dead/unusued code
  • uninitialized variables
  • unintended code execution
    • forgetting a "break" statement
    • using = instead of ==
    • misplaced brackets, (added code to single line conditions)
  • undeclared functions
    • missing header files
    • multiple declarations / conflicts
  • ignored error conditions

Conversion Problems

  • multiply encoded text
    • display( encUTF8( str ) );
    • func display( str ) { write( encUTF8( str ) ); }
  • incomplete types (also with conversions) (Solutions: Subtypes)
    • speed = 4
    • mass = 5
    • newmass = speed * mass //conversion error (not seen by compiler)
    • =>
    • speed = 4m/s
    • mass = 5kg;
    • newmass = speed * mass //compiler error (will be caught)
  • corrupt files / unchecked input
  • missing datatypes from serialization
  • incorrect comparisions (ptrs, classes, strings, etc.)

Side-Effect Problems

  • uninteded modiftion
    • if( a = 0 ) ...
    • if( b.hasSideEffect() ) ...

Calculation Problems

  • uncaught/unnoticed overflow (Solution: Constrained Types)
  • uncaught/unnoticed underflow
  • integer division/loss of precision

Maintainence/Meta Problems

  • Code duplication large and small
  • odd-flow
  • outdated comments
    • -constraints/restrictions/expectations in comments rather than code
  • name clashes
    • include files/imports
    • name codependencies
    • multiply defined types
  • non-terminating comments (missing code)
  • incorrect token use ( a != b vs. b != a, 0 < a < 5 )
  • type-unsafe/unchecked macros
  • reliance on expresison evaluation ordering (in comparisions, as parameters, etc...)
Personal tools