Home > PHP > PHP is not a bad programming langauge

PHP is not a bad programming langauge

Roshan posted in his blog some reasons of why PHP is a bad programming langauges in his oppinion. Unfortunately, I disagree in some of the points Roshan pointed out.

1) No need to define and declare variable
2) No Strict data conversion

I can’t see how these two points can make PHP a bad programming language. PHP just let the interpreter binds the variable to a type.

In my opinion, dynamic type binding provides a great deal of flexibility in programming. You don’t have to know the type of the data input to be able to process it. However, that flexibility advantage is not free. It will cost us the speed of detecting the type of the assigned value each time a new value is assign to the variable.

4) No namespaces

Namespace will be introduced in PHP 5.3.

6) Seldom use of Framework

It depends on the developers and the size of the project. There are many Frameworks available and for free. But when some, or many, developers decided not to use Framework in their projects I can’t see how it makes PHP a bad programming language. Like any other programming languages, you can always not use framework for any kind of project.

what i think, PHP is a incomplete programming language as well as a bad programming language which gives bad practise for the programmers.

It can’t be true. PHP is one of the famous programming languages (after Java) and one of the most used. Many companies and organizations prefer LAMP developers than any kinds of web developers. PHP is still growing and you can find almost any sample of codes available all over the web.

Sponsor Text
VCP-310 test focuses on the VMware product lines and as well on the ESX server. 640-802 judges a candidate’s abilities and skills needed to install, operate, as well as troubleshoot medium size company branch network. 70-290 and 70-291 enables you to learn about connectivity needs for example connecting branch offices and individual users in remote places to the company network. The MCSE on Windows Server 2003 is a requirement and basic criteria for 70-649.

Categories: PHP Tags:
  1. Chase Saunders
    December 20th, 2007 at 17:19 | #1

    I love dynamic typing, but LOTS of studies show that static typing leads to dramatically lower bug rates in many situations and for “the masses” of programmers (not necessarily the elites).

  2. Jacques Marques
    December 20th, 2007 at 19:45 | #2

    Hello,

    I agree with you, if PHP was a bad programming langauge it don’t have so many programmers and enterprises using it.
    The code produced in PHP cannot be the prettiest thing, but it is easy of understanding, principally for beginners.
    This talk about bad practise for the programmers depends on the programmers and not on the language.
    Even in Java it is possible to produce a code that not conforme with the best practices.

  3. December 20th, 2007 at 22:27 | #3

    I completely agree with you, PHP is a lovely language that everyone should try eventually, and it’s not entirely a web language either as you can also create gui php applications. Sure it might have some issues but overall I think it has been one of the best of all time.

  4. December 21st, 2007 at 00:45 | #4

    From the pure comp-sci perspective, PHP is a terrible language. How can you possibly call a language “good” if it doesn’t have a specification? And not just that, but naming conventions, calling conventions, a well defined execution model. Does ANY of you who comment here know *how* PHP’s garbage collector works?

    On the other hand, PHP is a practical language. It gets the job done fast and efficient. Still not good enough to be a “decent” language.

  5. Jon
    December 21st, 2007 at 15:19 | #5

    PHP is a good language. It’s not an elegant language or a well designed language, but it has many desirable features that many languages lack almost entirely:

    1. It has a straight learning curve. Easy tasks are easy, harder tasks are proportionately harder. Many languages either have huge upfront effort, or sudden complexity once the basics are mastered.

    2. It encourages code reuse. Think about it. Sure, no packages, no namespaces, and dubious object model. But take a look at the internet and see how much freely available code is out there being re-used, and compare that to many other languages. People keeping thinking that inheritance and such are key to code reuse. That’s rubbish. People were sharing and reusing code long before object orientation had even been thought of.

    3. It is highly abstracted from from the operating system – far more so than languages such as Java. A PHP application can often be simplied copied file by file from one machine to another and work fine.

    4. It has no complication step. I hate to think how much time my highly paid developers spend wating for Java projects to recompile and for tomcat to re-load and recompile JSPs. It’s painful.

  6. Steve-O
    December 21st, 2007 at 21:06 | #6

    Every few days there are posts that get (mostly amateur) developers arguing over how their favorite programming language is better than or how language x sucks because it doesn’t have such and such functionality of language y.

    These arguments are totally baseless. No one programming language is going to be a perfect fit in all scenarios. Any programming language is going to look like a “bad language” in the hands of a beginner or amateur. Since PHP is so simple to get going (what hosting provider doesn’t support it?), there are higher rates of beginning users running around working in PHP and creating mountains and mountains of spaghetti code…and hence produce mountains and mountains of useless blog posts complaining that PHP sucks because of that. This is the result of bad development practices and does not signify the language is bad.

    Whenever I hear developers complaining that language x sucks and language y is better, I cringe and generally you can sniff out the amateur. Most times they are just repeating drivel they read on another blog post without actually doing their own research.

    Case in point the original author of the article. Most of his arguments should be defined under “bad programming practices” and not simply that PHP is inherently bad.

    Again, any language that is so easily accessible to beginners and amateurs is going to produce vast amounts of bad code…but this is not necessarily the fault of the language but rather the lack of experience and laziness of the amateur developer.

  7. cowfish
    March 4th, 2008 at 12:39 | #7

    Is it more appropriate to talk about good programmer/bad programmer or good language/bad language? I think the issue is with bad programmers. It’s rarely the issue with the language itself.

    Some languages maybe less “strict” than others in helping enforce good programming discipline.

    But ultimately its the programmers who are responsible for their own code. If you turn out with bad code you can’t blame the language. Computer Science/ Software Engineering students should know to pick the tool that fits the goal. Well-formed PHP is as achievable as well formed Java, but the nature of PHP may limit it to smaller to medium sized applications in terms of maintainability.

    When PHP fits your goal, then by all means use it. If you’re developing an enterprise application that you think needs the robustness and “purity” of the Java language, then use it.

    But the most important thing is to write good code. This usually means understanding and applying OOP and maybe even using frameworks. PHP has a popular framework called CakePHP.

  8. April 6th, 2008 at 14:48 | #8

    Hello man…….I’ve already moved my blog….that link should be pointing to this article
    http://roshanbh.com.np/2007/12/php-a-bad-programming-language-dark-side-of-php.html
    not to that old article…..

    Roshan

  9. April 9th, 2008 at 14:14 | #9

    Hey 🙂
    Okay fixed the link… Thanks.

  10. April 7th, 2009 at 02:28 | #10

    Haha ^^ nice, is there a section to follow the RSS feed

  1. January 29th, 2009 at 07:35 | #1