• is PHP a neccessary evil?

    From LaRRy LaGoMoRpH@DIGDIST/BATTLEST/FREEWAY to All on Sun Oct 12 20:37:00 2014
    I don't like php - but it seems to be all over the place. It seems like if you want to do web development work, they want you to know php.

    But in a perfect world, is PHP neccessary or even ideal to do the things it's used for moving forward? Maybe it is, I don't know.

    It seems very database oriented - like you better know SQL if you know PHP or else you're kinda missing something.

    Then there's all the darn ?'s and $'s all over the place that don't make things any easier to read. Sure those things are nifty when it's jquery tacking on javascript, but as a core element of the language seem to make it more difficult to read.

    There's tons of crap that runs on PHP, but is any of it really cool in any way? I want to see something cool that came from php so I can be like, oh wow, you can do that with PHP - i want to do that.

    I see no other PhP messages here, so I don't know if there's anyone else out there who has an opinion on php. I obviously haven't gotten too intimate with it but I did pass the codeacademy course in a couple hours, I don't think I learned much php specific stuff though.

    ll morph G futureland.grudgemirror.com LaRRy LaGoMoRpH\-/
    O
    =M=
    'not your average board check it out' /-\


    ---
    Synchronet Futureland.Grudgemirror.Com ** LIVE ** Music and
  • From Khelair@DIGDIST/BATTLEST/FREEWAY to LaRRy LaGoMoRpH on Mon Oct 13 08:41:00 2014
    Re: is PHP a neccessary evil?
    By: LaRRy LaGoMoRpH to All on Sun Oct 12 2014 20:37:35

    I don't like php - but it seems to be all over the place. It seems like if want to do web development work, they want you to know php.

    But in a perfect world, is PHP neccessary or even ideal to do the things it' used for moving forward? Maybe it is, I don't know.

    It seems very database oriented - like you better know SQL if you know PHP o else you're kinda missing something.

    Then there's all the darn ?'s and $'s all over the place that don't make thi any easier to read. Sure those things are nifty when it's jquery tacking on javascript, but as a core element of the language seem to make it more difficult to read.

    PHP seems to have grabbed a huge chunk of the market share, yeah. It seems to be most evident in places where the servers are trying to be kept 'lean 'n mean', though. I mean, if you're looking for a really fully-featured suite, with inherent container-based security, you're going to go into JSP, ASP, or [I think there is] another one that I can't remember offhand. Those environments are absolutely obese; they make your server requirements skyrocket.
    Perl, python, and shell scripts (as well as native code executables) work, but they just don't have any inherent security in them. You've really got to be on your toes to make your own application executed directly from the webserver.
    This doesn't seem to be the case as much with PHP, though I know that it still shares some facets of the same risk. The problem I've had with PHP, though I've used it to write some apps, is pretty much what you're talking about. It's a 'dirty' language. Reminds me more than a bit of Perl, except at least Perl knew what the hell STDOUT was for. When you couple that with the horribly duct-taped together OO syntax (at least last time I checked, which was nearing 10 years ago), and some of the other fugly options, yeah... It gets kind of nasty.
    The ?'s, I believe, are more due to the nature of the inline parsing w/HTML, and what the webserver requires in order to find the script. Not sure, though, maybe you're talking about something else.
    As far as the $'s, are you talking about in variable instances?

    Anyway, yeah, I don't use PHP if I can help it, which has kept my hands clean for damn near a decade now. I'd totally sell out on that if it'd get me back into IT right now, though.

    ---
    Synchronet Tinfoil Tetrahedron BBS telnet or ssh -p 2222 to tinfoil.synchro.net
  • From Nightfox@DIGDIST/BATTLEST/FREEWAY to LaRRy LaGoMoRpH on Sat Nov 1 10:02:00 2014
    Re: is PHP a neccessary evil?
    By: LaRRy LaGoMoRpH to All on Sun Oct 12 2014 20:37:35

    I don't like php - but it seems to be all over the place. It seems like if you want to do web development work, they want you to know php.

    But in a perfect world, is PHP neccessary or even ideal to do the things it's used for moving forward? Maybe it is, I don't know.

    It seems very database oriented - like you better know SQL if you know
    PHP or else you're kinda missing something.

    Then there's all the darn ?'s and $'s all over the place that don't make things any easier to read. Sure those things are nifty when it's jquery tacking on javascript, but as a core element of the language seem to
    make it more difficult to read.

    There's tons of crap that runs on PHP, but is any of it really cool in
    any way? I want to see something cool that came from php so I can be
    like, oh wow, you can do that with PHP - i want to do that.

    I guess I have a diffrent feeling about PHP. To me, PHP feels like any other server-side language. I don't think it's really any better or worse than ASP.NET, JSP, server-side JavaScript, etc.. I actually somewhat like PHP in that it's fairly flexible in what you can do with it. The syntax with the $ symbols etc. doesn't really bother. I don't know of PHP using the ? symbol for anything though - the only place I can remember it using ? is in the start & end tags (<?php and ?>), which I suppose isn't actually part of the language, but rather server as tags for the parser to know whether or not to process the text as PHP. In fact, I think the $ symbols can make it easier to read once you get used to it, since you know that a name starting with a $ is a variable.
    In other languages, such as C++, C#, etc., variables don't start with any special symbol, so it can sometimes be ambiguous at first to know what you're dealing with, although it's usually easy to determine from its context.

    Also, you only need to know SQL if the PHP page(s) you're working has to deal with a database to save & load data. That is a fairly common task though, since many web sites use databases to store information, and SQL is the most common language for a database.

    I think there are a couple reasons why PHP is as popular as it is. PHP is a flexible language that allows you to write functional code as well as object-oriented code; it doesn't force a paradigm on you. You can just get right into it and start coding. Also, PHP is a free language that doesn't require any license fees - The PHP engine is freely available for Apache and other web servers.

    What I do find somewhat annoying about PHP is that there are multiple ways of doing some things. There are several functions in the PHP standard library that do very similar things, but with slightly different parameters. I think it would have been better if the library was more consistent and concise.

    Nightfox

    ---
    Synchronet Digital Distortion: digitaldistortionbbs.com
  • From Nightfox@DIGDIST/BATTLEST/FREEWAY to Khelair on Sat Nov 1 10:09:00 2014
    Re: is PHP a neccessary evil?
    By: Khelair to LaRRy LaGoMoRpH on Mon Oct 13 2014 08:41:51

    talking about. It's a 'dirty' language. Reminds me more than a bit of Perl, except at least Perl knew what the hell STDOUT was for. When you

    I think STDOUT makes more sense on a command line context, as that's what STDOUT was designed for. I don't think STDOUT makes that much sense in a web context. If you were to try to write to STDOUT with PHP, I wonder if the output would show up on the server's console (if it had a console window open for the server).

    couple that with the horribly duct-taped together OO syntax (at least
    last time I checked, which was nearing 10 years ago), and some of the other fugly options, yeah... It gets kind of nasty.

    I started playing with PHP OO syntax about 5 or 6 years ago (with PHP 5, I think). I didn't think it was too bad. It has the notion of access levels (private & public), constructors, and class methods, which is more than what JavaScript has.

    Nightfox

    ---
    Synchronet Digital Distortion: digitaldistortionbbs.com
  • From Khelair@DIGDIST/BATTLEST/FREEWAY to Nightfox on Sun Nov 2 03:53:00 2014
    Re: is PHP a neccessary evil?
    By: Nightfox to Khelair on Sat Nov 01 2014 10:09:54

    I think STDOUT makes more sense on a command line context, as that's what STDOUT was designed for. I don't think STDOUT makes that much sense in a web context. If you were to try to write to STDOUT with PHP, I wonder if the output would show up on the server's console (if it had a console window open for the server).

    Actually I think that I stated that problem incorrectly. If I'm remembering correctly _now_ (which is debatable, as I just had pointed out an issue that I misremembered a few months back here, and my last time using PHP was several years ago), the problem was that it doesn't differentiate between STDOUT and STDERR at all; everything just goes to STDOUT. Feel free to let me know if I'm totally wrong there. :P
    Anyway, I used PERL & Python a bit, and I believe in those languages you just piped your HTML or otherwise formatted output to STDOUT in order to have it included from the cgi output. Not having STDERR made things a little bit messy, in my opinion.

    I started playing with PHP OO syntax about 5 or 6 years ago (with PHP 5, I think). I didn't think it was too bad. It has the notion of access levels (private & public), constructors, and class methods, which is more than what JavaScript has.

    I was supposed to look at it at one point much more deeply, and then got totally bowled over by a life implosion level event. Since then I've been able to learn JavaScript OO syntax and ability, and you're right about that. I guess what was most off-putting for me back in the day was that PHP didn't have anything resembling the syntax or declaration that I'd previous had to learn in Java. That difference put me off enough so that I didn't look much farther, and probably made some bogus assumptions. Now that I've learned JavaScript OO to an extent, it probably wouldn't be that tough to pick up. I should look at it again.
    Still, there's something about PHP that just rubs me the wrong way... Maybe I've just listened to too many of the snobby devs around here talking shit about it without making up my own opinions, though.

    ---
    Synchronet Tinfoil Tetrahedron BBS telnet or ssh -p 2222 to tinfoil.synchro.net