I couldn't understand why PHP is so popular. The PHP code looks sohorrible compared with Java.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • tenxian

    I couldn't understand why PHP is so popular. The PHP code looks sohorrible compared with Java.

    Could you put up with the horrible PHP code?
  • macca

    #2
    Re: I couldn't understand why PHP is so popular. The PHP code looksso horrible compared with Java.

    Since you have already admitted in comp.lang.java. programmer (Is there
    any web programmer who is willing to help me...)

    "I'm poor at programming."


    What the hell would you know.

    Comment

    • Rik Wasmus

      #3
      Re: I couldn't understand why PHP is so popular. The PHP code looks so horrible compared with Java.

      On Tue, 29 Apr 2008 08:00:47 +0200, tenxian <hi.steven.tu@g mail.comwrote:
      Could you put up with the horrible PHP code?
      No offcourse not, that's why we read this group.

      For comparison, here's some Perl:
      #!/usr/bin/perl -l
      s--@{[(gE^Ge)=~/[^g^e]/g]}[g^e]x((!!+~~g^e^g^e )<<pop).!gE-ge,
      s-[^ge^ge]-s,,,,s,@{[(g^';').(e^'?')]},(G^'/').(E^'|')^Ge,g e,
      print,s,(?<=/[^g^e])[^g^e][^g^e],$&^(G^'/').(E^'|')^gE,g e-ge
      --
      Rik Wasmus

      Comment

      • =?iso-8859-1?Q?Kim_Andr=E9_Aker=F8?=

        #4
        Re: I couldn't understand why PHP is so popular. The PHP code looks so horrible compared with Java.

        tenxian wrote:
        Could you put up with the horrible PHP code?
        Yes, I can. PHP is a language that's easy to learn and easy to use,
        which is why so many choose to use it.

        IMO, it's not much more horrible than C++ or Java; it all depends on
        the programmer who makes use of it.

        --
        Kim André Akerø
        - kimandre@NOSPAM betadome.com
        (remove NOSPAM to contact me directly)

        Comment

        • Cosmic programmer

          #5
          Re: I couldn't understand why PHP is so popular. The PHP code looks so horrible compared with Java.



          "tenxian" <hi.steven.tu@g mail.comwrote in message
          news:9dc74d6a-7a68-4e57-9c47-313ebb02609e@n1 g2000prb.google groups.com...
          Could you put up with the horrible PHP code?
          It takes several months before one becomes productive in Java. All those
          abstract classes and interfaces are quite confusing. PHP is much simpler but
          very powerful.
          Btw can you access a field of resultset in Java like this

          resultset[var]

          where var is a variable and not a literal?



          Comment

          • Erwin Moller

            #6
            Re: I couldn't understand why PHP is so popular. The PHP code looksso horrible compared with Java.

            Rik Wasmus schreef:
            On Tue, 29 Apr 2008 08:00:47 +0200, tenxian <hi.steven.tu@g mail.comwrote:
            >Could you put up with the horrible PHP code?
            >
            No offcourse not, that's why we read this group.
            >
            For comparison, here's some Perl:
            #!/usr/bin/perl -l
            s--@{[(gE^Ge)=~/[^g^e]/g]}[g^e]x((!!+~~g^e^g^e )<<pop).!gE-ge,
            s-[^ge^ge]-s,,,,s,@{[(g^';').(e^'?')]},(G^'/').(E^'|')^Ge,g e,
            print,s,(?<=/[^g^e])[^g^e][^g^e],$&^(G^'/').(E^'|')^gE,g e-ge
            LOL.
            The old I-hate-PERL-vibes are running up my spine again.
            Thanks for reminding me why I code PHP these days. ;-)

            Regards,
            Erwin Moller

            Comment

            • Erwin Moller

              #7
              Re: I couldn't understand why PHP is so popular. The PHP code looksso horrible compared with Java.

              tenxian schreef:
              Could you put up with the horrible PHP code?
              Dear Mr. Troll,

              I expect you mastered both Java and PHP before spitting your wisdom?
              Is that correct?

              I coded a few years in both languages, and can only say I need LOADS of
              time to get things done in Java (J2EE/tomcat).
              My honest estimate is that I code around 3-4 times faster in PHP, and I
              produce readable code.

              In Java, you needs to have intimate knowledge of all classes interfaces
              you use, even to get the most modests tasks done.
              Personally, I don't see the advantage of Java above PHP when it comes to
              serverside programming.
              For me PHP is easier to read, easier to understand, and easier to
              maintain. Above that: PHP is less errorprone since you don't need to
              know hundreds of classes/interfaces to do basic stuff.

              Now I wonder, what made you post this?

              Regards,
              Erwin Moller

              Comment

              • Tim Streater

                #8
                Re: I couldn't understand why PHP is so popular. The PHP code looks so horrible compared with Java.

                In article <4816ec6b$0$143 54$e4fe514c@new s.xs4all.nl>,
                Erwin Moller
                <Since_humans_r ead_this_I_am_s pammed_too_much @spamyourself.c omwrote:
                Rik Wasmus schreef:
                On Tue, 29 Apr 2008 08:00:47 +0200, tenxian <hi.steven.tu@g mail.comwrote:
                Could you put up with the horrible PHP code?
                No offcourse not, that's why we read this group.

                For comparison, here's some Perl:
                #!/usr/bin/perl -l
                s--@{[(gE^Ge)=~/[^g^e]/g]}[g^e]x((!!+~~g^e^g^e )<<pop).!gE-ge,
                s-[^ge^ge]-s,,,,s,@{[(g^';').(e^'?')]},(G^'/').(E^'|')^Ge,g e,
                print,s,(?<=/[^g^e])[^g^e][^g^e],$&^(G^'/').(E^'|')^gE,g e-ge
                >
                LOL.
                The old I-hate-PERL-vibes are running up my spine again.
                Thanks for reminding me why I code PHP these days. ;-)
                Does that actually *do* anything? Or is it *really* just line-noise? I
                copy pasted it into Terminal and all I got was a perl syntax error.

                Comment

                • Rik Wasmus

                  #9
                  Re: I couldn't understand why PHP is so popular. The PHP code looks so horrible compared with Java.

                  On Tue, 29 Apr 2008 11:55:29 +0200, Tim Streater
                  <tim.streater@d ante.org.ukwrot e:
                  In article <4816ec6b$0$143 54$e4fe514c@new s.xs4all.nl>,
                  Erwin Moller
                  <Since_humans_r ead_this_I_am_s pammed_too_much @spamyourself.c omwrote:
                  >
                  >Rik Wasmus schreef:
                  On Tue, 29 Apr 2008 08:00:47 +0200, tenxian <hi.steven.tu@g mail.com
                  >wrote:
                  >Could you put up with the horrible PHP code?
                  >
                  No offcourse not, that's why we read this group.
                  >
                  For comparison, here's some Perl:
                  #!/usr/bin/perl -l
                  s--@{[(gE^Ge)=~/[^g^e]/g]}[g^e]x((!!+~~g^e^g^e )<<pop).!gE-ge,
                  s-[^ge^ge]-s,,,,s,@{[(g^';').(e^'?')]},(G^'/').(E^'|')^Ge,g e,
                  print,s,(?<=/[^g^e])[^g^e][^g^e],$&^(G^'/').(E^'|')^gE,g e-ge
                  >>
                  >LOL.
                  >The old I-hate-PERL-vibes are running up my spine again.
                  >Thanks for reminding me why I code PHP these days. ;-)
                  >
                  Does that actually *do* anything? Or is it *really* just line-noise? I
                  copy pasted it into Terminal and all I got was a perl syntax error.
                  Well, offcourse it's deliberately obscure.
                  It creates triangles based on a number:
                  $test.pl 1
                  /\
                  /\/\

                  $test.pl 2
                  /\
                  /\/\
                  /\ /\
                  /\/\/\/\

                  $test.pl 3
                  /\
                  /\/\
                  /\ /\
                  /\/\/\/\
                  /\ /\
                  /\/\ /\/\
                  /\ /\ /\ /\
                  /\/\/\/\/\/\/\/\

                  $test.pl 4
                  /\
                  /\/\
                  /\ /\
                  /\/\/\/\
                  /\ /\
                  /\/\ /\/\
                  /\ /\ /\ /\
                  /\/\/\/\/\/\/\/\
                  /\ /\
                  /\/\ /\/\
                  /\ /\ /\ /\
                  /\/\/\/\ /\/\/\/\
                  /\ /\ /\ /\
                  /\/\ /\/\ /\/\ /\/\
                  /\ /\ /\ /\ /\ /\ /\ /\
                  /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
                  --
                  Rik Wasmus

                  Comment

                  • Jerry Stuckle

                    #10
                    Re: I couldn't understand why PHP is so popular. The PHP code looksso horrible compared with Java.

                    tenxian wrote:
                    Could you put up with the horrible PHP code?
                    >
                    Hi, troll. It's obvious you know nothing about either language.

                    The language has nothing to do with it. It all depends on the
                    programmer. If you write horrible code in PHP, that's your problem.


                    --
                    =============== ===
                    Remove the "x" from my email address
                    Jerry Stuckle
                    JDS Computer Training Corp.
                    jstucklex@attgl obal.net
                    =============== ===

                    Comment

                    • ZeldorBlat

                      #11
                      Re: I couldn't understand why PHP is so popular. The PHP code looksso horrible compared with Java.

                      On Apr 29, 2:00 am, tenxian <hi.steven...@g mail.comwrote:
                      Could you put up with the horrible PHP code?
                      I completely agree. I mean, it's ridiculous that you need all this
                      code just for a simple "hello world" program:

                      <?php
                      $arrData = array(72,101,10 8,108,111,32,87 ,111,114,108,10 0,33) ;

                      for($i = 0; $i < count($arrData) ; $i++) {
                      $char = $arrData[$i];
                      $char = fConvertChar($c har);
                      print $char;
                      }

                      function fConvertChar($c har) {
                      $char = 72 + 2 * $char / 4 * 2 - (8.32 * 8.65384);
                      $char = chr($char);
                      return $char;
                      }
                      ?>

                      Comment

                      • Captain Paralytic

                        #12
                        Re: I couldn't understand why PHP is so popular. The PHP code looksso horrible compared with Java.

                        On 29 Apr, 13:02, ZeldorBlat <zeldorb...@gma il.comwrote:
                        On Apr 29, 2:00 am, tenxian <hi.steven...@g mail.comwrote:
                        >
                        Could you put up with the horrible PHP code?
                        >
                        I completely agree. I mean, it's ridiculous that you need all this
                        code just for a simple "hello world" program:
                        >
                        <?php
                        $arrData = array(72,101,10 8,108,111,32,87 ,111,114,108,10 0,33) ;
                        >
                        for($i = 0; $i < count($arrData) ; $i++) {
                        $char = $arrData[$i];
                        $char = fConvertChar($c har);
                        print $char;
                        >
                        }
                        >
                        function fConvertChar($c har) {
                        $char = 72 + 2 * $char / 4 * 2 - (8.32 * 8.65384);
                        $char = chr($char);
                        return $char;}
                        >
                        ?>
                        Wow, I never realised you could do Hello World without instantiating a
                        custom class.

                        Comment

                        • Willem Bogaerts

                          #13
                          Re: I couldn't understand why PHP is so popular. The PHP code looksso horrible compared with Java.

                          tenxian wrote:
                          Could you put up with the horrible PHP code?
                          Yes, PHP has something that is called "alternativ e syntax". Without it,
                          PHP would be as incomprehensibl e as java!

                          LOL,
                          --
                          Willem Bogaerts

                          Application smith
                          Kratz B.V.

                          Comment

                          • Michael Fesser

                            #14
                            Re: I couldn't understand why PHP is so popular. The PHP code looks so horrible compared with Java.

                            ..oO(Rik Wasmus)
                            >Well, offcourse it's deliberately obscure.
                            >It creates triangles based on a number:
                            >$test.pl 1
                            /\
                            >/\/\
                            >
                            >$test.pl 2
                            /\
                            /\/\
                            /\ /\
                            >/\/\/\/\
                            >
                            >$test.pl 3
                            /\
                            /\/\
                            /\ /\
                            /\/\/\/\
                            /\ /\
                            /\/\ /\/\
                            /\ /\ /\ /\
                            >/\/\/\/\/\/\/\/\
                            >
                            >[...]
                            JFTR: These structures are called Sierpinski triangles and are quite
                            well-known fractals.



                            Here's something similar in PHP, also quite famous:

                            <pre><?php $c=0;for($y=1.2 ;$y>-1.3;$y-=0.1){for($x=-2.08;$x<.92;$x+ =.04){$r=
                            $n=0;for($h=127 ;$r*$r+$n*$n<4& &--$h>32;){$d=$r;$ r=$r*$r-$n*$n+$x;$n=2*$ d*$n+
                            $y;}($x>0.98)?p rint chr(10):print chr($h);if(++$c %75==0)print"\n ";}}?></pre>

                            Micha

                            Comment

                            • Lars Eighner

                              #15
                              Re: I couldn't understand why PHP is so popular. The PHP code looks so horrible compared with Java.

                              In our last episode, <67o3n9F2oekueU 1@mid.individua l.net>, the lovely and
                              talented Kim André Akerø broadcast on comp.lang.php:
                              tenxian wrote:
                              >Could you put up with the horrible PHP code?
                              Yes, I can. PHP is a language that's easy to learn and easy to use,
                              which is why so many choose to use it.
                              Widely supported has something to do with it. Just about commercial host is
                              going to have PHP and MySQL.

                              For web applications, it is sort of like inside-out perl. Lots of
                              processing and little markup output: perl or C(++). Lots of markup, a
                              little processing: PHP. Giant dedicated serverzilla for major landmark
                              site: Java.
                              IMO, it's not much more horrible than C++ or Java; it all depends on
                              the programmer who makes use of it.


                              --
                              Lars Eighner <http://larseighner.com/usenet@larseigh ner.com
                              Countdown: 266 days to go.

                              Comment

                              Working...