Re: String concatenation design
- From: "Rob Thorpe" <robert.thorpe@xxxxxxxxxxxx>
- Date: 29 Mar 2006 02:14:31 -0800
Oliver Wong wrote:
"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.
Exactly. Offer either simple precedence rules that are similar to
mathematics and logic or have no operators at all, as lisp does.
Don't do what C, C++ and Perl do, and have 15 levels with slightly
different priorities. These languages are popular but their precendence
levels aren't.
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.
Yes. It's useful in some ways that this works fairly well. But it
leads programmers to think of programming in as similar to algebra,
when it's normally more complex. Still every programmer meets
overflows, underflows and numerical analysis at some point which
reeducates them.
.
- Follow-Ups:
- Re: String concatenation design
- From: andy
- Re: String concatenation design
- References:
- String concatenation design
- From: Anton Treuenfels
- Re: String concatenation design
- From: Rob Thorpe
- Re: String concatenation design
- From: Oliver Wong
- String concatenation design
- Prev by Date: Re: Cannot understand the following codes
- Next by Date: Re: Transfer data between processes
- Previous by thread: Re: String concatenation design
- Next by thread: Re: String concatenation design
- Index(es):
Relevant Pages
|