Re: String concatenation design



"Rob Thorpe" <robert.thorpe@xxxxxxxxxxxx> wrote in message news:1143552303.871560.68630@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Although many languages have many operators
and levels of prescedence in practice programmers don't like them much.
C has ~15 levels of prescedence depending on how you count them, but
programmer generally only use 4 or 5 of them and rely on parenthesis
otherwise.

Generally, you want a programming language to surprise the programmer as little as possible, and in that case, it may be good idea to have precedence rules which mimic that of standard math. A novice programmer might, for example, copy a formula straight out of a physics book, and be very surprised when his program gives unexpected results due to "weird" precedence rules.

- Oliver

.



Relevant Pages

  • Re: String concatenation design
    ... you want a programming language to surprise the programmer as ... Offer either simple precedence rules that are similar to ... These languages are popular but their precendence ...
    (comp.programming)
  • Re: gets() is dead
    ... I am surprise you would ... That's why they wrap fgets() in a function that checks for error and ... the responsibility lies with the user, not the programmer. ... So you'd rather add code to warn the user than remove a newline. ...
    (comp.lang.c)