Which is the easiest programming language for beginners?

For the web

PHP hands down.

PHP:
<html> 
<head><title>Random</title></head> 
<body> 
<p>I have randomly selected the number 
<?php $choice=rand(1,100); echo $choice;?>. 
Its square root is <?php echo sqrt($choice);?>.</p> 
</body> 
</html>
 
If anyone here needs some help with C, I can give you some pointers...
 
For the web

PHP hands down.

PHP:
<html> 
<head><title>Random</title></head> 
<body> 
<p>I have randomly selected the number 
<?php $choice=rand(1,100); echo $choice;?>. 
Its square root is <?php echo sqrt($choice);?>.</p> 
</body> 
</html>

The enter key is amazing.
Then echo supports concatenation.

PHP:
<html> 
 <head><title>Random</title></head> 
 <body> 
   <?php 
    $choice=rand(1,100); 
    echo $choice . '<br>Its square root is ' . sqrt($choice) . '.';
   ?>
 </body> 
</html>

:p

Probably Java or Python.
 
For the web

PHP hands down.

PHP:
<html> 
<head><title>Random</title></head> 
<body> 
<p>I have randomly selected the number 
<?php $choice=rand(1,100); echo $choice;?>. 
Its square root is <?php echo sqrt($choice);?>.</p> 
</body> 
</html>

PHP:
import random
import math

choice = random.random()

print '''
<html>
  <head><title>Random</title></head>
  <body>
    <p>I have randomly selected the number  %0.2f</p>
    <p>Its square root is %0.2f</p>
</body>
</html>
''' % (choice, math.sqrt(choice))
 
PHP:
import random
import math

choice = random.random()

print '''
<html>
  <head><title>Random</title></head>
  <body>
    <p>I have randomly selected the number  %0.2f</p>
    <p>Its square root is %0.2f</p>
</body>
</html>
''' % (choice, math.sqrt(choice))
I have no idea what is going on there.

PHP on the other hand reads like a childrens book.
 
Top
Sign up to the MyBroadband newsletter
X