[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: statements vs. expressions

Paul Graham writes
> So far it looks as if statements are a mistake that
> got made in Fortran, were inherited by Algol, and spread
> thence to most other programming language.  It was
> obvious why Fortran I distinguished between expressions
> and statements.  Not surprisingly, considering the input
> format was punched cards, Fortran I is line-oriented;
> you can't compose statements.  So while you need to have
> expressions for math to work, there is no point in
> making everything an expression, because there could
> never be anything waiting for the return value...
> But, you know, if you introduce *any* limitation into
> your language, it enforces more consistency.  It's still
> just a limitation.  I'm willing to be convinced otherwise,
> but as far as I can tell, statements seem to be just a 
> long-perpetuated mistake.  
> I wonder which inheritance from punched cards will last
> longest, statements or 80-char lines....

Not even a contest!  Modern prog langs do not enforce a
line length limitation.  It is merely voluntary human
convention nowadays to limit oneself in this regard.

Flouting the convention holds no greater peril than the
reproach of one's (human) peers.  Some flout anyway.  I
myself do, in "machine-generated" code that no one need
see, when I don't have handy access to a pretty-print
procedure.  (Another convention I flout is the one
that says it's OK to say "flaunt" when you mean