Maybe PHP should be the first programming language learnt
My girlfriend is a freshgirl at the local University of Applied Sciences since beginning of March. She chose to study Computer Science. Maybe affected from the area of my own studies.
Her schedule is pretty packed. She has to take a course in discrete mathematics, hardware basics, algorithms and data structures as well as computer sciensce basics. CS is really new to her. She knows how to use a computer and she learns quick. Has no problems with Windows and Mac, which is promising. However, she needs to start programming. When I started my first bachelor in 1998 one year long I was taught to program in Pascal and Object Pascal. This wasn't new to me as I started in 1992 with (Q)Basic and in 1993 switched to Pascal. By that time I was at the high school. Pretty interesting was that the CS undergraduates had to learn Pascal while every other at the University learnt C and C++. Well, in the second year we had C and C++ courses, so we advanced. Java was shown in few sessions, nothing more. On the contrary was the situation at the largest University in my home city, Sofia, the University of Sofia. They started with Java.
Now, my girlfriend is facing the faith of starting her career with Java. But the simplest Java program has so many concepts which the newbie doesn't understand.
- what is a class?
- what is a method?
- what is public?
- what is static?
- what is main?
- what is String[]?
- what is System?
- what is System.out?
Compared to that, a simplest C program will be asked for the following:
- what is #include?
- what is int?
- what is main?
- what is printf?
And what should she ask if about the simplest program in PHP:
- what is
- what is echo/print
As you see from Java through C to PHP it gets simpler to bootstrap. PHP could be very simple, as C can be, without some things which the newbie might find complicated and will have hard time understanding (pointers, pointers to functions). Once the rookie learns some things he can be introduced to OOP without changing the language, just upgrading the knowledge. PHP is also very compact language. Code that does many things may be very well packed, but one needs to know many of the built-in functions. Yes, PHP doesn't have strict typing and is very dynamic by its nature but once the rookie knows the basics she might switch to Java and continue. Compared to Pascal, PHP has the advantage to have C-like syntax, which is also used by Java and of course C++ :). So, once accustomed to it other languages are just one hand away. Pascal is good for learning but very diiferent than C, C++, Java and it is a bit of a revolution in the way of thinking during the switch. I know it because I experienced it.
My gf just ordered "Java2 for dummies". I hope this will be an easier introduction and way to bootstrap than the ordinary Java book. As I said her schedule is pretty packed otherwise it would have been possible to start with a PHP book for dummies and then switch the language, but still then should would have ensalata mixta in her head.