View Single Post
  #108   Report Post  
Posted to uk.d-i-y
John Rumm John Rumm is offline
external usenet poster
 
Posts: 25,191
Default OT - Programming Languages

On 29/01/2015 14:25, Tim Watts wrote:
On 29/01/15 13:44, Tim Streater wrote:
In article , Tim Watts
wrote:

On 29/01/15 11:20, Tim Streater wrote:

Too many "special things" like $_ which make reading perl a constant
WTF? experience.


So don't use them.

use English;

and use nicely named variables.

And don't use $_ at all...


Indeed. And I don't. The trouble is that others do, and the perl
"documentation" (at least the Nutshell book) seems always to be written
by smart-alecs who like to show off. Their aim (and I found this
attitude in the perl ng too) is always to code using the least number
of keystrokes - clarity and concern for the maintenance guys following
on wasn't there.


I agree - and I write very C like perl, exactly for reasons of clarity


I remember how much I hated learning (K&R style) C back in the '80s for
similar reasons...

Yes its very concise to make an assignment in the body of an "if"
statement, but really, it should be blindingly obvious its just an error
waiting to happen!

(bit like that dodgy perl construct when people rely on the short
circuit boolean evaluation to turn "something || function call" into a
conditional call or exit. Just how difficult is it to type the word "if"
and make it obvious what you are doing....?)


--
Cheers,

John.

/================================================== ===============\
| Internode Ltd - http://www.internode.co.uk |
|-----------------------------------------------------------------|
| John Rumm - john(at)internode(dot)co(dot)uk |
\================================================= ================/