Forgot your password?
PHP Databases Programming Ruby

Ask Slashdot: Which Web Platform Would You Use? 519

Posted by timothy
from the support-babies-pie-and-goodness dept.
New submitter datavirtue 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:
  • Voting to close (Score:5, Insightful)

    by Sneeka2 (782894) on Tuesday January 03, 2012 @09:55AM (#38571796) Subjective and Argumentative.

    Oh, wrong site.

  • Re:ASP.NET and C# (Score:5, Insightful)

    by Anonymous Coward on Tuesday January 03, 2012 @10:02AM (#38571868)

    Idiots like this guy here are exactly why there is so much hate for PHP. Here is a classic example of someone comparing PHP - a language - to a full blown web development framework. Ruby on Rails people do exactly the same.

    You can argue about the differences and benefits of ASP.NET vs RoR vs Zend Framework vs Yii vs [insert another web framework here] - but comparing a language to a framework is outright idiotic.

  • Re:PHP is great (Score:4, Insightful)

    by danbeck (5706) on Tuesday January 03, 2012 @10:12AM (#38571972)

    This is completely true, but very unimportant. PHP under Apache (And really what serious professional would use anything else?) as a module and needs no threads; that's the job of the httpd daemon itself.

    If you need threads; if your Java indoctrination only allows you to solve problems by creating huge monolithic applications, ignoring excellent work by engineers who are much, much smarter than you, then yeah... PHP won't cut it for you. You'll need a language that will be better suited to reinventing the wheel. That is definitely not PHP's strength.

    (Ah, I love it when a good straw man argument comes together.)

  • Re:ASP.NET and C# (Score:0, Insightful)

    by Anonymous Coward on Tuesday January 03, 2012 @10:13AM (#38572002)

    Except PHP is explicitly designed as a "web language" - and then goes on to have all sorts of basic web-related functionality missing.

  • Re:ASP.NET and C# (Score:5, Insightful)

    by ByOhTek (1181381) on Tuesday January 03, 2012 @10:16AM (#38572024) Journal

    I... would not use ASP, I'd use PHP before ASP, and Python before that.

    One of the advantages of python, is that, with mod_wsgi, it's very fast.

    Actually, what I'm working on is, a mod_wsgi handler in apache, that sends the request to a back-end server, originally written in python, but now I'm switching to C# (still no ASP). Although there are ASP Modules for Apache/mono, I belive mod_wsgi has much more thorough testing, and will therefore be a better-cross-platform solution.

    In the end, answer these three questions:

    1) What platforms are you most comfortable with? Rank them.
    2) What platforms have the best modules/libraries for what you want to do? Rank them.
    3) What platforms have the best performance? Rank them.

    Now, given the rankings on 1-3, which platform is best for you? Nobody can answer this but you. Without knowing the details of what you want, we really can provide advice on #2 and #3.

  • by gfxguy (98788) on Tuesday January 03, 2012 @10:17AM (#38572044)

    I've been doing a lot of web programming, and I evolved from PERL to PHP to Python. I happen to prefer Python these days, but there's nothing wrong with PHP. I wrote my company's PTO system using PHP (LAMP) and it works great. I would also suggest JQuery or similar for richer content.

    Most "disdain" for any given language is mostly elitism and people self-validating their own choices. It's true PHP can be messy, but I recall having a Ruby developer look at my PERL code and be surprised at how readable it actually was... in other words, it's up to the programmer. I can make some pretty ugly programs in any language.

  • Re:ASP.NET and C# (Score:5, Insightful)

    by Curunir_wolf (588405) on Tuesday January 03, 2012 @10:19AM (#38572076) Homepage Journal
    Because people are looking for actual opinions from developers, not market-speak from commercial marketers. I mean, mod_mono?? Really???? LOL!
  • Re:Django (Score:5, Insightful)

    by BasilBrush (643681) on Tuesday January 03, 2012 @10:20AM (#38572082)

    If copying and pasting blocks in Python is not working right, then get an editor that is aware of Python indenting. And switch on the option to always convert tabs to spaces.

    Whenever anybody mentions indentation as their one argument for/against Python, I'm pretty sure they know very little about the language. It's like the very first thing about the language you learn.

    How a language denotes blocks is just a detail. You learn best practice for that language and get on with it.

  • by Anonymous Coward on Tuesday January 03, 2012 @10:20AM (#38572086)

    Perhaps a better word is 'inelegant'. A massive global name space, inconsistent function names and argument order, tacked on object model, crappy exception handling.

    There's almost nothing that php does better than other modern scripting languages.

  • Good luck (Score:5, Insightful)

    by beowulfcluster (603942) on Tuesday January 03, 2012 @10:22AM (#38572120)
    You might as well ask which religion is the best one.
  • by GNUALMAFUERTE (697061) <> on Tuesday January 03, 2012 @10:27AM (#38572190)

    Here's a little secret for you: Anyone that uses the word "enterprise" is full of shit. It is used by mediocre developers who work at relatively big corporations and have been forced through the years to work with a bunch of bureaucracy. This people can't release a fucking shell script without 10 formal test cases, 50 meetings, 10 flowcharts, and it's own repository.

    Serious huge projects are written in C++. Serious huge projects that need incredible performance are written in C with assembly optimizations. When somebody tells you that you can't write anything if it's not done in Java, that guy is a corporate droid. If somebody tells you the same for Perl, he's an old monk. If somone tells you that for Ruby/Python/Brainfuck, he's a snob and a fan of that particular language, ignore him too.

    Truth is, leaving aside the obvious differences, when it comes to features that help organize huge projects, C has nothing that PHP doesn't implement on some way. Don't get me wrong, I'm not comparing the base of all modern computing with a modern and not very well designed interpreted language, I'm talking about features that some idiots would call "corporate". And yet, there are incredibly HUGE projects written entirely in C. And yes, there are also huge projects written in PHP.

    Truth is, if you are a good coder, you'll do a good job even if you have to use Basic. And if you are not, you'll write spaghetti code even in C++.

    PHP is a simple, straight to the point language, with a very clear syntax, that is great for web development. It's syntax is very much C-like, just like Javascript, and that certainly helps when you are writting web apps. It's easy to find PHP coders, and that certainly helps too.

    The problem with PHP's reputation is that it's incredibly easy to just write some script or modify an existing one, and call yourself a coder. So the amount of bad PHP code out there is incredibly huge and incredibly public. Of course, if you reviewed each of those Corporate-enterprise-mega-super-jumbo java apps, you would find as many WTFs as you could in your average PHP project, the only difference is that the assholes rooting for Java won't show you their code, and they'll act very dignified.

    Also, avoid the motherfucking frameworks. You don't need them, at all.

  • Re:ASP.NET and C# (Score:5, Insightful)

    by vlm (69642) on Tuesday January 03, 2012 @10:28AM (#38572206)

    Let me help with the standard /. car analogy of why people are pissed off with that answer.


    I need to buy a nice set of metric socket sets to work on my car (my car was built in TN by a domestic company last century, yet is almost totally metric), and I'm not buying Chinese chrome plated plastic from walmart, can /. advise me on a nice place to get socket sets or general advice on procurement (note, I'm in market for 6-sides not those "bolt rounder" 12-sides and also I wanna get high grade impact sockets)?


    Well Saturn of Chattanooga never steered me wrong when I needed the plastic thermostat replaced with the brass one back in '98 due to the recall and I'm sure nothing has changed in the last 14 years so I'd go there.

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

    by xaxa (988988) on Tuesday January 03, 2012 @10:30AM (#38572248)

    So I provide a valid opinion and reasons why it's good to do web development with and it gets modded to -1? WTF Slashdot?

    You aren't a subscriber, and your five-paragraph comment was submitted within a minute -- and I'm being generous -- of the article being published.

    You are clearly being paid to post here, so "your" "opinions" are worth less than nothing.

    ("Redundant" would be a better moderation than "Troll".)

  • They all suck (Score:5, Insightful)

    by Alkonaut (604183) on Tuesday January 03, 2012 @10:36AM (#38572366)
    Honestly all web platforms have drawbacks, and all of them will have supporters claiming they dont.
    • python: pros: easy, decent tools, good frameworks. cons: syntax is difficult to check for correctness (non-compiled).
    • perl: pros: it's free: cons: Its perl
    • .net: pros: techincally bloody excellent, good tools. cons: practically win-only, no free server software
    • javascript (e.g. node.js): pros: it is the same on the client if you want one. Cons: it is still bloody javascript.
    • java: pros: widespread, good servers. cons: a million frameworks to choose from and none is great, next year all will be obsolete and 100 new ones will come. Slow language development (java 8 is .net from about 2005)
    • php: pros: easy, straightforward, multiplatform cons: practically web-only

    They all suck, which one sucks the least depends on the circumstances of your project (time, budget, techincal aspects, what you already know, what you would like to learn, performance requirements, scalability requirements).

  • Re:PHP is great (Score:4, Insightful)

    by Xugumad (39311) on Tuesday January 03, 2012 @10:40AM (#38572436)

    Out of curiosity, if I wanted to have a web application that used AJAX to listen for change events from the server (long-poll style), how in PHP would I notify any waiting requests of a new message to be sent out?

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

    by scamper_22 (1073470) on Tuesday January 03, 2012 @10:44AM (#38572500)

    Considering PHP was a 'language' built for server-side scripting, it is hardly just a 'language'. There would have been almost no reason to 'invent' PHP just as a language on its own.

    Actually interestingly enough, WIkipedia also generally compares PHP to ASP. []

    A programming language in general usage is a function of both its syntax and its libraries and even its tools. A discussion of a programming language just on its 'syntax' would be a fun discussion for a few in academia I suppose. But for the rest of the world, it includes everything.

    In the same vain as those who used to rant about operating systems being just the kernel. It's not. It's about the whole platform and can ever blur into common applications.

    Most often, what is discussed is the basic install provided in the prepackaged form.

    In that way, PHP is indeed comparable to ASP.NET.

  • by Dhalka226 (559740) on Tuesday January 03, 2012 @10:47AM (#38572546)

    I don't think that evaluating the elegance of the code is entirely unreasonable. If nothing else, it aids maintainability, particularly as the original developers of projects move on and new people have to get up to speed with the code base.

    However, it should not be a primary concern. Those would probably be performance/scalability and speed of development, the order of which varies person to person and project to project.

    To the OP: PHP is a fine language overall. It is not particularly elegant, but it does scale pretty well compared to alternatives and it also is easy to get started with, and has very good documentation. The most frustrating part of it is probably that there are some annoying internal inconsistencies. The one that always ends up getting to me is stristr( $haystack, $needle ) for checking if one string is contained in another versus in_array( $needle, $haystack ) for checking if an element is contained in an array. The argument reversal is just frustrating.

    So far as PHP frameworks, the one I have used the most is CodeIgniter. It is not bad, neither in features nor in learning curve, and it is reasonably fast. I have also heard some good things about Yii, but do not have personal experience with it.

    I personally really enjoy Ruby and Ruby on Rails as language/framework, but I can not deny that there are scalability issues sooner than with PHP, and it is also harder to find cheap web hosts that support it well if that is a factor. It is a beautiful language though, and you can get a basic website up and running at lightning speed. In my experience it is also a very hot language with good job prospects if that is a goal. Some people worry about using it for their projects because of the comparably small number of developers for it, but those that do typically pay quite well.

    Bottom line: If the only reason you are not using PHP is other peoples' disdain, screw them. It is a fine choice. If you want somebody else to pick the best choice for you and your project, we can not do it; we lack the information, if nothing else, and all you will get is a bunch of replies about peoples' pet frameworks. You seem to like PHP, so go with that. Google "best PHP frameworks" and I am sure you will turn up a chart somewhere comparing a bunch of them for you and you can make the choice from there. All I would really concern myself with is a nice bit of database abstraction (so that it can handle SQL injection issues for you) and performance; the rest is choice or gravy on top. I personally prefer ones that do not have a specific template language and instead just allow me to continue to use PHP in my views. I do not see the advantage of learning yet another "language" and abstracting further away from the code that is ultimately going to be run, but if you do that is your choice.

  • Re:ASP.NET and C# (Score:5, Insightful)

    by CastrTroy (595695) on Tuesday January 03, 2012 @10:55AM (#38572648) Homepage
    I'm a .Net developer, and I find a lot of what you say is true about .Net especially with respect to the standard controls. However, there's nothing stopping you from writing PHP style code in .Net. That exact line (if statement) you wrote out in PHP could easily have been done exactly the same in C#. Personally, after using .Net for 10 years, I have never actually used the standard controls, but rather just went about using the language to generate HTML because that's what seemed to cause the least friction. You end up generating your own libraries for the standard interface elements your applications uses. I've found this true of just about every programming language I've ever used. The standard stuff is sufficient for getting a prototype out the door quickly, but if you have a big project, you end up having to write a lot of custom code, because the included stuff never dose what it's needed to. The PHP style code ends up being the best starting point, because you don't waste a lot of time trying to bend the included stuff to do things it was never meant to do.
  • Re:Django (Score:3, Insightful)

    by dbrueck (1872018) on Tuesday January 03, 2012 @10:59AM (#38572698)

    I've been using Python for over a decade and the whitespace is a total non-issue. Maybe in theory it could be a problem, but it just isn't in practice. Hate the language for other reasons if you want, but that's just not an actual problem that occurs in the real world.

    Seriously, we've used it on tiny projects to massive applications, from small teams to large, multi-department teams, from "systems programming" to web dev to desktop apps to mobile development, and off the top of my head I can't remember whitespace copy/paste problems. Ever. Maybe it happened once and was noticed and fixed so quickly that nobody ever talked about it? Who knows, it most definitely isn't on our top 100 (or top 1000 AFAICT) problems encountered during development.

    Python is a fantastic choice for many situations. The choice of language to use is somewhat subjective, so if it's not for you, so be it, but IMO it's really hard to argue that significant whitespace is a practical or objective reason to not use it. In fact, I'd argue the reverse - there are real benefits to it. We use a fair amount of C++ and Javascript as well, and all of the code is indented anyway. It always feels strange in those other languages to indent /and/ give some additional cue to the parser about the structure of my code. It's redundant. :)

  • Re:Django (Score:3, Insightful)

    by dbrueck (1872018) on Tuesday January 03, 2012 @11:08AM (#38572790)

    I don't think he said that was the only reason for switching languages. Python has a lot of other stuff going for it too - significant whitespace is just one of them.

    Anyway, from the perspective of developers whose first choice is Python, it's just that those curly braces are fluff, they are redundant noise. They don't necessarily make the code more readable (whitespace is used to denote the structure of the program anyway), they exist because the parser needs them, so it *feels* like a weakness in the language. It's like, "I've already taken the time to format the code to make it readable and at the same time to express my intent, unfortunately I also need to put in additional annotation to make the parser happy."

    It's not a huge issue, but it's just one of the reasons I like Python: it doesn't get in my way. Anytime I find myself doing something because the language requires it and not because I need it, it's annoying. If I've been working in Python for a few days and then switch over to C++ or ObjC, I'm always forgetting braces and semicolons. Why? Because *most* of the time they serve no purpose and exist only because the language requires them. Omitting them does not indicate a logical or algorithmic error, rather some busywork required by the language.

  • by jellomizer (103300) on Tuesday January 03, 2012 @11:13AM (#38572854)
    ASP.NET or JAVA EE are all perfectly fine and their real advantage in Enterprise development is the ability to find good Professional Software Developers.
    PHP as a language is a personal preference... However many of the PHP Developers do not do too much Enterprise coding so PHP code tends to be sloppy. While ASP.NET or JAVA EE Code seems to be written in more of a professional way.

    You can write good PHP Code that does everything that ASP.NET or JAVA EE does and it may even be better and faster. However the people who tend to write PHP do not code thinking of enterprise teer development
  • Re:ASP.NET and C# (Score:5, Insightful)

    by NewWorldDan (899800) <> on Tuesday January 03, 2012 @11:53AM (#38573346) Homepage Journal

    Very well, C# (a language) is a very excellent language. It can be used for server side scripting, just like PHP. Same with Java. However, it's generally assumed that your language of choice is going to be couple with some sort of framework. The great thing about Java and C# is that the skillset is easily transferable to areas outside of writing web pages. This is very important for me, as my application is more than a web page. It's an ecosystem of several applications that work together; emailing reports, collecting data, managing billings, etc. It allows me to reuse code and have one data access layer for all of my programs ensuring that they access the database in a uniform fashion. I don't know if it's possible, but I certainly don't know anyone personally who is writing desktop LOB applications using PHP.

    On a related note, Silverlight is an awesome platform. I won't touch it or use it because I don't think it has a future, which is unfortunate. It's certainly easier, faster, and more elegant that writing ASP.NET web pages. Frankly, web development sucks, and I look forward to a day (and I'll probably be retired by then) when there's a good universal client/server paradigm that's not based around HTML and JavaScript.

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

    by GreyLurk (35139) on Tuesday January 03, 2012 @11:53AM (#38573364) Homepage Journal

    Seriously? Mod_mono_module? Have you even tried using that on an existing ASP.NET app? About 1/3 of the important features are broken.

    ASP.Net/C#/MSSQL/Windows/Visual Studio is great as long as you're willing to dump $10-15 grand for the whole stack of software. If you do, a ton of stuff "just works", and you can be incredibly productive. However, take one step outside of that stack, and you're back to writing just as much code as a PHP developer would, and you're due for some major headaches. Swap out your MSSQL server for MySQL or Oracle? Entity framework breaks, and Linq isn't very functional either. You're back to writing ADO.NET. Want to drop the $1500 Visual Studio? Sure you can edit with Notepad and Nant or MSBuild files, but welcome to a world of hurt, not to mention there's barely any documentation or support on blogs, books, or IRC channels. Try running on Mod_mono? Hope you didn't build anything that uses WebForms, or WCF, because if you did, you're going to be rewriting them. Prefer Python over C#? Sure, there's IronPython, but there's basically 0 documentation, and you're on your own.

  • Re:PHP is great (Score:3, Insightful)

    by mangobrain (877223) on Tuesday January 03, 2012 @12:10PM (#38573564) Homepage

    Unfortunately, I don't have a good answer for you. However, I would like to point out that in my opinion, your question typifies what is wrong with trying to use HTML, HTTP and JavaScript as a general purpose development platform. The reason this isn't easy is because long polling is a hack, as are all "push" technologies. HTTP was only designed as a simple, one-way request/response protocol; clients make requests, and the server responds.

    I'm not entirely convinced that running arbitrary code directly from the browser is a good idea, regardless of whether or not it works across many platforms; but if people really want to take application development in that direction, can we please design technologies which are up to the task, and stop abusing ones which were never intended to be used that way?

    Disclaimer: at $DAYJOB I develop a web proxy; HTTP abuse makes me cry.

  • by maple_shaft (1046302) on Tuesday January 03, 2012 @12:18PM (#38573682)

    You just went full troll... The fact that you got modded +5 makes me lose all faith in the Slashdot community moderation process.

    Somebody who doesn't clearly understand the importance of frameworks, detailed scalable software designs, enterprise level consistency, and maintainable code that is appropriately decoupled and unit tested, is somebody who shouldn't be writing software of any kind. Oh and if given the chance I would very willingly share with you some of my source code, because I am a nice guy and would like for you to learn something about software development in corporate environments.

  • Re:ASP.NET and C# (Score:5, Insightful)

    by LWATCDR (28044) on Tuesday January 03, 2012 @12:41PM (#38574060) Homepage Journal

    Actually PHP is pretty bad as a language. Like Perl it does nothing to encourage proper design or even readability.
    What people don't understand is that a good programer can write a good, stable, and scaleable program in just about any language. The best can do it in Assembly language.
    Bad programers can write crap in any language.
    The problem is that most programers fall in the middle. A good language will help them write good code.

    So what is good about PHP? That is simple, it is popular, everywhere, and has a lot of support. IMHO it is the Microsoft Basic of the web. I have not played with Yii, Cake, or Zend but they all sound very interesting.
    One may want to go one step higher and possibly look at something like Drupal or Joomla instead of a framework. What the original poster wants to do may already be available in one of those CMSs or could be added to it as a module.

The most exciting phrase to hear in science, the one that heralds new discoveries, is not "Eureka!" (I found it!) but "That's funny ..." -- Isaac Asimov