I hear a lot of things about PhP and folks are pretty divided as to the use of PhP.
I would love to get people’s opinion in regards to the language and why or why not develop in PhP….
Ultimately, everything boils down to personal style. Just about anything can be done in any language. So here are just a few thoughts.
To its credit, PHP has come a long way since it really got popular back in version 3. Object support has really come around in version 5. This is nice for those of us coming from backgrounds with compiled languages like C++ or Java.
PHP is typically associated with web apps. If you’re building a new web app, and you haven’t yet picked an implementation language, PHP should be on your list of potentials. If you’re building an app that isn’t web-based then PHP probably isn’t going to make the short list.
PHP is easy to learn. This is a double edged sword. It means that when staffing a project you’ll be able to find lots of people who have experience with the language. But you’ll find a smaller percentage of people who are really outstanding.
PHP has a large standard library. This means that it’s readily useful in a large number of areas. This is a big plus pretty much no matter how you slice it.
To go a bit more computer sciency, when comparing among any set of languages you’ll want to consider two things; Is the language statically typed or dynamically typed? and Is the language compiled or interpreted. Compiled languages typically run faster, but are (depending on the language and the circumstances) slower to develop and debug. I won’t go into the details of why. Interpreted languages can be much faster to develop in, but can lack a lot of the nice development tools that you get from a compiled language like Java. There are compilers for a number of interpreted languages including PHP, Ruby and Python. In my experience, these compilers are used more for packaging an application, than as an essential tool for developing an application as would be the case for an application written in C++ or Java. But they certainly will help with the speed difference. So it’s probably a wash here for PHP.
As for static vs. dynamic typing, dynamically-typed languages let you get away with making more of certain types of mistakes in the code, leading to more bugs. Test-driven development can help significantly to reduce the bugginess of the code. And in the end, it’s going to come down to the seniority of your developer. More senior guys just make fewer of the kind of mistakes that dynamically-typed languages let you make.
As for my personal opinion, I have nothing against PHP. It’s good for certain things. But, having developed in a few different languages, I just find that other languages are more natural. I like to write code that almost reads like english at a high level, and at a low level is very clear and concise, making even complex algorithms easy to understand. Ruby is the language that lets me do this best.
You’ll find a million “my programming language is better than your programming language” debates on the web. I often get the feeling that they’re written by people just learning a language. They’re excited and enthusiastic about their new language and are trying to justify the time they’re spending on that language instead of another language which supposedly does x, y and z better. I don’t pay attention to them. Like I said, in the end it all boils down to personal preference and the specific application.
Ultimately, everything boils down to personal style. Just about anything can be done in any language. So here are just a few thoughts.
To its credit, PHP has come a long way since it really got popular back in version 3. Object support has really come around in version 5. This is nice for those of us coming from backgrounds with compiled languages like C++ or Java.
PHP is typically associated with web apps. If you’re building a new web app, and you haven’t yet picked an implementation language, PHP should be on your list of potentials. If you’re building an app that isn’t web-based then PHP probably isn’t going to make the short list.
PHP is easy to learn. This is a double edged sword. It means that when staffing a project you’ll be able to find lots of people who have experience with the language. But you’ll find a smaller percentage of people who are really outstanding.
PHP has a large standard library. This means that it’s readily useful in a large number of areas. This is a big plus pretty much no matter how you slice it.
To go a bit more computer sciency, when comparing among any set of languages you’ll want to consider two things; Is the language statically typed or dynamically typed? and Is the language compiled or interpreted. Compiled languages typically run faster, but are (depending on the language and the circumstances) slower to develop and debug. I won’t go into the details of why. Interpreted languages can be much faster to develop in, but can lack a lot of the nice development tools that you get from a compiled language like Java. There are compilers for a number of interpreted languages including PHP, Ruby and Python. In my experience, these compilers are used more for packaging an application, than as an essential tool for developing an application as would be the case for an application written in C++ or Java. But they certainly will help with the speed difference. So it’s probably a wash here for PHP.
As for static vs. dynamic typing, dynamically-typed languages let you get away with making more of certain types of mistakes in the code, leading to more bugs. Test-driven development can help significantly to reduce the bugginess of the code. And in the end, it’s going to come down to the seniority of your developer. More senior guys just make fewer of the kind of mistakes that dynamically-typed languages let you make.
As for my personal opinion, I have nothing against PHP. It’s good for certain things. But, having developed in a few different languages, I just find that other languages are more natural. I like to write code that almost reads like english at a high level, and at a low level is very clear and concise, making even complex algorithms easy to understand. Ruby is the language that lets me do this best.
You’ll find a million “my programming language is better than your programming language” debates on the web. I often get the feeling that they’re written by people just learning a language. They’re excited and enthusiastic about their new language and are trying to justify the time they’re spending on that language instead of another language which supposedly does x, y and z better. I don’t pay attention to them. Like I said, in the end it all boils down to personal preference and the specific application.
Hope this helps.