PHP v ASP

Discussion in 'Programming & Software Development' started by maskslash, Jul 6, 2006.

  1. maskslash

    maskslash Member

    Joined:
    Nov 21, 2005
    Messages:
    339
    Looking at phpbb and wondering whether it is worth learning php or just getting enough of a grasp just to cut and paste edit it.

    I mean it makes sense to me, but i couldnt write it as yet.

    I know asp and figured i would do a hybrid thingo, cause I can just get at the mysql backend in my asp and play from there.

    Anyone else done this? is it worth just learning php? (i already know c++&c)
     
  2. blancmange

    blancmange Member

    Joined:
    Nov 5, 2005
    Messages:
    359
    php is the most supported and is not locked into windows based servers.

    you will find more scripts and software for PHP then you will for ASP.
     
  3. 7nothing

    7nothing Member

    Joined:
    Feb 15, 2002
    Messages:
    1,550
    Location:
    Brisbane
    PHP was developed as a web scripting language, you can tell this is the case when you start to use it.

    ASP is visual basic without the visual part.

    Learn PHP :)
     
  4. GreenBeret

    GreenBeret Member

    Joined:
    Dec 31, 2001
    Messages:
    19,370
    Location:
    Melbourne
    phpBB is one of the worst PHP applications (examples of others: osCommerce, ZenCart, Mambo/Joomla) you can draw inspiration from to learn the language.

    As for whether it's worth learning, well, it is a tool. If you need the tool to do something, learn how to use it.
     
  5. Falkor

    Falkor Member

    Joined:
    Jun 27, 2001
    Messages:
    4,079
    Location:
    Sydney
  6. QuakeDude

    QuakeDude ooooh weeee ooooh

    Joined:
    Aug 4, 2004
    Messages:
    8,515
    Location:
    Melbourne
    Most supported? Are you sure about that, or are you just guessing?!
    Again, I seriously doubt that, ASP has been around for a very long time, and I can get support for it absolutely anywhere..

    To the OP, it totally and utterly depends on what you need it for, I've bene coding in ASP for 6 ro 7 years now, always within a corporate environment, and have never had a need for PHP.

    I'm now learning PHP for a side project, and finding it amazingly simple to learn, since its conceptually the same.

    Any future projects will be coded in ASP for me, since all my stuff runs and integrated with our Active Directory domain. If I was writing something small to run on the internet, then ASP would be overkill - PHP would be my first choice.
     
  7. houseofzeus

    houseofzeus Member

    Joined:
    Mar 25, 2005
    Messages:
    3,195
    Location:
    St. Lucia, Brisbane
    Depends. As already pointed out phpbb has an atrocious record as far as security.

    As far as the languages themselves I think ASP.NET is country miles ahead of PHP. Despite this however I do all my web scripting in PHP and perl (mostly maintenance work on the perl side), mainly because hosts for it are so easy to find (and generally cheaper), though I don't have to worry about this so much for work.

    There also seem to be a lot more 'off the shelf' PHP scripts/applications even if the quality of many is dubious. I tend to lean towards the argument that shit code can be written in any language here though and that the amount of insecure PHP applications is pretty much in line with how popular it is for people new to web scripting to learn.

    Yes I selectively ignored the fact that ASP was originally mentioned, not ASP.NET. For someone just starting off I don't see much point in learning the former.
     
  8. Elyzion

    Elyzion Member

    Joined:
    Oct 27, 2004
    Messages:
    7,449
    Location:
    Singapore

    ASP is not Visual Basic, it allows you to use serverside scripting languages such as visual basic and c#.

    ASP3.0 is not locked into windows.

    ---------------------------------------

    ASP3.0 is not worth the time and effort, PHP is better. And don't confuse ASP with ASP.Net, they are two completely different platforms.

    Learn what you feel comfitable with, not what someone says it better or worse.
     
  9. phreeky82

    phreeky82 Member

    Joined:
    Dec 10, 2002
    Messages:
    9,615
    Location:
    Qld
    Agreed ASP.NET may be worth learning but not traditional ASP. I'm a big PHP user, been coding in it for about 6 years (maybe more, not too sure, could be 7 or 8), currently work largely with it.

    Pros and Cons of them:
    - PHP web servers will naturally be cheaper, as the server software for it is free and with apache being the most common web server type out there (and imo it still should be btw), it's almost a natural thing to do (i.e. heaps of linux server distros with apache/php/mysql installed straight up)
    - ASP(.NET) is a natural choice for use on a windows server, not only because it's not exactly a task to setup an IIS server for it, but because as mentioned above it has features to integrate nicely with windows (i.e. active directory)
    - For most simple scripts PHP will execute faster (according to benchmarks i've seen on the web, i've not done them myself). For more complex scripts the language selection becomes less of a factor.
    - PHP will in my experience be easier to learn the basics. I can't comment on advanced components because I only know ASP.NET basics.

    If it were me starting off, if I wanted to learn to program a bit and make a personal a business website myself I'd use PHP, unless MS specific features were needed. If I wanted to build an intranet integrating with windows server stuff lots, ASP.NET is a natural choice. If I wanted to earn more money from it, I'd learn ASP.NET.
     
  10. 7nothing

    7nothing Member

    Joined:
    Feb 15, 2002
    Messages:
    1,550
    Location:
    Brisbane
    In 2 years working for australias largest web host, I think I saw 2 instances where an ASP site was in Javascript syntax, rest were VB Script. Unlike the native support for nearly everything you'd want in most web based systems that PHP provides, most ASP sites appeared to rely on a few basic COM objects that are part of the server, and a few more overpriced and poorly documented commercial addons.
     
  11. Elyzion

    Elyzion Member

    Joined:
    Oct 27, 2004
    Messages:
    7,449
    Location:
    Singapore
    My biggest problem with PHP,
    (apart from 10 fuctions which perform the same thing just with a few less words because people think "oh im sick of writing this ill add a new function to php")
    (and i admit since ive only used it for 2 years and haven't gone past version 3)
    is that a large majority of users are self taught and have taught themselves bad habbits. Lots of people will copy paste other peoples scripts and not learn how the script words. Because its such a forgiving languages people don't learn to construct good code. Theres nothing worse than picking up after someone elses PHP.

    Both PHP and ASP.net have their place. Just like Perl, Ruby, JSP, all have their place, and Coldfusion if its worth mentioning... (its kinda dead now, haven't heard about it for a while, it was discontinued was it not?)

    Altho i love ASP.net, it still has 1 major flaw..., it still thinks that if you have a form with runat="server" that its posting back to itsself and will not let you change the form action, so you have to use javascript to change the action onsubmit. (unless you want to re-write the framework, which isn't the best thing to do when you want to move your application from 1 server to another)
     
  12. OP
    OP
    maskslash

    maskslash Member

    Joined:
    Nov 21, 2005
    Messages:
    339
    thanks people

    Yeah this needn't be secure, just social thing, no commercial purpose.

    What I was hoping to do was successfully switch to and fro between the two platforms, using asp where i lacked the php skills.

    I mean I generally stick with asp where possible and can make things from scratch in this (VBasic is my language).

    I spose i will read up on asp.net but dunno if i need to cause i dont go beyond simple database backend sites. I will stick to cut and paste php styles.


    I really dun wanna sound dumb here but i have to ask, if all languages have the same condition (if, switch, case etc) and loops (for, do, while etc) is there any real difference between them? Does it just come down to the functions that are prewritten and included in the platform?
     
  13. quannum

    quannum Member

    Joined:
    May 1, 2005
    Messages:
    61
    Location:
    down south sydney
    You could almost say that it's a victim of it's own success. It's very easy to get results with, very cheap to setup and pretty simple to maintain.

    Of course, the code written by script pasters will not neccessarily be of any great quality, but I'm sure that equally applies to a lot of 'corporate' VB/VBA code written by non-programmers. They'll code well enough to get the job done, but often leave a maintainence nightmare...

    As for whether to use PHP or ASP, why do you need to use PHP? Are there no BB applications written in ASP? It makes little sense to me to have an application written in multiple languages unless i) you have legacy requirements or ii) there are significant performance/maintainence gains. Since you already know ASP, stick with it.

    Technically, I'd also imagine theres a problem with sharing sessions between the two platforms, which you'll probably need to do. Someone who has actually tried to do this might be able to answer more authoritively, though!
     
  14. flightcrank

    flightcrank Member

    Joined:
    Aug 6, 2004
    Messages:
    745
    like this function ? http://au2.php.net/manual/en/function.nl2br.php
     
  15. Elyzion

    Elyzion Member

    Joined:
    Oct 27, 2004
    Messages:
    7,449
    Location:
    Singapore
  16. systemdown

    systemdown Member

    Joined:
    Oct 14, 2003
    Messages:
    716
    Location:
    Brisbane 4107
    I find it funny how the PHP nay-sayers *still* make the "nl2br" thing a central feature of their argument. Don't like a certain API feature? Don't use it. Simple. It is possible to write some very elegant PHP - but of course as with any other language, it is also possible to abuse the API and write some horrible code. There's nothing inherent about PHP that makes this any more (or less) prevalent.

    I started using PHP recently (forced to make TikiWiki modification) and I like it a lot - very easy and intuitive. Coupled with SMARTY templating it makes n-tiered web application development an enjoyable exercise.
     
  17. phreeky82

    phreeky82 Member

    Joined:
    Dec 10, 2002
    Messages:
    9,615
    Location:
    Qld
    i was half way through writing a similar post, then decided it wasn't worth it

    but yeah you can write sh*thouse code in anything. i've seen and had to "fix" a system written in java which had:
    - almost all variables names as just letters (i.e. a,b,c,d,e,...)
    - not tabbed in AT ALL!!
    - the whole lot (probably around 10,000 lines) in one file, almost all in one class, and sadly, a huge portion of it in the one main function
     
  18. houseofzeus

    houseofzeus Member

    Joined:
    Mar 25, 2005
    Messages:
    3,195
    Location:
    St. Lucia, Brisbane
    Personally I agree there are major problems with the PHP libraries, a lot of which could be alleviated if namespaces were added (which at this stage they wont be). A lot of the problems re. random ordering of arguments however we are definitely stuck with for good.

    Highly recommend PHP coders have a look at using CakePHP (this is an unrelated thought to the rest of this post).
     
  19. maular

    maular Member

    Joined:
    Jun 30, 2001
    Messages:
    465
    Location:
    Brisbane
    Yes, CakePHP is the shit. It shows that you can actually write decent web apps in PHP.

    As for the PHP vs ASP.NET discussion. First of all, it's been mentioned, but ASP.NET IS NOT ASP. If you learned ASP a few years ago at Uni, with VBScript/Javascript syntax, that was ASP 3, not .NET. ASP.NET is a completely different animal, and much much better.

    If you are learning either language for business, I suggest ASP.NET. The unfortunate reality is that large corporations run MS exclusively, and these are the clients that have fat cash. We've had to pass up a couple of medium-large contracts (>$20K) just because it needs to run on IIS, with SQL Server and ASP.NET, and we just don't have the personnel/resources to develop and support these. And for being employed at these organisations you need to be able to fit in, which means the same MS products.
     
  20. GreenBeret

    GreenBeret Member

    Joined:
    Dec 31, 2001
    Messages:
    19,370
    Location:
    Melbourne
    Well I was just having a conversation with my manager on an unrelated topic but touched upon this PHP v.s ASP/ASP.Net thing (we were talking about another programmer we know). Good luck trying to implement ASP.Net at a workplace where there are bazillions of other things already in place and in use, and it will take half a million years to replace them. It's a lot easier to have a few PHP scripts here and there, especially since PHP runs on all platforms unlike ASP.Net.

    Different tools for different situations. :)
     

Share This Page

Advertisement: