Slashdot Mirror


Ask Slashdot: One Framework To Rule Them All?

New submitter ittybad writes "I work with a small web-based company, and, for some new web applications, we are looking to possibly change frameworks if it will be a benefit to our developers and our customers. We have experience with PHP's Symfony 1.4, and are not happy with what we are experiencing with Symfony 2.0. We have some Ruby guys who would love us to implement a Ruby on Rails solution, and our backend is Python powered — so maybe Django is the way to go. So, I ask you, Slashdotters, what web framework do you find to be the best and why? Why would you avoid others?"

24 of 287 comments (clear)

  1. Duh by masternerdguy · · Score: 5, Funny

    One tool to rule them all: Assembly.

    --
    To offset political mods, replace Flamebait with Insightful.
    1. Re:Duh by khr · · Score: 4, Funny

      One tool to rule them all: Assembly.

      An Assembly Server Pages framework, HTML with embedded assembly for processing stuff?

    2. Re:Duh by KiloByte · · Score: 4, Funny

      That would go against the whole idea -- you're supposed to write to the network card's ports directly. The instructions you want are IN and OUT. You can do better than to use an existing inefficient IP or TCP stack.

      I guess some soldering iron monkeys will try to dismiss me for not going closer to the metal, though.

      --
      The creatures outside looked from Alt-Right to Antifa; but already it was impossible to say which was which.
    3. Re:Duh by Smallpond · · Score: 5, Funny

      The questioner asked for the "best" framework without defining what best meant, so we can pick whatever criteria we want.

      Assembly is best if you want highest speed and smallest memory size but don't care about development time.

      Personally I would write everything in Perl, because my criterion would be highest job security.

    4. Re:Duh by larry+bagina · · Score: 4, Informative

      HipHop for PHP converts PHP into c++.

      --
      Do you even lift?

      These aren't the 'roids you're looking for.

  2. Sounds Like Cake is the way to go by Ash+Vince · · Score: 5, Informative

    If you have an existing base of PHP and Ruby developers then Cake sounds like the way to go to meet them both in the middle so everyone can pick it up fairly quickly. Cake is based on many of the same concepts as Ruby on Rails so everyone should be fairly at home. It is still PHP though so it won't force all your dev team to write better code as much as RoR will. The flexibility of a PHP base can be a plus though unless it is put in the wrong hands.

    http://cakephp.org/

    Personally I am struggling through my first Zend Framework Project at the moment but I am not sure I would recommend it as it has caused me a few too many frustrations. I do worry that this will just knock all the other PHP Frameworks into the long grass though as it is by the same people as PHP. I am starting to see quite a few job offers coming my way now I have added Zend Framework to my CV so it does seem to be very popular for some reason.

    I just noticed you also mention having a Python powered backend, this may change my advice above but it does bring about another question: Do you really need so many different technologies? Surely this must drive up your costs considerably as you need developers with a much wider skill set or more of them.

    --
    I dont read /. to RTFA, I read /. to offend people in ignorance.
    1. Re:Sounds Like Cake is the way to go by Xest · · Score: 4, Informative

      Hmm, I don't mean to sound horrible, but if you're finding Zend difficult then I'm not sure you're at a skill level high enough to give a useful answer to this question.

      In the world of PHP, Zend is about as good as it gets as an MVC framework, the rest have too much cruft that either require you to work to their own obscure bastardised definition of MVC, or hack around their forced methods of doing things in an ugly way.

      As for my personal opinion, well, it's hard to give a single option, there isn't enough information in the original post. Frankly if they're using Microsoft hosting platforms only then C# and ASP.NET MVC are the best choice, if they're using a combination of hosting OS' and want something that's rock solid and will scale well then Java with something like Spring is the best bet, if they're more of a just get something working attitude and are not too fussed about the kind of code consistency and testability then stick to PHP and Zend, although even that's getting quite good in terms of testability now too.

      If Zend knocks all the other frameworks into the long grass it's not because of any association with the PHP developers, it's because the other frameworks can't even get the simplest things right, like implementing MVC properly and because they're developed in the same inconsistent haphazard manner as PHP itself historically has been. If however you really really do need something higher level where much more is done for you, then Drupal is about the cleanest, most modular, and most well written that I have found.

  3. Go where your expertise is by buchner.johannes · · Score: 4, Insightful

    If people in your group already love RoR, it's best to go with their expertise. Technically, there isn't enough difference to make it matter.
    Backends are virtually always in a different language than frontends (not that that's a good thing, but it shouldn't worry you too much).

    --
    NB: The message above might reflect my opinion right now, but not necessarily tomorrow or next year.
  4. one (more) framework to rule them all by Anonymous Coward · · Score: 4, Funny
  5. Wt by paugq · · Score: 4, Interesting

    Wt 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.

  6. Re:Drupal by bluec · · Score: 5, Funny

    Sure. And a chisel can be used as a screwdriver.

  7. Just stay by cjpa · · Score: 5, Insightful

    Why not stay with Symfony 1.4? It's a mature and well-supported framework. We have been playing with Symfony2 ourselves at my current job, but decided to keep using 1.4 until the formgenerators of Symfony2 are a bit more mature.
    Of all the php-frameworks i've worked with, Symfony 1.4 still makes me most productive.

  8. the cake is a lie by ircmaxell · · Score: 5, Informative

    I couldn't disagree more. Cake is loaded with deeply awkward black magic and bad practices. Not to mention the fallacy that the model layer is the orm (hint: in the rest of the world it is not). Cake is second on my list of frameworks to avoid (and most senior developers that I know agree). I would suggest you do the same. .

    --
    If a man isn't willing to take some risk for his opinions, either his opinions are no good or he's no good
  9. Re:Avoid frameworks by james_van · · Score: 5, Informative

    Agreed. Frameworks are nice, but I'm finding them to be very very very overused. Take a minute and really look at your project. Does it actually need a framework? Does the use of a framework save enough time in development to justify the additional overhead? If so, is that because you (or the people working on it) have been taught frameworks as opposed to learning actual programming (laugh if you want, I've met far to many people who know a bunch of frameworks, but couldn't write the most basic raw code if their lives depended on it), or because it actually streamlines the development process? The majority of the projects I've worked on haven't actually benefited in any way from the use of a framework when they've been properly evaluated. Not saying yours is the same, but make sure you take a good, long, objective look at it before you decide on something. My $.02, take it or leave it.

  10. Don't use Cake. Try Yii instead by Anonymous Coward · · Score: 5, Interesting

    Don't use Cake. There's limited support for actually getting back true objects with their ORM, which means you can't really deal with an intelligent data object. I did a lot of heavy research on the subject last year for my web company and found that Yii Framework (http://www.yiiframework.com) really fit my sweet spot well.

    My legacy code is/was all in PHP (up to 8 years of code), but I wanted the flexibility and advantages of a good object based, MVC system that I could fit over top of my legacy code and upgrade as I had time (without having to do an entire rewrite of the code from scratch).

    If you mainly do small one-offs that don't require much ongoing work / maintenance, then either RoR or Django would work fine. But if you already have a sizable code base, the benefits of using a framework in the same language is noticeable. I keep finding new things I can do with Yii after a year that make me faster and faster. Haven't run into any needs that haven't already been planned for in the framework (compared to CFWheels, a Coldfusion Ruby-on-Rails clone I've been switching a client to, that while quite thorough, does have limitations I'm already hitting after a week). And the Yii forum is quite active and seems to have steady readership and input from the main committers. So wrinkles with the framework get resolved on a timely basis. It's been a joy coding in.

    Good luck!

  11. Flint is extremely sharp by Anonymous Coward · · Score: 4, Informative

    Correctly flaked, flint is MUCH sharper than any straight razor you can find. We don't use flint in for example atomic force microscopes as tips (instead of say steel) for nothing, you know.

    You may think stone age people had just stones for tools, but their flint blades were sharper than any steel (or even soft iron) blade you can get.

    I find that comparing assembly to flint is extremely apt. Especially so when you consider the fact that our circuits use a silicon substrate. You do know what flint is, right?

    1. Re:Flint is extremely sharp by LF11 · · Score: 4, Informative

      That would be obsidion that they use in surgery. An properly flaked obsidion edge is much sharper than the sharpest steel. How do you define sharper? Obsidion will flake to a single-molecule edge. Steel must be sharpened, and even when extremely sharp, will rip more than slice.

      As I recall, the reason obsidion cuts heal better is because the sharper edge slices between the cells of the body, rather than ripping through them like steel.

  12. Re:Drupal by mouf · · Score: 5, Interesting
    Actually, when looking for a framework, having a look at Drupal is not that stupid. I must admit I have a love-hate relationship with Drupal. It comes with a set of restrictions, but you have a website out-of-the-box to start quickly: a nice templating engine, an easy way to add static pages, a way to manage users... and it has several thousands available module to easily add functionalities, which is unprecedented

    Now, in my opinion, the real problem with Drupal is that it does not rely on the MVC pattern, and most developers are used to that. Also, it is not object-oriented!

    At my place, we have developed an MVC framework that we can plug to Drupal. This way, we get the benefit of Drupal and all its modules, and when it comes to pure PHP development, we have a nice MVC framework instead of those bloody Drupal hooks. If you want to have a look:

    It is released as open-source, it is functional, but documentation is not complete yet so I would not recommend using it until we finish the documentation (probably in January).

  13. No easy answer by 1s44c · · Score: 5, Insightful

    There isn't an easy answer. All frameworks are great at getting you 80% done then make the last 20% nearly impossible.

    What you know best is properly the right thing to use as long as it's capable of getting the job done and you can still find new staff who have some knowledge of it.

  14. Avoid frameworks like the plague... by Ami+Ganguli · · Score: 4, Interesting

    ... unless you're in the business of throwing together form-based database apps quickly.

    That's really all they do well, and there area lot of form-based database applications in the real world, so that's not a small niche.

    But for anything that's a little different, you end up spending a lot of time learning the framework, and then even more time working around its limitations. The better approach is to look at your problem and find a set of libraries that are well suited to the task at hand, well documented, well supported, and modular.

    Also, take the time to learn your tools properly and exploit them to the fullest. Learning a framework takes time. So does learning about Apache modules and SQL stored procedures. The difference is that the time invested in the framework isn't generally applicable to other problem domains, while Apache and SQL are everywhere, and are worth learning well.

    --
    It is tempting, if the only tool you have is a hammer, to treat everything as if it were a nail. - Abraham Maslow
    1. Re:Avoid frameworks like the plague... by rev0lt · · Score: 4, Insightful

      There are several advantages in using frameworks - you usually end up using tried-and-true methods to solving common problems, you may be "forced" to use some methodology that may turn you into a better programmer, and you are using code tested and debugged by thousands of other people.
      Using a framework doesn't mean you need to drink the cool-aid or use ORM - in fact, if you choose a hybrid framework, you can pick the components you need, and still use your legacy/custom code for the rest.

  15. Don't underestimate the "no framework" option! by fzammett · · Score: 4, Insightful

    We've gone through a number of options where I work, from a homegrown framework to Struts to various other trials. Eventually, when I managed to pull us into the RIA world, I make a suggestion that got crooked looks initially but which now, a few years on, is seen as ideal: NO FRAMEWORK AT ALL!

    We're primarily a Java shop, but this can apply in any shop since there are similar options available for .Net, PHP, whatever else, but I'll describe our model because its very simple: our apps are nothing but POJOs (Plain Old Java Objects for those not in the Java realm) that we talk to via DWR.

    That's it.

    No Struts, no JSF, no Spring MVC, not even straight servlets! Nothing but pure, simple Java classes with no real tie to any HTTP-related objects (well, usually... some exceptions here and there are required).

    The benefits are many: the code is simple and clean... the classes are so easy to unit test that we actually manage to get our developers to do it (sometimes)... configuration doesn't get in the way (no, it's not as simple as some frameworks because there IS configuration, but its so minimal no one minds)... performance is top-notch since there's no extra work being done by a framework first (granted modern frameworks are very efficient and this difference is probably minimal, but still)... and new developers can be brought up to speed in less than a day and no one is ever confused by the code, that's fore sure! There's also been an implied side-benefit: our apps are written in a very stateless fashion since using state becomes unnatural in this architecture (there IS some usage of state used in some places where it's truly necessary, and that's the exceptions I mentioned earlier to not using HTTP-related objects). Yes, this was one of my goals in pushing this approach in the first place, but it's nice that I didn't have to hand down any edicts or anything because it came naturally out of the architecture anyway.

    What you wind up with really is a service-oriented design since you're doing more work client-side and the server-side code is a lot thinner... things like navigation and such, transitions between states, are no longer handled by a server-side framework (there's way you still COULD do it server-side, but it becomes pointless). This definitely takes some getting used to and we had our share of paradigm shift-induced ugliness. But we got through it and we're all the better for it.

    But, if this isn't the type of application you're looking to develop, if you want the more "classical" web app model, this probably isn't the way to go (although it still can be valuable to mix a technology like DWR in to your, say, Struts-based application... that can be a good first step in fact). You definitely do have to rely on client-side code more (no, NOT at the cost of security, you can be just as robust in that area as you could ever be if you do things smartly). Pair something like DWR with a top-notch front-end library (ExtJS is our choice) and you have yourself a very powerful architecture that you could even call a framework if you want.

    My point is simply that you shouldn't get into the mindset that you HAVE to have some big, do-it-all-for-you framework to be productive, and in fact if you go to the opposite extreme and use no framework at all, if you do it wisely, you can find you are more effective then you'd be even with the best framework backing you up. "None of the above" can in fact be a viable and even possibly utopian answer to the original question :)

    --
    If a pion (n-) collides with a proton in the woods & noone is there to hear it, does lamdba decay into the source pa
  16. Django by claytongulick · · Score: 4, Interesting

    I've read the comments in this post, and I agree with most of them, especially the guys who argue in favor of avoiding frameworks all together. I get where they're coming from, I really do. In fact, not so long ago, I would have made the same argument. The problem is, to do web development, you really need some sort of "framework" or "library". It doesn't make sense to recreate the wheel for URL parsing, environment param passing (ala CGI), etc...

    At the end of the day, you'll need to pick some set of utilities in order to be successful at a web project. It's debatable what constitutes a "framework" vs "utility library", because there's a lot of grey area there.

    Of all the ones I've used, ASP.Net, ASP.Net MVC, Sprint, Struts, Cake, Symfony, Django and homegrown, I'm landed pretty solidly on Django.

    The reason for this is how it really gets out of your way, and just lets you code. It has all sorts of fancy features if you want them, but you aren't compelled to use them.

    It's lightweight (I run several Django + postgres instances on a VM with 500mb of RAM with sub 200ms response times), the different parts are pluggable, you can swap out the ORM, templating engine or admin parts for anything you like, and it embraces the pythony way of doing things.

    There isn't a bunch of black magic, it's really very straight forward. The framework code is very readable, and minimal. The core "framework" is really just a set of python modules that give you very handy utilities - URL routing, ORM, Templates, etc...

    Don't like sessions? No problem, just don't include that module. Don't like the ORM? No problem, roll your own, or use something else.

    Want a full blown framework with automatic admin interface, and all the bells and whistles? Great, it's there for you if you want it.

    In general, I've been one to avoid frameworks because I agree with the sentiment of many other posters on here - frameworks do the "easy 80%" quite nicely, but the final 20% ends up being weeks and weeks fighting with the framework.

    Django is the only one I've encountered that doesn't have this problem. I've never had to fight with Django at all. My only problems were a lack of solid python skills, but one I picked that up, Django was beautiful and made a lot of sense.

    It's the most intelligently designed, practical, useful framework I've ever found, and has done what no other framework I've used has done: actually saved me enormous amounts of time.

    --
    Drinking habits can be dangerous. You can choke on the cloth and the nuns will wonder where their clothes are.
  17. Re:Avoid Django by Binary+Boy · · Score: 4, Informative

    Could not disagree more. I've worked with a variety of Web platforms/frameworks; on my current job, there is a bit of Drupal fandom, despite almost no one having any experience (except me) with Drupal - it's just become a popular buzzword here (another story).

    So one of my first projects after arriving, management had already had it in their heads that it would be Drupal-based. After digging in to the requirements for a week, working on a prototype/proof-of-concept, I quickly hit some walls and realized I'd be spending as much time patching bugs in existing Drupal modules as writing original code - the data model is complex and Drupal's database abstraction layer is about as ugly as they get.

    Annoyed and frustrated, after a few beers with an old friend the night before, I read the first few pages of the Django getting started docs on the way home one night - by the time I got home I felt like I had a strong sense for how the framework was structured, the conventions it followed, etc - the docs were clear, concise, and the framework sounded elegant and straightforward, with a clean design (unlike Drupal, which seems to suffer from no particular design).

    I hit the ground running with Django and haven't turned back - since that first night with it, I've not run into any big surprises - everything just works as expected. The code is solid, the design obvious, and I'm really in love with Python (having only written simple scripts with it in the past).

    I don't think I've ever found the docs to be wanting, and not sure what you mean by the config being touchy - it practically holds your hand, the integrated debug mode gets you straightened out quickly. It does help to understand what Pythonic code looks like - Django is pretty damn close to a perfect expression of what it means to be Pythonic, so it's advisable to get comfortable with Python itself of course.

    The one thing I thought I'd hate with Python - the use of whitespace as structure - I got used to very quickly, with the help of a decent text editor. Otherwise it's been a joy.

    FWIW.