PHP Advantages
By admin • Apr 28th, 2008 • Category: 1.1. Where to Start with PHPIf you’re beginning your journey with web development, it helps to understand why you would choose PHP over another language. You could of course make the wrong decision like Mac users have with their entire operating system (unless your Mac has Windows XP on it - thank you Intel!). You want to consider all of your options, not just the prettiest hip model. I’ve had experience with java, javascript, PHP and .NET, so hopefully I can pass onto you some of the reasons why I choose PHP over all others when given the opportunity.
Easy to follow language
PHP is a very easy language to read and understand. I was taught Java at university, and once my eyes read some PHP code for the first time I could very easily read it, all of it. I’ve heard C++ coders say the same thing.
Pseudo code example:
if(some condition) {
do this;
and this;
} else {
do that;
}
If you can get your head around that simple syntax, PHP will be an easy language for you to pickup. If you find that logic difficult to comprehend, you better get used to paying someone else to do your programming. Your time will be better spent elsewhere.
That said, a lot of other languages are just as easy to read, including .NET and java, so I am merely pointing out that PHP is easy to read, not that it is easier to read than any other language (except C and Ruby - to me they are not programming languages, but some foreign dialect that only the mentally ill understand). So please, save me your hate mail (that includes you Mac users). I do have other reasons for choosing PHP …
So we can safely assume if you’re still reading, you will find PHP simple to read. Even when complex methods of programming are used, you can still quite easily follow things from place to place, even if it takes you some time with complex object oriented code. After all, big complex problems are often just many smaller problems all combined and/or working together. The sooner you realise this, the easier it will be to handle larger projects with PHP.
The Language is Free (and so are great tools for development)
Whether your development is commercial or personal, you can develop with PHP for free. You can opt to use a commercial based editor that will cost money (such as Zend development tools), but I use Notepad++ (which is open source) for all of my personal PHP development (this very site is one example built entirely from Notepad++ - with my fine ass logo designed with the Gimp image editor, also open source). I find Notepad++ gives me ultimate flexibility, and all the options I want for small and medium projects (I haven’t worked on any large projects).
I believe Notepad++ is just plain better than Zend. Why? It loads faster, has better find and replace functionality and can work with multiple files more easily. For example, ‘find and replace’ in Zend is horrible. The version of Zend I’m using at work does ‘find and replace’ only in the one direction you specify from where your cursor is, and you cannot choose to ‘find and replace’ across all open files. WTF! Find and replace is a programmers best friend, and Zend just doesn’t have it right yet. Notepad++ however, does ‘find and replace’ perfectly. Even allowing regular expression replacements, which is awesome. You’d think a commercial editor that you’re paying for would have all the bells and whistles, but the fact is that’s not true. You need to take some software trials, do your research and find one that works for you, and a free editor may be your ultimate preference. So you have my recommendation. Notepad++ is the way to go with PHP.
Choice of editors, to me, is a huge advantage for PHP, as .NET only has one main development tool, Visual Studio, which you have to pay thousands for, PER development machine. (And for all you .NET freaks who say there are open source alternatives to Visual Studio, YES I KNOW, I have tried them and they really do not compare to Visual Studio, sorry. One came close, i can’t remember its name, but I used it for a month and it just didn’t measure up to Vis Studio). If you choose to use Microsoft for development, get used to paying for everything, per development machine
Another plus for PHP.
Compiled ‘On The Fly’
Probably my most favourite reason for using PHP is the fact that it is compiled at run time, meaning you, the developer, do not have to compile PHP code whenever you change something. I also work with VB.NET, and within an hour of development in .NET I’m sick of compiling. Being forced to compile code into DLLs (dynamic link library files) is a pain in the hole, especially once you are used to the ‘on the fly’ world of PHP. Why is compiling so bad? There’s the compile time itself right …let’s wait 5-20 seconds for our application code to compile - and that’s EVERYTIME you want to change something and see the change. But that’s not all, now that you’ve compiled, your application’s DLL now has a new version number, forcing IIS and .NET to shit themselves and take 10-20 seconds to make you log back in to your application because your DLL is a new version. Ahhhhhhhhhh. So much more wasted development time, especially when you add up all that wasted time over the course of a year or more. It’s like the years we spend driving our cars over the course of our lifetime. At least while driving you get to take in the scenes, punch the excelerator and possibly enjoy the ride. With compiling time, you’re usually staring at the monitor yelling at the top of your lungs: “HURRY THE FUCK UP”.
So you’ve made the right choice if you have chosen PHP
Great Free Community Support
Can’t figure out something in your code? Google it and you’ll have hundreds of pages all openly giving advice. This is mostly true for most languages, but not all. PHP has been in use for a very long time and has a massive community. Basically, as long as you know how to search correctly and/or describe your problem, someone, somewhere will have had your problem before and will have an answer online for you. Just make sure, before asking at forums, that you have SEARCHED the forums first, otherwise you’ll get hate responses saying “Search the fucking forum moron, we’ve dealt with your problem countless times”. Which does nothing for your self esteem if you are a programmer starting out …but I guess it’ll teach you the rules of forums quick smart
If you can’t find the answer online from free information, experts-exchange.com is a great place to go for really hard, possibly unique problems. You’ll get quick responses to your problems from experts all over the world. (Free and paid options available for this type of support)
The community also has a LOT of free code available for you to use. You can often find examples or complete tutorials describing how to do different things in PHP. My site is one such example
Integrates Easily With HTML
Some languages make it quite difficult to integrate code with the user interface (.NET uses ASP.NET with controls in amongst HTML, which I find annoying because it’s just something else to learn on top of HTML) but with PHP, if you know HTML, you’re all set.
For example:
<?php $my_number = 21 + 5; ?> this is some text and the calculation's value is <?=$my_number?>
Those are my favourite reasons for using PHP. I’m sure there are many others.
admin is
Email this author | All posts by admin
