Re: String concatenation design



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.

.



Relevant Pages

  • Re: Is C99 the final C? (some suggestions)
    ... >> inevitably lead to BUS errors, ... > There's ample precedent in other languages ... call stack in a well-defined and programmer controlled way. ... semantics similar to C's function declaration. ...
    (comp.lang.c)
  • Re: Cobol News - Microfocus and AcuCOBOL
    ... I think they are the languages of today. ... I disagree strongly about problems for the programmer. ... It is a hard concept for COBOL people to grasp.. ... functionality comes along, it inherits what is there already and extends it. ...
    (comp.lang.cobol)
  • Re: The Demise of C#
    ... > There are syntactical conveniences (like the string concatenation operator) ... > in both languages would be nice to have at once. ... > Polymorphism to a VB programmer prior to .NET was to use variants. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Not enough parallelism in programming
    ... languages that define what happens when two methods execute in parallel. ... that the outcome is defined well enough that the programmer and user can ... obj1 and obj2 may refer to linked data structures that ... to execute in parallel two pieces of code that might overlap and hence not be parallelizable." ...
    (comp.arch)
  • Re: Language Oriented Programming
    ... lot of skill and creativity to conceive and build it. ... I can explain the problem and solution to another programmer in a matter of hours, but encoding this solution into the computer takes much longer. ... "The process of OOD is necessary because these classes and methods are the only abstractions that object-oriented languages understand. ... "The traditional way to address this problem is to write comments or other forms of documentation to capture the design and model information. ...
    (comp.object)