I have never been able to consider a person who learnt to program using PHP as anything more than a scripter. I also get very annoyed when I hear people saying HTML coder in mails too. Er! They are scripts they are not really programming language like C++ or Pascal. HTML is more like an RTF file format rather than a coding language, its a document standard. For a start to me its like calling yourself a programmer when you learnt to program using BASICS. You may be able to make things happen but your not really programming.
When I first started out I started using Pascal, Borland Turbo Pascal in fact. I was self taught, I picked Pascal because it was so easy to pick up, and was also a great way to learn how High Level Languages (HLL) worked. You get a lot of good habits from Pascal, it does not allow you to use a variables you have not declared, it doesn’t have the irritating == and = thing. I have seen so many C, C++, C# and even Java apps break because the = was used instead of == in an if statement.
Well in Pascal you have
:= becomes equal
= is equal to
That just saves so much hassle.
Also C type languages which I consider to be C, C++, C#, Perl, PHP and such languages to be, all seem to have those irritating users that want to add as much as possible to a single line of code. Why? Isn’t that the compilers job to do, isn’t debugging and readability the most important thing.
One of my other pet hates is comments. Most people who think they know coding seem to think a comment is written after the code, and usually descibes the action you can read in the code anyway. What it should be telling the person who did not write the code is what it was meant to do.
I write the comments first, its how I have alway worked. I write a psuedo like code of what I am wanting, comment by comment, then write the code around those comments. Its a great way to get the code planned and thought out before you have even written it. Its like explaining what is meant to happen to someone else, nothing beats that for telling you that your method is right or wrong.
My current languages of choice are Delphi 2006 Win32 and PHP 5, I use a little Delphi .NET but the apps I write for my work don’t really need the .NET framework that much. I’ve been recently playing around with Lazarus, a quick google search should give you a link to this project using a Delphi like interface with the Free Pascal project. If you are serious about wanting to be a real programmer, learn Pascal not a C based language or script, you will learn a lot more about structure and planning, and hopefully you will not get those bad habits.
Last of all, keep your code simple, split calculations, don’t put everything onto one line, think code stepping and debug at all times, when you come back in 12 months time to that code, you want to be able to fix any problem, you won’t be able to if you have not future proofed it.
Tags: .NET, C#, Delphi, Java, Pascal, PHP