Why php and not C?

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

    Why php and not C?

    When I first started in web programming (I left it for more than a few
    years) I programmed my web pages in C and a little perl. Now that I
    have a need to come back to web programming I find that php is all the
    rage.

    But looking a php syntax I can't help but notice it is very C like,
    which is no surprise.

    But I wonder, other than the lack of pointers in php (not a bad thing
    I admit!) and the ease in which php does variables, litte to no
    typing, why does it seem that no one is programming the web in C?

    C it would seem had the advantage of an established language, a very
    native language for the servers and it compiles down to executable.

    Why did php gain a foothold and take off?
  • DvDmanDT

    #2
    Re: Why php and not C?

    PHP is easy, common, fast and has functions for almost everything...

    In C, it's really easy to get memory leaks, it's hard (compared to PHP
    anyway), and it's overkill, as well as it might not run on any server/OS...

    Now, there are ppl using C/C++, but it has more downsides than upsides..

    --
    // DvDmanDT
    MSN: dvdmandt¤hotmai l.com
    Mail: dvdmandt¤telia. com
    "Bob" <clarke@quality think.com> skrev i meddelandet
    news:cfa521f2.0 401250455.70fc8 7ab@posting.goo gle.com...[color=blue]
    > When I first started in web programming (I left it for more than a few
    > years) I programmed my web pages in C and a little perl. Now that I
    > have a need to come back to web programming I find that php is all the
    > rage.
    >
    > But looking a php syntax I can't help but notice it is very C like,
    > which is no surprise.
    >
    > But I wonder, other than the lack of pointers in php (not a bad thing
    > I admit!) and the ease in which php does variables, litte to no
    > typing, why does it seem that no one is programming the web in C?
    >
    > C it would seem had the advantage of an established language, a very
    > native language for the servers and it compiles down to executable.
    >
    > Why did php gain a foothold and take off?[/color]


    Comment

    • Jedi121

      #3
      Re: Why php and not C?

      Bob a écrit le 25/01/2004 :[color=blue]
      > When I first started in web programming (I left it for more than a few
      > years) I programmed my web pages in C and a little perl. Now that I
      > have a need to come back to web programming I find that php is all the
      > rage.
      >
      > But looking a php syntax I can't help but notice it is very C like,
      > which is no surprise.
      >
      > But I wonder, other than the lack of pointers in php (not a bad thing
      > I admit!) and the ease in which php does variables, litte to no
      > typing, why does it seem that no one is programming the web in C?
      >
      > C it would seem had the advantage of an established language, a very
      > native language for the servers and it compiles down to executable.
      >
      > Why did php gain a foothold and take off?[/color]

      what about the ease of integration in HTML syntax? the portability of
      the code?


      Comment

      • somaBoy MX

        #4
        Re: Why php and not C?

        Just compare the time it takes to develop a cgi app that accesses a database
        and returns a resultset as html written in C to the time it takes to develop
        something similar in PHP.

        There's your answer.


        ..soma


        Comment

        • Phil Roberts

          #5
          Re: Why php and not C?

          With total disregard for any kind of safety measures
          clarke@qualityt hink.com (Bob) leapt forth and uttered:

          Why use C when you can use Assembly or even just write raw machine
          code or maybe even just edit the Inodes on your hard drive using
          magnets?

          Because it's *simpler* thats why.

          --
          Phil Roberts | Nobody In Particular | http://www.flatnet.net/

          Comment

          • Mad Max

            #6
            Re: Why php and not C?

            You have to admit that PHP is really a whole damn lot easier and
            "tweakeable " than C but for mission critical systems where speed is of
            the essence the service providers still rely on a compiled CGI script
            written in C rather than interpreted languages like PHP etc..

            You can say that C certainly beats interpreters in speed.. but have
            you ever really tried writing a CGi app in C, it really is
            overkill.... add to it the fact that the script has to be compiled
            every time u make minor changes, variables have to be carefully
            defined, memory has to be taken care of ... and so on...

            bye
            Arvind

            clarke@qualityt hink.com (Bob) wrote in message news:<cfa521f2. 0401250455.70fc 87ab@posting.go ogle.com>...[color=blue]
            > When I first started in web programming (I left it for more than a few
            > years) I programmed my web pages in C and a little perl. Now that I
            > have a need to come back to web programming I find that php is all the
            > rage.
            >
            > But looking a php syntax I can't help but notice it is very C like,
            > which is no surprise.
            >
            > But I wonder, other than the lack of pointers in php (not a bad thing
            > I admit!) and the ease in which php does variables, litte to no
            > typing, why does it seem that no one is programming the web in C?
            >
            > C it would seem had the advantage of an established language, a very
            > native language for the servers and it compiles down to executable.
            >
            > Why did php gain a foothold and take off?[/color]

            Comment

            • Bob

              #7
              Re: Why php and not C?

              Well I have written assembly, I hate it. And I have written raw
              machine code and I hate that also.

              Leaping from php to C is one thing, leaping from C to assy is another.

              It might be a point of view or where you started programming from.
              I don't have an issue writing CGI programs, and compiling is ....what
              we do everyday. With todays IDEs running a test on a php script vs
              compiling a program and running it is not all that different.

              Yes, writing a php script is simple and faster. But my question or
              ponderance was and still is, was this amount of simplicity enough to
              drive php to the forefront?

              Apparently.

              Perhaps the difference between engineers and scripters. Have you ever
              heard the phrase, "Time to shoot the engineers and ship the product"?

              I am still surprised that with all the talk of performance and endless
              comparsions of this scripting system vs that scripting system and who
              scales "better" that there is no "noise" about programming in C,
              especially considering that once upon a time, it was how it was done.

              I am using php. Why? because it gets done faster. Simple enough.

              Endoffile.

              The below quote is made up and not uttered by me.

              Phil Roberts <philrob@HOLYfl atnetSHIT.net> wrote in message news:<Xns947BA7 781D83Aphilrobe rts@216.196.97. 132>...[color=blue]
              > With total disregard for any kind of safety measures
              > clarke@qualityt hink.com (Bob) leapt forth and uttered:
              >
              > Why use C when you can use Assembly or even just write raw machine
              > code or maybe even just edit the Inodes on your hard drive using
              > magnets?
              >
              > Because it's *simpler* thats why.[/color]

              Comment

              • CountScubula

                #8
                Re: Why php and not C?

                "Bob" <clarke@quality think.com> wrote in message
                news:cfa521f2.0 401251907.7d45a 3b3@posting.goo gle.com...[color=blue]
                > Well I have written assembly, I hate it. And I have written raw
                > machine code and I hate that also.
                >
                > Leaping from php to C is one thing, leaping from C to assy is another.
                >
                > It might be a point of view or where you started programming from.
                > I don't have an issue writing CGI programs, and compiling is ....what
                > we do everyday. With todays IDEs running a test on a php script vs
                > compiling a program and running it is not all that different.
                >
                > Yes, writing a php script is simple and faster. But my question or
                > ponderance was and still is, was this amount of simplicity enough to
                > drive php to the forefront?
                >..........[/color]

                Bottom line, in my opinion:

                You can have an html page and embed php in it, where as with perl / c you
                have a script, and you have
                to embed html in it.
                Also, for the most part, you do not have to run the site out of the cgi-bin.


                it is very simple to convert an html site into a dynamic php site, but it
                would take forever and a lot of work to convert a html site to perl or c
                (compiled or not). it is simply, in my opinion the laguage intergration, not
                wether it is compiled or not.

                Personal, I have done a lot of c coding, but prefer not to use it to spit
                out html pages. Just the simplest/fastest tool for the job, kinda the goal.

                Sure I could write my gzImage script in C, but why? I do not want to spend
                the time, coding, but rather spend the time developing.

                Now, if I am going to write some dynamic content for a micro controlled
                webserver, I will do it in assembly, bypassing c.

                So, the bottom line: fast/simple/easy intergration for the job.
                -- the goal of php is to spit out html. (i know it does other things)
                -- the goal of perl, c'mon, Practical Extraction and Reporting Language
                -- the goal of c is to provide a medium level access to asm, and produce
                binaries

                so, just becouse you can, you should not always --- I can write websites in
                fortran, but why?


                --
                Mike Bradley
                http://www.gzentools.com -- free online php tools


                Comment

                • Tim Van Wassenhove

                  #9
                  Re: Why php and not C?

                  On 2004-01-26, CountScubula <me@scantek.hot mail.com> wrote:[color=blue]
                  > so, just becouse you can, you should not always --- I can write websites in
                  > fortran, but why?[/color]

                  I agree.

                  There are specialists that can get a nail into a piece of wood with a
                  screw-driver. But i prefer to use a hammer ;)

                  --

                  Comment

                  • Martin Doering

                    #10
                    Re: Why php and not C?

                    On 25 Jan 2004 04:55:41 -0800, clarke@qualityt hink.com (Bob) wrote:
                    [color=blue]
                    >When I first started in web programming (I left it for more than a few
                    >years) I programmed my web pages in C and a little perl. Now that I
                    >have a need to come back to web programming I find that php is all the
                    >rage.
                    >
                    >But looking a php syntax I can't help but notice it is very C like,
                    >which is no surprise.
                    >
                    >But I wonder, other than the lack of pointers in php (not a bad thing
                    >I admit!) and the ease in which php does variables, litte to no
                    >typing, why does it seem that no one is programming the web in C?[/color]

                    I did. I did code a wiki engine in c, with RTF-Export, own webserver
                    lib and such. The bigger the projekt get's I feel, that many features
                    I would now like to have are just available as a module in scripting
                    languages. For example database interfaces, LDAP connection etc. Well,
                    I'm not shure, if I would do it again in C. Many things in the wiki
                    are doe with hashing, and that exactly is, how all the scripting
                    languages work anyway.

                    --
                    Martin

                    Comment

                    • Five Cats

                      #11
                      Re: Why php and not C?

                      In message <PbQQb.46269$mU 6.174442@newsb. telia.net>, DvDmanDT
                      <dvdmandt@telia .com> writes[color=blue]
                      >PHP is easy, common, fast and has functions for almost everything...[/color]

                      PHP is mostly portable. I develop my PHP pages using a MySQL database
                      on my PC running Win2000, and directly upload them to my ISP running
                      some flavour of Linux. If I used C that wouldn't be so easy.
                      [color=blue]
                      >
                      >In C, it's really easy to get memory leaks, it's hard (compared to PHP
                      >anyway), and it's overkill, as well as it might not run on any server/OS...
                      >
                      >Now, there are ppl using C/C++, but it has more downsides than upsides..
                      >[/color]

                      --
                      Five Cats
                      Email to: cats_spam at uk2 dot net

                      Comment

                      • Bob

                        #12
                        Re: Why php and not C?

                        Enough said.
                        Thanks for the replies.

                        The right sized tool for the job at hand.

                        I was just wondering if in all the years I missed something.
                        Sometimes the simplest answer is the right one.



                        asomya@uncc.edu (Mad Max) wrote in message news:<18906fa9. 0401251042.3497 a874@posting.go ogle.com>...[color=blue]
                        > You have to admit that PHP is really a whole damn lot easier and
                        > "tweakeable " than C but for mission critical systems where speed is of
                        > the essence the service providers still rely on a compiled CGI script
                        > written in C rather than interpreted languages like PHP etc..
                        >
                        > You can say that C certainly beats interpreters in speed.. but have
                        > you ever really tried writing a CGi app in C, it really is
                        > overkill.... add to it the fact that the script has to be compiled
                        > every time u make minor changes, variables have to be carefully
                        > defined, memory has to be taken care of ... and so on...
                        >
                        > bye
                        > Arvind
                        >
                        > clarke@qualityt hink.com (Bob) wrote in message news:<cfa521f2. 0401250455.70fc 87ab@posting.go ogle.com>...[color=green]
                        > > When I first started in web programming (I left it for more than a few
                        > > years) I programmed my web pages in C and a little perl. Now that I
                        > > have a need to come back to web programming I find that php is all the
                        > > rage.
                        > >
                        > > But looking a php syntax I can't help but notice it is very C like,
                        > > which is no surprise.
                        > >
                        > > But I wonder, other than the lack of pointers in php (not a bad thing
                        > > I admit!) and the ease in which php does variables, litte to no
                        > > typing, why does it seem that no one is programming the web in C?
                        > >
                        > > C it would seem had the advantage of an established language, a very
                        > > native language for the servers and it compiles down to executable.
                        > >
                        > > Why did php gain a foothold and take off?[/color][/color]

                        Comment

                        • David Mackenzie

                          #13
                          Re: Why php and not C?

                          On Mon, 26 Jan 2004 04:02:30 GMT, "CountScubu la"
                          <me@scantek.hot mail.com> wrote:
                          [color=blue]
                          >so, just becouse you can, you should not always --- I can write websites in
                          >fortran, but why?[/color]

                          Perhaps you'd prefer COBOL:


                          Although the samples use depreciated markup.

                          --
                          David ( @priz.co.uk )

                          Comment

                          • Five Cats

                            #14
                            Re: Why php and not C?

                            In message <cfa521f2.04012 60553.3cb42610@ posting.google. com>, Bob
                            <clarke@quality think.com> writes[color=blue]
                            >Sometimes the simplest answer is the right one.[/color]

                            The simplest answer is nearly *always* the right one, or part of it!

                            --
                            Five Cats
                            Email to: cats_spam at uk2 dot net

                            Comment

                            • Chung Leong

                              #15
                              Re: Why php and not LISP?

                              Side effects are for losers!

                              Uzytkownik "David Mackenzie" <me@privacy.net > napisal w wiadomosci
                              news:83da10l607 7h7a8drbtbugm1i bf5rdom5h@4ax.c om...[color=blue]
                              > On Mon, 26 Jan 2004 04:02:30 GMT, "CountScubu la"
                              > <me@scantek.hot mail.com> wrote:
                              >[color=green]
                              > >so, just becouse you can, you should not always --- I can write websites[/color][/color]
                              in[color=blue][color=green]
                              > >fortran, but why?[/color]
                              >
                              > Perhaps you'd prefer COBOL:
                              > http://www.c-sharpcorner.com/CobolNe...l4MSNETNRS.asp
                              >
                              > Although the samples use depreciated markup.
                              >
                              > --
                              > David ( @priz.co.uk )[/color]


                              Comment

                              Working...