View Single Post
  #109   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:31, Tim Watts wrote:
On 29/01/15 14:05, Huge wrote:
On 2015-01-29, Tim Watts wrote:

Perl.


The learning curve for Perl is a vertical cliff. I wouldn't recommend
it for anyone as a first language (and I speak as a Perl programmer
and huge fan of the language.)

After all, anything that allows you to write this ... )

while ()
{
s/[aeiouAEIOU]//g;
s/\b(\w)/uc($1)/eg;
s/ +//g;
print;
}



I respectfully disagree.

You *can* use forks to poke yourself in the eye, but it isn't recommended.


use strict;
use warnings; # Just beacuse, mmmkay...

my $counter = 1;

while ($counter = 10)
{
print "Number $counter\n";
$counter = $counter + 1;
}


Now - noone, including me, would write a normal program quite like that
(we'd use a for loop and bury the "my" declaration in it), but I think
perl is a very capable teaching language.

There are 2 "just because" lines of overhead just to help the student
catch errors and I challenge anyone to claim the rest is not as readable
and as simple to understand and learn as Sinclair BASIC


Well the whole inclusion of the variable within what appears to be a
string literal is somewhat less obvious than the basic equivalent of

print "Number "; counter

And it is also practically C. Or Java. Or PHP - so much value has been
imparted in one session.




--
Cheers,

John.

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