20 replies
Is PHP a badly designed programming language?
#php #programming
  • Profile picture of the author samntly
    That's a very open ended question. The correct question is what do you consider to be features of good programming language vs what do you consider to be features of bad programming language?
    Signature

    Need A PHP Programmer That You Can Count On, That's Professional, Experienced in working with small and large clients. Reach me on skype at "Netlyte" or visit me at http://www.LCCWebDesign.com

    {{ DiscussionBoard.errors[10173877].message }}
    • Profile picture of the author Gaurav singh
      Originally Posted by samntly View Post

      That's a very open ended question. The correct question is what do you consider to be features of good programming language vs what do you consider to be features of bad programming language?
      Thanks, let me correct my question what are pros and cons of PHP as a programming language ?
      {{ DiscussionBoard.errors[10174298].message }}
  • Profile picture of the author unicom
    Can you be little more clear with your question
    {{ DiscussionBoard.errors[10180894].message }}
  • Profile picture of the author kdavies
    Yes it is, one reason being that is tries to be both a object-oriented language and a functional language. Also function signatures are not consistent. For example you may have a string function where the "haystack" parameter is the first parameter and another string function where the "haystack" parameter is the last parameter.
    {{ DiscussionBoard.errors[10181658].message }}
  • Profile picture of the author schnitzelattack
    One pro for PHP is the constant development of the language. New features are added and there is an upcoming version (5.7 or 7, what ever it will be) that will address performance issues and according to them will run at least 2 times as fast for current code.
    {{ DiscussionBoard.errors[10181667].message }}
  • Profile picture of the author ynef
    I think PHP is beautiful. Especially when written OO style, but I keep hearing more and more about node.js which is a server side javascript language that is supposedly replacing PHP in the future.
    Signature

    Content writer, web developer, SEO consultant - Ynef's Portfolio

    {{ DiscussionBoard.errors[10182545].message }}
    • Profile picture of the author Oprezy
      Originally Posted by ynef View Post

      I think PHP is beautiful. Especially when written OO style, but I keep hearing more and more about node.js which is a server side javascript language that is supposedly replacing PHP in the future.
      1. I've got a question, what's OO style?
      And,

      2. I run a news blog for nigerian students in my country but i want to learn how to code in java and PHP.

      Can someone suggest useful resources?
      {{ DiscussionBoard.errors[10193366].message }}
      • Profile picture of the author bigshot90210
        I love that ebook how to write PHP is 24hrs. However, on Sunday I found a Standford kid who explained how to write in PHP in like 7 minutes. I selected the video and boy, it is excellent. He covered nearly every reserved word, and visually showed how to write form and process the data on the back end, making for the perfect video. To truly grasp what he is saying, you need to have learned a programming language other than php because he explains/defines variables, strings and use of strings and that crazy {} bracket thing and that got me puzzled. I love writing code, but I am not a programmer, but I would like to apply it when necessary. Learn PHP and if you are not information technology, it will take a while. I love solving problems by extending a software program, ie MS Office, outlook, access, DOS or Windows, filezilla, etc.but one thing I have noticed, I can not get paid doing it, cause I suck at it I guess. Maybe? Another thing is because I suck at it, anything I write~ can be rewritten better by someone else, so I settle for what I know and for what I need. Sorry this message is so, so long.
        Signature

        Get free information about my micro video
        http://pdsp.us/new_wso

        {{ DiscussionBoard.errors[10306116].message }}
  • Profile picture of the author kavyaanjali
    hello,
    according to me php is just not that bad. using php you can solve any problem related to web site development. its a scripting language. there are many other languages which will help in web development but php is the simplest.
    {{ DiscussionBoard.errors[10185760].message }}
  • Profile picture of the author bodsigroup
    Here is the my code. I have created the code but everything is ok... but pagination is not working.


    Please Give a solution....

    Here is the code:


    <script type="text/JavaScript">
    <!--
    function MM_jumpMenu(targ,selObj,restore){ //v3.0
    eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
    if (restore) selObj.selectedIndex=0;
    }
    //-->
    </script>
    <?php

    $page_url = 'managepageuser.php';
    $display_per_page = constant("DISPLAYPERPAGE");

    if(isset($_GET['pages']) && $_GET['pages']!="1")
    {
    $pages = $_GET['pages'];
    $from_limit = ($pages-1) * $display_per_page;
    $to_limit = $from_limit + $display_per_page;
    }
    else
    {
    $pages = 1;
    $from_limit = 10;
    $to_limit = $from_limit + $display_per_page;
    }

    if($to_limit > $num_lists)
    {
    $to_limit = $num_lists;
    }


    if($num_lists > 0)
    {
    $total_pages = intval($num_lists / $display_per_page);
    if($total_pages!='0')
    {
    if(($num_lists % $display_per_page) !='0') { $total_pages = $total_pages +1; }
    }
    $prev = $pages - 1;
    $next = $pages + 1;
    $first = 1;
    $last = $total_pages;
    $pages_cnt = 1;
    if($total_pages > $pages_cnt)
    {
    $paging_txt .= "<a href='$page_url?pages=$first'>&laquo;&laquo; FIRST</a> | ";
    if($pages >1) { $paging_txt .= " <a href='$page_url?pages=$prev'>&laquo;PREVIOUS</a> | "; }
    $paging_txt .= "<select name=\"menu1\" onchange=\"MM_jumpMenu('parent',this,0)\">";

    while($pages_cnt <= $total_pages)
    {
    //$paging_txt .= " | <a href='$page_url?pages=$pages_cnt'>".$pages_cnt."</a>";
    $paging_txt .= "<option value='".$page_url."?pages=".$pages_cnt."'";
    if($pages_cnt == $_GET['pages']) { $paging_txt.= "selected"; }
    $paging_txt.= ">".$pages_cnt."</option>";
    $pages_cnt++;
    }

    $paging_txt .= "</select>";

    if($pages > 0 && $pages < $total_pages) { $paging_txt .= " | <a href='$page_url?pages=$next'>NEXT&raquo;</a>"; }
    if($pages !=$total_pages) { $paging_txt .= " | <a href='$page_url?pages=$last'>LAST &raquo;&raquo;</a>"; }
    }
    }
    ?>

    <?php
    if((isset($_GET['cmd'])) && ($_GET['cmd'] == "status")) {
    mysql_query("update $from_limittabledouser set driver_status='".$_GET['status']."' where driver_id='".$_GET['id']."'") or die(mysql_error());
    }
    if((isset($_GET['cmd'])) && ($_GET['cmd'] == "del")) {
    mysql_query("delete from $tabledouser where id='".$_GET['id']."'") or die(mysql_error());
    }

    /**** FETCH ALL DRIVER RECORDS ***/
    if($_SESSION['admintype'] == 'superadmin') {
    $sql_list = mysql_query("select * from $tabledouser order by user_name ASC") or die(mysql_error());
    $num_list = mysql_num_rows($sql_list);
    } else {
    $sql_list = mysql_query("select * from $tabledouser order by user_name ASC") or die(mysql_error());
    $num_list = mysql_num_rows($sql_list);
    }
    ?>
    <table width="100%" border="0" cellspacing="0" cellpadding="0">

    <?php if(isset($_GET['success_msg'])) { ?>
    <tr>
    <td valign="top" align="center" class="greentxt"><?php echo $_GET['success_msg']; ?></td>
    </tr>
    <?php } ?>
    <?php if($num_list > 0) { ?>
    <tr>
    <td valign="top" align="center"><table width="100%" border="0" cellspacing="0" cellpadding="0" class="rowstbl display" rel="datatable" id="example">
    <thead>
    <tr>
    <th width="6%" align="center" nowrap="nowrap">&nbsp;</th>
    <th width="11%" align="center" nowrap="nowrap">ID </th>
    <th width="8%" align="center" nowrap="nowrap">User Name </th>
    <th width="8%" align="center" nowrap="nowrap">Full Name</th>
    <th width="28%" align="center" nowrap="nowrap">Email</th>
    <th width="17%" align="center" nowrap="nowrap">Mobile Number </th>
    <th width="8%" align="center" nowrap="nowrap">Time Login</th>
    <th width="10%" align="center" nowrap="nowrap">Edit</th>
    <th align="center">Delete</th>
    </tr>
    <tbody>
    <?php while($res_list = mysql_fetch_array($sql_list)) {
    $current_time = date("Y-m-d H:i:s");
    $last_current_time = date("Y-m-d H:i:s",mktime(date("H"),date("i")-1,date("s"),date("m"),date("d"),date("Y")));
    ?>
    <tr>
    <td align="center"><?php if((isset($_GET['id'])) && ($_GET['id'] == $res_list['id'])) { ?><img src="images/tick.png" /><?php } ?></td>
    <td align="center"><?php echo $res_list['id']; ?></td>
    <td align="center"><?php echo $res_list['user_name']; ?></td>
    <td align="center"><?php echo $res_list['full_name']; ?></td>
    <td align="center"><?php echo $res_list['email']; ?></td>
    <td align="center"><?php echo $res_list['cntrycode'].'-'.$res_list['mobile']; ?></td>
    <td align="center"><?php echo $res_list['create_at']; ?></td>
    <td align="center"><a href="javascript:confirmbox_edit(<?php echo $res_list['id']; ?>)"><img src="images/edit.png" width="29" height="29" border="0" /></a></td>
    <td align="center"><a href="javascript:confirmbox(<?php echo $res_list['id']; ?>)"><img src="images/delete.png" width="29" height="29" border="0" /></a></td>
    </tr>
    <?php } ?>
    </tbody>
    </table></td>
    </tr>
    <?php } else { ?>
    <tr>
    <td align="center" class="dtlboxbg tdmargin redtxt"><div align="center">NO RECORD FOUND</div></td>
    </tr>
    <?php } ?>
    </table>
    {{ DiscussionBoard.errors[10185900].message }}
  • Profile picture of the author yourfriend78640
    There are mixed opinions about PHP. Is it a badly designed language?
    You can say that it is poorly maintained but to answer your above question, you will have to crack a debate here.

    Many people say that it creates ugly code and gives you tough time maintaining the code. But most of the time, it is not language's fault. It is developers fault which creates code bloats.
    {{ DiscussionBoard.errors[10193384].message }}
  • Profile picture of the author andreajhon
    In my opinion, php is a badly designed programming language. The makers of PHP just wanted to solve a problem. PHP was something that happened and not a well thought out plan as Rasmus Lerdof, its creator says. Other languages, say like python was built for a purpose. Readability, easily deploy a site with little effort. Django, the most popular python framework has a tag line proving the same : "The web framework for perfectionists with deadlines.
    {{ DiscussionBoard.errors[10194826].message }}
  • Profile picture of the author techwizard
    I dont think that php is badly designed language as most of the cms system are using php and its working quite well for even programers and end users too
    {{ DiscussionBoard.errors[10199248].message }}
  • Profile picture of the author kavyaanjali
    Any programming language is not bad, every language has their own pros and cons. php stands for hyper text preprocessor. it is open source programming language means php software's and code are freely available on the web and we can modify and enhance the code. no licence is required. php is most suited for web development.
    {{ DiscussionBoard.errors[10291924].message }}
    • Profile picture of the author LibertyUnc
      PHP, like most languages, can be as good or bad as you make it.

      Lots of people turn their noses up at PHP because there is so much bad PHP code out there.

      Of course, most of those people that I have met don't write the greatest code themselves.

      Any good programmer can use most languages and end up with good clean code. Any mediocre programmer can use most languages and end up with something that is bloated and hard to maintain.

      I don't believe the language itself is badly designed. I just feel that being a relatively easy language to get started with (no need to learn about compilation, library linking, and other things that many languages need), lots of people new to programming use it with sub par results.

      I personally haven't encountered anything that was terribly hard to do with PHP excepting those things that PHP simply cannot do...
      {{ DiscussionBoard.errors[10293110].message }}
  • Profile picture of the author Wiliam Haminton
    I think you is fan ASP . I like PHP !
    {{ DiscussionBoard.errors[10450410].message }}
    • Profile picture of the author GeckoTribe
      Sure, PHP has it's blemishes (like argument order inconsistencies mentioned by kdavies). But there's nothing so wrong with it that it's not a perfectly good language for web development.

      On the other hand, it has several major strengths, such as:

      * It's supported practically everywhere.
      * It's drop dead easy to get started using.
      * You can stick code inline in HTML code to add little dynamic bits anywhere you want.

      If it were a "bad" language, I'd think projects like WordPress would have moved to something else long ago. Are there other languages that are "better"? Depending on what aspects of the language are most important to you, I'm sure there are. But it's a perfectly acceptable alternative.
      Signature

      Antone Roundy

      Want up to 57 bloggers to support your blog? Join a Team (free).

      Keep your blog active faster and easier with "Blog Riffing":
      * Free: PDF, High Impact Blog Riffing Course

      {{ DiscussionBoard.errors[10450430].message }}
  • Profile picture of the author andrewdennish
    PHP is a server-side scripting language designed for web development but also used as a general-purpose programming language.
    {{ DiscussionBoard.errors[10471687].message }}
  • Profile picture of the author apsarasisodia
    Personal Home Page (PHP) is a very easy programming language. Since it is very flexible, most people may think at first that it is badly designed website development language. Don't listen to those. It is all about perception. Go and learn it at once!
    {{ DiscussionBoard.errors[10471706].message }}

Trending Topics