Become a fan of Slashdot on Facebook

 



Forgot your password?
typodupeerror
×
PHP Databases Programming Ruby

Ask Slashdot: Which Web Platform Would You Use? 519

A new submitter writes "I'm about to embark on developing active content (database driven, and web services) for the first time for my website and I have grown to love PHP. Knowing that there are other web development platforms available, and noticing some disdain for PHP in some circles, I'm curious to know which platforms slashdotters prefer along with the reasons why. Before I get started into heavy development I would like to get some opinions and more facts. Why shouldn't I use PHP?"
This discussion has been archived. No new comments can be posted.

Ask Slashdot: Which Web Platform Would You Use?

Comments Filter:
  • Wt (Score:5, Interesting)

    by paugq ( 443696 ) <pgquiles@elpauerCOUGAR.org minus cat> on Tuesday January 03, 2012 @11:08AM (#38571924) Homepage

    Wt [webtoolkit.eu] is the best one I have tried. I use the C++ version, although there is also a Java version (JWt).

    What makes Wt unique is its approach: widgets. You develop web applications like you were developing desktop applications. Also, the API is Qt-like (but using Boost).

    I gave up on Rails after I used Wt.

    Want a virtualization console? Take Wt, libvirt and an HTML5 VNC client and you are done.

    Need Active Directory authentication? Wt, Samba (or Windows APIs if you are on Windows), done.

    Streaming? Wt, ffmpeg libraries, done.

    Forgetting about bindings and being able to use the millions of C/C++ libraries out there was a huge relief.

    Also, size: Rails, Django (and even PHP) just do not fit in an embedded environment. Wt does.

  • Go C++ with Witty! (Score:5, Interesting)

    by scorp1us ( 235526 ) on Tuesday January 03, 2012 @11:11AM (#38571970) Journal

    Wt ("witty") [webtoolkit.eu] is a C++ toolkit that is modeled after Qt. It uses boost and STL, but you get to use familiar Qt concepts - signals & slots, Model view, etc. Basically think of Qt-based web pages. It fully supports AJAX and can handle the data server-side or on the client. It also has a C++ -> JS converter so you can just make a function for conversion to JS and have it exec on the client. Of course it runs as a module, or it comes with its own server. It fully supports CSS, DOM, etc.

    I reall like this approach because my two complaints of PHP:
    1. It is unstructured
    2. it is ugly (both syntax, and having code embedded in pages)
    are alleviated.
    1. C++ object orientation encourages a structured approach.
    2. The "it's 100% C++" ensures that you focus less on the presentation in PHP and just on the application logic. This helps encourage a model-view-controller approach. While you might have to write CSS, you will never have to write HTML and you won't ever have to mix the two in a CPP file.

    Another reason is speed. Everything is compiled and runs natively, or compiled to JS and moved to the client.
    Yet another reason is security. Wt has several protections built in. See the features link below.

    If you're looking to do web pages entirely differently, this is it.

    Additional features list [webtoolkit.eu]

  • Re:ASP.NET and C# (Score:1, Interesting)

    by lthorne ( 2265946 ) on Tuesday January 03, 2012 @11:18AM (#38572052) Homepage
    Sorry man. I deal with ruby, php, perl, .net, asp.net and bar none, .net and asp.net are not even close to being as reliable as php or ruby. I would never recommend .net to a client, ever.
  • Re:ASP.NET and C# (Score:5, Interesting)

    by Anonymous Coward on Tuesday January 03, 2012 @11:21AM (#38572116)

    A while back now I had to do a project in ASP.Net, after being a long time PHP developer and I have to say I found it incredibly unpleasant. PHP's problem is that you have to write everything from scratch, however ASP provides you with a tonne of controls that allow you to get up and going really quickly. The problem though, is as soon as you try to do something a bit more complex with ASP.Net controls, it all falls in a heap.

    I remember having to print a list of products, and there would be sub headings mixed in amongst the rows to divide product families....

    Product Family 1
    Product 1 - $Price
    Product 2 - $Price
    Product 3 - $Price
    Product Family 2
    Product 4 - $Price

    Now I was pulling these products from a database as one giant table, and then binding the data set to the Repeater control. The problem is that ASP.Net only has templates for a Row and alternating rows, so I couldn't easily insert the separators for the different Product Familys. All of the sudden I'm having to create my own custom controls that inherited from repeaters and needed to have a detailed understanding of how ASP.Net worked and all sorts of scary things. Needless to say, it was incredibly frustrating.

    On the other hand, the same solution in PHP is solved with,
    if($PreviousProduct.Family != $CurrentProduct.Family))
    { //New Family row code goes here.
    }

    1 Line vs alot + stress. To me, that kinda summed up ASP.Net, great if you don't really know how to program, but for professionals, not so great.

    That said I love C#, and I definitely wish that PHP was more like it, PHP is a terrible mess, but its fast, simple and you can build things fairly rapidly. Combine it with a framework, and you're in pretty good hands. Although I'd really love for them to make it harder for noobs to create security issues. :\

  • Re:ASP.NET and C# (Score:3, Interesting)

    by JAlexoi ( 1085785 ) on Tuesday January 03, 2012 @11:23AM (#38572148) Homepage
    Comparing PHP to a web dev framework is very much appropriate. It is essentially a framework. Just look at it's history... It's Perl with some web oriented tooling, it has changed it's backend but hasn't really evolved much.
    And I'm not saying it's bad or something. It's very appropriate for a lot of projects. Just look at Facebook. And it's one of the most easily scalable platforms out there.
    All of the other frameworks are building on top of PHP and look what they have to do to overcome it's legacy of being a framework language.

    PS: PHP and ASP.NET can be compared, while RoR and PHP can't be. web.py and node.js can be compared to PHP, Django can't. Notice what PHP is missing to be comparable.
  • Re:ASP.NET and C# (Score:4, Interesting)

    by Anonymous Coward on Tuesday January 03, 2012 @11:33AM (#38572322)

    PHP is nowhere near being a framework. It is a scripting language, similar to Python and the like, but with a few things added in to make it better for web development. However, those things were added in in a time when the web was a lot simpler. Nowadays developers require more - MVC by default, a decent ORM perhaps, that kind of thing. When you need those, you turn to a PHP framework.

    I think that one of the reasons that PHP is criticised so much is that anyone can shove up a .php file and it'll run straight away - it's a lot easier to get into developing with PHP than with other frameworks where you have to learn about MVC, etc. As a result, there's a hell of a lot more dodgy code out there. With languages like Python, however, even using CGI it's a bit more in-depth (and really, you need a framework with Python).

  • Re:ASP.NET and C# (Score:4, Interesting)

    by anss123 ( 985305 ) on Tuesday January 03, 2012 @01:12PM (#38573590)
    A couple of weeks ago I evaluated asp.net vs PHP for a web project I'm working on. Asp.net isn't bad IMO, but it quickly felt like I would have to model my website to asp.net instead of the other way around. I didn't try "doing things from scratch" though.

    I ended up with Apache2/PHP 5.3/MDB2/Smarty3 and the latest oracle client. The biggest frustration with PHP is setting it up really. I haven't bothered getting line by line debugging working, for instance, but got that "for free" with asp.net. Another annoyance is that you have to make sure the various components are compiled against each other, if they're not you get cryptic errors that aren't exactly straight forward to figure out.

    PHP5.3 seems to be surprisingly nice all in all. It got classes, access modifiers, exceptions and even closures now; so that you can do things pretty much the same way as one would in C#. The only annoyance is that you can't "compile" the source files, to check for syntax issues, but perhaps there are dev environments that can do just that.
  • Re:ASP.NET and C# (Score:4, Interesting)

    by Xest ( 935314 ) on Tuesday January 03, 2012 @07:57PM (#38579716)

    Be wary of the number of responses in favour of PHP and the moderations given to posts here, it's hard to have a sensible debate about PHP, because it is so easy to pick up, use, and hack something together it's used by people in greater numbers, coupled with the fact that Slashdot's moderation system is built on numerical consensus means that a popular opinion will get modded up, and an unpopular modded down, but popular does not mean correct.

    So with that out the way, here's my view as a lead software developer at a firm who develops for large clients from BP, to Swiss Re, and from Britain's MoD to GE using a large array of languages from C# to Java, and C++ to Ruby and PHP. Fundamentally if you're a good programmer and know the ins and outs of programming, both generally, and in a language specific way you'll be able to write good PHP code, as the GP says - as good as any other framework to an extent. My only caveat with that would be that PHP just doesn't scale as well at the high end as other languages as the likes of Facebook have found out, hence why they wrote a PHP to C++ translator, and now a Java-esque VM to try and get their PHP to work at the same level of performance as these languages. The flip side of that is that most web applications will never need that kind of performance, and hence good developers can write code with PHP just fine without any real side effects at the end of the day.

    But the reason many professional developers who have experience across many languages look down on PHP are many, the language itself has always been well behind the curve, it didn't properly support fundamental concepts like classes, namespaces, and closures until more reecent years, and that's pretty inexcusable, not in that these are expected features for a modern language, but that they're fundamental to the design of a language and adding them later will only result in headaches, and with PHP it certainly has. It also has many other quirks, associativity of the ternary operator for example is backwards in PHP compared to most other languages, variable scoping is fucked, namespaces use the escape character as the separator and these are the sorts of things that will trip new, and even many moderately experienced programmers up as to why things suddenly aren't working.

    It's also the case that interpreted languages in general face the problem that code can appear to run fine until errors are encountered, whilst with compiled, or bytecode compiled languages like C# and Java more errors are detected, and hence must be corrected at compile time, preventing some nasty errors ever reaching the end user. This in itself is less of a problem if there is great testing supporting for an interpreted language, but even PHP's unit testing tools are way behind the equivalents in again, languages like C# and Java. On top of this, the rest of the tools for languages like C++, C# and Java are just that much more mature offering features that just let you write better code faster.

    Of course, PHP is still used heavily, and this is because it does let you get things done quickly, in the real world there just isn't always time to properly write well architected, and well tested code, this is really sad, as it almost always inevitably leads to problems in the long run, but it's also an unescapable, no matter how unwanted reality. The fact is if you have a pushy client or boss then just may not even have time to write a beautifully architected, well tested C#/ASP.NET MVC, or Java/Spring application no matter how superior that option would be.

    So fundamentally it comes down to how much freedom you have with your software development schedules, if you're being given time to do things right, then use something like C# and ASP.NET MVC, or Java and Spring if you can't use Windows Server to host. If however you're being forced to get things done quickly then you may well find it's best to stick to PHP, but if you do then please, do one thing - work your arse off learning PHP in depth, learn it's quirks, it's pitfalls

The last person that quit or was fired will be held responsible for everything that goes wrong -- until the next person quits or is fired.

Working...