syntax safety and power

  1. nn_step
    nn_step
    In the world of modern programming languages, there exists two primary schools of thought:

    1) C style, which assumes efficiency of assignment is more important than syntax safety
    thus = is for assignment and == is for comparison
    Switch statements implemented with fall-through as the default path, switch/case statements are a frequent source of bugs among even experienced programmers, given that, in practice, the "break" is almost always the desired path, but not the default behavior of the switch/case construct (at least in C and Java).
  2. nn_step
    nn_step
    2) Pascal style, which assumes syntax safety is the most important concern of a programming language
    thus := is for assignment and = is for comparison.
    A much stricter language does not allow “fall through”; but rather require full coverage of all possible values for the type in the case statement but much more relaxed variants may include an explicit fallthrough statement which can be used at the end of a case statement to indicate that control falls through next case clause.

    For somethings, there is a definite trade off between power and safety; however in terms of syntax for a programming language never trade power for safety, when what you create MUST work.
Results 1 to 2 of 2