Javascript vs PHP, which to start learning first for beginners?

Javascript has been getting very popular in the past 2 years mainly because together with HTML5, you can create iPhone or Android apps.

Though it is known that in terms of speed, Javascript will never be able to catch up with native apps, there are still many applications that are suitable for developing with Javascript.

If you delve into these 2 languages, you would be surprised how different they are.  You can say C and Java are very similar but you can’t say PHP and Javascript are similar.

What makes PHP so popular? It’s the simple reason that PHP is server side and the code written is hidden in the server.

If you are a new web programmer, I strongly suggest that you start with Javascript first.  Javascript has a better separation between the script and HTML making it a lot more easy to code.

When you first learn about Javascript, you do not have to worry about HTML or CSS.  You can learn it as if you are writing in C.  However, when you are writing PHP, you need to put the HTML into the code making it really confusing for the beginners.

Learn C: Special Characters

Special or control characters are invisible on the screen. They have special purposes usually to do with cursor movement and are written into an ordinary string or character by typing a backslash character \ followed by some other character.

In the hello example, the special character is “\n”.

These characters are listed below.

Special CharacterDescription
\bbackspace BS
\abeeping sound
\nnew line NL (like pressing return)
\rcarriage return CR (cursor to start of line)
\t
horizontal tab HT
\"double quotes (not all versions)
\'single quote character '
\\backslash character \

Learn C: A variation of the first program

#include <stdio.h>

void main()
{
    printf("\n");
    printf("Hello World");
    printf("\n");
    printf("This is my first program.\n");
}

hello1

The “\n” is a special character.  It means new line here.  Notice the 2 new lines in the hello program.

printf is a print function defined in stdio.h, that is also why there is an include statement in the beginning.

The “;” denotes the end of a statement.

Learn C: What are the resources available on the web to learn C?

There is actually quite a lot of resources available online that you can tap into.

Here, there are these few links that I have found:

  1. Tutorials Point – with good introduction
  2. How Stuff Work – a bit surprised to find C stuff here
  3. C Programming
  4. Programming Simplified – quite a lot of examples that you can try
  5. C Tutorial – created more for students majoring in Physics
  6. C4Learn – this site has some very good and short examples that you can try out
  7. GNU C – a programming tutorial

If you have come across any good C introduction on the web, please share the link.