Slashdot Mirror


Balancing Performance and Convention

markmcb writes "My development team was recently brainstorming over finding a practical solution to the problem that's haunted anyone who's ever used a framework: convention vs. customization. We specifically use Rails, and like most frameworks, it's great for 95% of our situations, but it's creating big bottlenecks for the other 5%. Our biggest worry isn't necessarily that we don't know how to customize, but rather that we won't have the resources to maintain customized code going forward; it's quite simple to update Rails as it matures versus the alternative. What have your experiences been with this problem? Have you found any best practices to avoid digging custom holes you can't climb out of?"

171 comments

  1. Switch to django and python for starters by 1155 · · Score: 2, Informative

    I worked in a small shop that used rails, we found that rails is... constricting, just for the reasons you posted to slashdot for. We looked at our options and switched to django+python. Maintenance wasn't a problem after that. I'd suggest investigating a switch now while you have an opportunity.

    1. Re:Switch to django and python for starters by latentevent · · Score: 5, Insightful

      Comments like this really don't address the core issues. Frameworks, and especially heavily-developed ones like Django/Rails, are rarely cause for insurmountable performance problems. Of course, caching and setting up distributed workload processing queues will be necessary in any framework, but that's up to the development team working on a specific app rather than the framework itself.

      I've been working on a large Rails application for over a year, and we haven't found any scaling issues related to Rails. Instead, there are a number of things that we've done in our application in order to help it scale for our given workload.

      That said, there are a number of things that Rails will do to help you scale your application. You may want to look at how Rails 3.0 (the next release of the Rails framework) is incorporating several ideas from Merb to make the framework lighter-weight and more extensible through Rack and the concept of Rails "metals." For offline processing in a Rails app, look at plugins like workling/starling and other message queues. I think you'll find that 1) Rails doesn't have scaling issues, programmers on Rails have several challenges that they have to face to make their applications scalable (just as in any other framework) and 2) As far as providing tools to facilitate developers in scaling their apps, Rails is quite a powerful framework and one that should be given a lot of consideration by development teams.

      In conclusion, though, vague comments like "avoid Rails, use Django" are just unproductive spreading of FUD and don't really contribute to any significant discussion or understanding of how to get any of the viable web application development frameworks to scale in any specific case.

    2. Re:Switch to django and python for starters by Forge · · Score: 5, Insightful

      After reading the linked commentary, I can say there really is a better 4th option. It was even hinted at by the author.

      Write your extension/hack as a modification of Rails and/or Ruby. Send them back to the maintainers of said products and see if you can get them inserted as a standard part.

      If they do not exact a significant penalty elsewhere for the improved performance in your pretty mundane scenario. It is highly probeble, your changes will be accepted.

      This isn't just true for Rails. It's true for any software (except stuff maintained by immature, anal retentive morons.

      If it's L/GPL, BSD or other common free license, then this adoption of customer written code is a routine matter. If it's closed source and proprietary they may feel the need to get a lawyer involved and have you sign over all ownership rights to the code you wrote to improve their product (ask for money or stock when that happens).

      Either way, in most scenarios good clean extensions tend to get adopted as part of the main program.

      PS: Yes. Even "The Evil Empire" (Microsoft, Sun, Apple, IBM etc...) have been known to do this.

      --
      --= Isn't it surprising how badly I spell ?
    3. Re:Switch to django and python for starters by Anonymous Coward · · Score: 0, Flamebait

      The problem with django is that you have to use Python.

    4. Re:Switch to django and python for starters by arth1 · · Score: 4, Insightful

      And when the guy knowing Django moves on, what's the chance of finding a replacements who knows it? How much will that reduce the number of eligible applicants for a position -- will you disqualify fifty really smart guys for five mediocre ones who happen to know Django?

      In my experience, being a system administrator for over a generation, what is the most maintainable is to go for standards and well-defined APIs, and document it, document it, document it. Especially document what's obvious and "standard practice", because it may be "standard practice" to do a certain thing in a certain language or certain package, those who come around ten years down the road may not know that this was standard, or why. So document, not so much what you're doing as why. Any coder worth his pizza will figure out what but be clueless as to why.

    5. Re:Switch to django and python for starters by arth1 · · Score: 3, Insightful

      Comments like this really don't address the core issues. Frameworks, and especially heavily-developed ones like Django/Rails, are rarely cause for insurmountable performance problems.

      >
      No problem is insurmountable. But they are commonly cause for surmountable performance problems. And surmounting costs time and money, while not impressing those who noticed the problems or pay for fixing them.

      If in doubt, KISS. Adding extra abstraction layers is generally not simplification. It's like adding another layer of management in a company, in that it is sometimes necessary, but it will rarely increase productivity or responsiveness, at least not in the long term. Especially not when a middle level manager gets replaced with someone who doesn't do things the same way.

    6. Re:Switch to django and python for starters by Anonymous Coward · · Score: 0
      Grails
      1. Groovy has a c-like syntax while having some support for FOP
      2. Grails is java under the hood and it scales like java
      3. Grails is composed of technology we've all come to get used to and hate, therefore the greatness of the abstraction so you'll get your hand dirty as little as possible
    7. Re:Switch to django and python for starters by Fweeky · · Score: 1

      If he and his team are experienced with Ruby, why would they switch not just frameworks, but language? Python's not especially faster, it doesn't have a particularly better threading model (in fact, once you factor in JRuby, it's much worse), and the language itself isn't going to do anything to reduce "constriction", especially if they're unfamiliar with it.

      If it's Rails you find "... constricting" (whatever that means), there are at least a dozen other Ruby frameworks out there, which would be rather easier to transplant existing code to.

      But no, sure, your little 2 line "Rails suxxx! use a completely different language and my favourite framework for no reason I'll actually explain" sure does deserve to be +5 Informative.

    8. Re:Switch to django and python for starters by Serious+Callers+Only · · Score: 3, Insightful

      I worked in a small shop that used rails, we found that rails is... constricting, just for the reasons you posted to slashdot for. We looked at our options and switched to django+python. Maintenance wasn't a problem after that. I'd suggest investigating a switch now while you have an opportunity.

      Out of interest, what did you find constricting about Rails? Your comment here (and the article, such as it was) are not very illuminating on this score.

      I've found it fairly easy to modify, very easy to add plug-ins to, and very easy to add custom SQL queries to if necessary for performance reasons (though most of the time that's not necessary). The only area I can see it being constricting would be when trying to interface with a legacy db structure which can't be changed, in which case Django would have similar problems.

      Because the article is not specific enough on the problems they'd like to work around, it asks an unanswerable question - there is no magic formula for trading off convention and performance, no magic bullet; at a certain point you have to stop relying on a framework and add something yourself if it doesn't do what you want or perform to your satisfaction. The same holds true for any framework, and though the received wisdom on Slashdot is that Rails is difficult to work with, or doesn't scale, many companies don't find that to be the case (yellow pages, etc etc).

    9. Re:Switch to django and python for starters by truthsearch · · Score: 2, Interesting

      The best option is to not use one single framework for all situations unless it's appropriate. Too many developers put blinders on, picking one framework and using it for every project.

      My company has a flexible custom framework that we use for the majority of projects. But before we start on any project we discuss the options to see if another framework or open source app would be a better fit. Along with picking the best language for a task, the same should be applied to frameworks.

      No need to use Rails or any other particular framework if it doesn't fit the project.

    10. Re:Switch to django and python for starters by quanticle · · Score: 2, Informative

      And when the guy knowing Django moves on, what's the chance of finding a replacements who knows it? How much will that reduce the number of eligible applicants for a position -- will you disqualify fifty really smart guys for five mediocre ones who happen to know Django?

      Probably not. In my (admittedly limited) experience, I find that Ruby on Rails and Python/Django are similarly supported, and have similar user/developer base sizes. Frankly, if I was choosing between Rails or Django, finding developers for either would be pretty far from the top of the list of my worries.

      --
      We all know what to do, but we don't know how to get re-elected once we have done it
    11. Re:Switch to django and python for starters by harry666t · · Score: 1

      > The problem with django is that you have to use Python.

      Can you explain the problems associated with using Python as a language for web development?

    12. Re:Switch to django and python for starters by harry666t · · Score: 1

      > will you disqualify fifty really smart guys
      > for five mediocre ones who happen to know Django?

      If your smart guys are really that smart, they shouldn't have trouble with picking up any language/framework. Speaking as someone who picked up PHP/Joomla last month and now is working with it in his daily job.

    13. Re:Switch to django and python for starters by ultrabot · · Score: 0, Troll

      > The problem with django is that you have to use Python.

      Can you explain the problems associated with using Python as a language for web development?

      Don't you know that Python is just a hack that doesn't support "real" object oriented programming?

      You can't just take a language like Python and make it object oriented by adding objects. You need a language like "Ruby" that is object oriented from ground up!

      I read it on Ruby advocacy pages, and hence it must be true. Also, C00lDudeFromDaGhetto on IRC confirmed the same.

      Nothing to see here, move along... and don't forget that RoR is much faster to development for than Java! And C!

      --
      Save your wrists today - switch to Dvorak
    14. Re:Switch to django and python for starters by SanityInAnarchy · · Score: 1

      Couple of points:

      Of course, caching and setting up distributed workload processing queues will be necessary in any framework, but that's up to the development team working on a specific app rather than the framework itself.

      True -- but Rails does make caching easy.

      You may want to look at how Rails 3.0 (the next release of the Rails framework) is incorporating several ideas from Merb to make the framework lighter-weight and more extensible

      It's more than that -- Rails 3.0 is also Merb 2.0. So, Rails 3.0 should gain all of the advantages of Merb -- one of which is raw performance.

      For offline processing in a Rails app, look at plugins like workling/starling and other message queues.

      For what it's worth, Merb has a simple threaded backgrounder built in.

      --
      Don't thank God, thank a doctor!
    15. Re:Switch to django and python for starters by Anonymous Coward · · Score: 0

      Rails and Django are not your only choices. Will you disqualify fifty really smart guys for five mediocre ones who happen to know Django or Rails?

    16. Re:Switch to django and python for starters by shirai · · Score: 3, Interesting

      Rails has a lot of problems mixed in with a lot of greatness. For a great many projects, its greatness overcomes its probems.

      Its biggest problem, IMHO, is that it does not grow well with the needs of a developer over time. Some things:

      * Doesn't scale well
      * Not easy to do anything outside the Rails world

      I had a conversation with Ezra back when he was starting Merb, and I remember the large resistance to the idea that there were problems with Rails at all. As Merb got released and then popular, it was clear that there are holes in Rails (yes I know they are merging).

      At about the same time, I started my own framework (the Caffeine framework now the Go framework) which has not been made open yet (and is not complete yet), but there are several issues that it addresses which could help (a) improve Rails or (b) create other frameworks that can fill holes. I'll mention some of the ideas below.

      Note that the original goal was to use Rails for our "very cool application" (tm). Unfortunately we have some pretty lofty goals and Rails turned out to be the wrong tool. I am the CEO of a successful Internet company CityMax (about 30 employees) so I do have experience with the problems that happen after launch and success. They are not the same problems as during the startup phase.

      Here are some things that an ideal framework has that I believe are missing or lacking in Rails. Again, I do want to stress that Rails has greatness and that I really respect its creator. That said, I think frameworks can grow to another level.

      # Built in scalability and clustering. Should require zero changes (except some configuration) to go from single database to a cluster of databases.
      # Reusable code. If you build a feature (like a message board) for one application, that same code should be reusable in another app with zero code changes. It should also be reusable multiple times in the same application. For example, a blog app might use the message board in each blog but there might also be a support message board for the whole system.
      # Built in scalable file system. The file should be storable in local, Amazon S3, MogileFS, network share or whatever. Directories can be mapped to any file store (e.g. temp directories might be local, permanent storage might be S3 and archives might be a network share). Should be easy to remap directories and migrate from one data store to the other.
      # No magic. Hate it. Makes it hard to figure out and debug the code.
      # Custom field types for database, particularly the ability to insert files and images into a database record. The actual files and images are stored in the scalable file system and automatically managed (basically automatic garbage collection for files).
      # An image field type where you can change the image sizes (e.g. thumbnail, preview, full size) at will and images are automatically regenerated in those sizes the first time they are needed. This is one of those problems that comes out as you get bigger. Say your shopping cart app stores images in 3 sizes. Now you have 10 million products and you want to add another size. Without this, you are basically stuck with the decision you made at the start.
      # Make easy things easy and make hard things easy. In Rails, the solution is usually to memorize the option that allows you to do what you want. With the right design, the problems should be solvable using just Ruby and the framework. This helps keep the framework light and easy to learn over time.
      # Discoverable. The framework needs to be easy to figure out on ones own. Merb was more like this. Rails was less.
      # Multi-threading. This was one of the primary reasons I didn't want to use Rails originally. I understand that threading is in Rails 2 now but I'm not sure how good it is.
      # CouchDB. Okay, this feature is a little cutting edge but the biggest issue after launch is migrating the database. Add a new feature that requires a new column on a table with a bajillion records and you're doing many long midnight runs

      --
      Sunny

      Be my Friend

    17. Re:Switch to django and python for starters by johanatan · · Score: 0

      Excellent point. This industry is way too married to specific technologies. When I am disqualified for such reasons, I usually take consolation in the fact that people who think that way are no fun to work with anyway.

    18. Re:Switch to django and python for starters by terjeber · · Score: 1

      Some comments to your ideas... I like a lot of what you say and I strongly disagree with some of them.

      zero changes ... to go from single database to a cluster of databases

      Perhaps, or perhaps this isn't something that belongs in the application-server domain at all, but in the database driver domain. In other words, if you need a cluster of DBs, use a DB product that supports this seamlessly. I am not going to mention Oracle by name, but it would support what you are asking here I assume, depending on how the Rails/Oracle guys wrote the Ora driver for Rails. Never tried Rails with Oracle, but for all apps I have written lately, this is taken care of by the Ora driver.

      Reusable code.

      Depending on how you do Rails, this is fully supported. Unless of course I am misunderstanding what you are asking. There is nothing in Rails that prevents you from creating re-usable code. Honestly.

      Built in scalable file system.

      Sorry, disagree with this one too. This is not in the domain of Rails, but in extensions to Ruby and Rails. As such it is fully supported today.

      No magic

      Didn't know Rails did any magic. What does it do? Levitate your trains? Sry, just trying (probably unsuccessfully) to be funny. Honestly, duck and convention over configuration is not magic IMHO, but to some it may seem like it.

      Custom field types for database

      This one might be a misunderstanding on my part, but from what you seem to be saying in the rest of your point, you would like Rails to support things like "image" and "video" as fields in the DB and then use its own implementation for it (such as storing the actual image and video in the file system and pointers in the DB.

      If this is what you mean I have to strongly disagree again, how data is stored physically is not and should not, be in the realm of Rails, that is a combination of an application issue (identifying an item as an image) and a database issue (storing the binary data in a BLOB field).

      If you meant that Rails should support custom column-types in the DB, in other words, if the DB vendor adds "special" column types then Rails should support it, then I maybe agree. Not quite sure. Perhaps Rails should just stick with ANSI.

      An image field type where you can change the image sizes

      Absolutely not! This is an absurd request. This is so clearly an application level item that I have to admit to a certain amount of surprise that you actually ask for it. Including such items in Rails would utterly ruin the framework. Adding extensions to Rails that supports this or similar is perfectly fine, and you might want to give it a whirl, but including it in Rails as such would be wrong and insane.

      In Rails, the solution is usually to memorize the option that allows you to do what you want.

      Here we have to disagree of course since I think this is what Rails delivers, but in this we might just be different. I also think that vi is one of the most user-friendly code editors out there, so I might be a little different.

      Multi-threading

      Hey, at least we agree on something.

      CouchDB

      Yeah, why not, as a driver. Not sure if Rails could do it though, I am not familiar enough with how dependent Rails is on the SQL CRUD idea and to what degree CRUD can be applied to CouchDB. I am not familiar enough with CouchDB to say. If CouchDB is CRUD'dy, I don't see why a driver could not be added to Rails. It doesn't belong in the core however.

    19. Re:Switch to django and python for starters by CodeBuster · · Score: 2, Interesting

      The parent was not so much saying, "avoid Rails, use Django", but rather was explaining that for about 5% of his necessary requirements, customization of Rails was too complex or expensive when compared to the alternatives. I am myself a web developer and our whole business is really about trade-offs and costs. I have not used Rails personally, but from what I understand, in Ruby on Rails those who go "off the reservation" are "punished" with "ugly code" and complex maintenance for not adhering to the core Rails axiom of convention over customization. If you use Rails and like it then by all means continue using it. There are many web development projects out there that can surely benefit from the convention over customization route (aka why reinvent the wheel). However, there is also something to be said for the ability to "plug" or "hook" into a framework and provide customization where necessary and there are few things as frusterating as getting knee deep into a framework and then stepping on a land mine hidden in the muck because the framework developers were careless or walled off an internal handling area and didn't provide a key handling point, or foothold if you will, where it would be *really* nice to insert a custom strategy for some domain specific reason.

    20. Re:Switch to django and python for starters by Anonymous Coward · · Score: 0

      > Adding extra abstraction layers is generally not simplification.

      But when I customized a couple existing rails apps, knowing the conventions simplified a LOT the process.

    21. Re:Switch to django and python for starters by shirai · · Score: 1

      Before I respond, I just want to reiterate the I like Rails and that I really respect its creator; that said, a framework is just a tool and as such it can and should be improved and also that there are other ideas that are different (and sometimes even more radical) that work too.

      zero changes ... to go from single database to a cluster of databases

      Perhaps, or perhaps this isn't something that belongs in the application-server domain at all, but in the database driver domain. In other words, if you need a cluster of DBs, use a DB product that supports this seamlessly. I am not going to mention Oracle by name, but it would support what you are asking here I assume, depending on how the Rails/Oracle guys wrote the Ora driver for Rails. Never tried Rails with Oracle, but for all apps I have written lately, this is taken care of by the Ora driver.

      I agree that clustering would be better solved in the database but I also wish my apps would just write themselves. Neither is realistic or true. The fact is, clustering right now (at least in open source) must be in the application or the framework (note MySQL clustering does not solve the issue). The number of Rails apps using Oracle as a backend are approaching 0%. With the choice between the developer having to write a clustering implementation for every different application and having the framework handle it, I would much rather have the solution in the framework.

      The real problem is that if you don't design your app to use clustering at the beginning (which most people don't) then when they need it, it becomes a major issue. It isn't easy to convert a large software project, constantly in flux, to support clustering. Shouldn't you instead just focus on building your app and then when you need clustering, just flip a switch?

      Reusable code.

      Depending on how you do Rails, this is fully supported. Unless of course I am misunderstanding what you are asking. There is nothing in Rails that prevents you from creating re-usable code. Honestly.

      You are misunderstanding but understandable so. Actually, I haven't seen any framework solve this problem so it's easy to not see what this really means and if so, if it is possible.

      How many reusable features do you see out in the Rails world? I can't remember running across one (though perhaps there is some out there). This is because it takes a lot of work to make a feature reusable. If the framework is designed to not just support reusability (which any framework can do) but instead make it so that any feature you build is AUTOMATICALLY reusable, that is the difference.

      Say you build a nice wiki app. Later you decide that would fit in well with your project manager. How much work would it take to get it to work? Normally. A lot. The reason you don't see a lot of reusable components is that it's really difficult to do conversion. Imagine if you needed a forum so you just grabbed the best forum Gem on Ruby and included it in your app with one line of code. Oh, by the way, its also fully clusterable because that's built in to and the same across all features. 0 code changes except the extra line to add it.

      Built in scalable file system.

      Sorry, disagree with this one too. This is not in the domain of Rails, but in extensions to Ruby and Rails. As such it is fully supported today.

      This is one that I just can't understand why you don't agree with this. Sure you can have a scalable file system but you have to choose which one and then you can't change it easily. Its okay for ActiveRecord to abstract databases (which everybody thinks is a good idea) but the file system interfaces are different for every system? Just like in ActiveRecord you develop an app for ANY database but WHICH database to use is a deployment issue not a development issue). File systems should be the same way.

      For

      --
      Sunny

      Be my Friend

    22. Re:Switch to django and python for starters by terjeber · · Score: 1

      I agree that clustering would be better solved in the database ... The number of Rails apps using Oracle as a backend are approaching 0%

      That would imply that all Rails developers are idiots. If Oracle is the only DB where the DB supports clustering properly and someone needs clustering, he should use Oracle or he should find another business to work in since you are an idiot. You select the correct tool for the job.

      Also, given that Oracle is, by a significant margin, the chosen database for critical enterprise stuff, if your 0% assertion is true, then Rails isn't used anywhere for important stuff.

      It isn't easy to convert a large software project, constantly in flux, to support clustering

      If clustering is supported by the DB, yes it is. That is why it belongs in the DB realm.

      Say you build a nice wiki app. Later you decide that would fit in well with your project manager. How much work would it take to get it to work? Normally. A lot.

      No, it would not. Not the way I develop apps. I develop in a way where what I do is re-usable. I don't see what Rails have to do with that.

      Convention over configuration is fine. I like it. But that's not the magic I'm talking about. ... All the automatic method generation (method missing), autoloading based on names, conversions from singular to plural. That's what I mean by magic.

      What surprises me is that you don't seem to understand that the two paragraphs quoted above are self-contradictory to a degree. The "magic" you don't like is either a core part of Rails (so you don't like Rails) or it is part of Convention over Configuration. Honestly, since it is documented, and well understood, I can't see why you think it is "magic".

      This problem happens to every developer in exactly the same way. To me, that is a prime candidate for moving the problem scope into the framework.

      No, this does not mean that it is a prime candidate for inclusion in Rails. It may mean that it is a prime candidate for some sort of library/extension/gem, but it doesn't belong in Rails at all. What you are advocating is polluting Rails with all kinds of absurd, and non-relevant junk. A huge number of people do MP3 work in their Rails apps, you wouldn't seriously suggest that we should include MP3 manipulation in a ORM framework, would you?

      Why solve the problem multiple times?

      You should absolutely not solve the problem many times, that would be absurd. It would be equally absurd to include it in the ORM framework.

      Sorry, the large number of people saying its hard to make Rails do what it's not designed specifically to do says otherwise.

      I disagree with that conclusion. The number of people who is says something has no bearing on how difficult or easy that thing is, it is only an indication of somethings popularity. A large number of people thinks Java is slow, even though it has speed parity with C++ in a number of areas. A large number of people were raised and trained on PHP and then moved to Rails. Someone who learned software development on PHP is most likely permanently damaged and beyond hope for ever being able to develop real software. Same goes for people who have developed a lot in Basic, visual or no.

      In this case, Rails has some ActiveCouch type plugins

      So you are fine then. Or?

    23. Re:Switch to django and python for starters by shirai · · Score: 1

      That would imply that all Rails developers are idiots. If Oracle is the only DB where the DB supports clustering properly and someone needs clustering, he should use Oracle or he should find another business to work in since you are an idiot. You select the correct tool for the job.

      Also, given that Oracle is, by a significant margin, the chosen database for critical enterprise stuff, if your 0% assertion is true, then Rails isn't used anywhere for important stuff.

      That's a false dichotomy. Many Rails developers are really smart but they won't use Oracle for other reasons. The major roadblock with Oracle is not that it's the wrong tool, it's that it is not free (neither as in beer nor speech).

      It isn't easy to convert a large software project, constantly in flux, to support clustering

      If clustering is supported by the DB, yes it is. That is why it belongs in the DB realm.

      I don't think we're disagreeing on this point. Your hypothesis is that if you have clustering in a db, then it is easy. I'm simply stating the fact that nobody uses dbs that support clustering with Ruby (MySQL supports clustering but it is an in-memory database). If clustering was well supported in open source databases, I'd agree with you. Also, it's not unheard of for ORMs to support clustering. Sequel, another Ruby ORM engine growing in popularity, has rudimentary support for clustering. I noticed that Rails 2 has implemented many ideas from Sequel already. I wouldn't be surprised, that ActiveRecord starts including some rudimentary support for sharding in the future as well.

      Say you build a nice wiki app. Later you decide that would fit in well with your project manager. How much work would it take to get it to work? Normally. A lot.

      No, it would not. Not the way I develop apps. I develop in a way where what I do is re-usable. I don't see what Rails have to do with that.

      That's good for you. But how many OTHER people would be able to incorporate your code into their app. What if they wanted your wiki to support clustering on their open source database? What if they store their uploaded files in S3 and your wiki stores them in MogileFS or just a mapped drive? What you are really building then is a set of best practices that works for you. As an experienced Rails developer, perhaps this is everything that you need; however, most everyone has different deployment needs. What I'm really advocating is that all the same problems that people encounter simply be standardized. This is just like how ActiveRecord standardized database access.

      It wasn't too long ago that in the Ruby world, you used a MySQL library, a PostgreSQL library, etc. Then your applications was locked into the database you developed for. ActiveRecord removes the ugliness associated with switching databases and it becomes about developing your app, not about DEPLOYING your app.

      Convention over configuration is fine. I like it. But that's not the magic I'm talking about. ...
      All the automatic method generation (method missing), autoloading based on names, conversions from singular to plural. That's what I mean by magic.

      What surprises me is that you don't seem to understand that the two paragraphs quoted above are self-contradictory to a degree. The "magic" you don't like is either a core part of Rails (so you don't like Rails) or it is part of Convention over Configuration. Honestly, since it is documented, and well understood, I can't see why you think it is "magic".

      Yeah, you're right, some of it is self-contradictory. Let me clarify better then. I don't like the magic that makes it hard to read the Rails code. You seem to not like the word magic. I'm not using it in an evil way. I think most Rails developers actually agree and know that there is a lot of magic in Rails. The problem is that there is

      --
      Sunny

      Be my Friend

    24. Re:Switch to django and python for starters by terjeber · · Score: 1

      That's a false dichotomy. Many Rails developers are really smart but they won't use Oracle for other reasons. The major roadblock with Oracle is not that it's the wrong tool, it's that it is not free (neither as in beer nor speech).

      How is it a false dichotomy? Oracle is, by a rather significant margin, the chosen database in the enterprise world. This is where the money is generated. If Rails is not used in conjunction with enterprise database solutions, Rails isn't used for important stuff. And no, Wikipedia is not "important".

      I'm simply stating the fact that nobody uses dbs that support clustering with Ruby

      Again, this is a rather odd statement. Where do you get this information from? Are you seriously saying that nobody is using Rails on Oracle?

      What I'm really advocating is that all the same problems that people encounter simply be standardized. This is just like how ActiveRecord standardized database access.

      And I am pointing out that you don't do that by adding rubbish and irrelevant junk to the core framework but by using, or writing, application specific extensions. Adding specific photo-album (essentially) extensions to a generic framework is absurd and the Rails developers should not pollute the framework like that but concentrate on the core. There are more than enough people out there writing extensions, and your requests belongs in such extensions, not in the core framework.

      When somebody tries to do something and he says it's hard, then it IS hard for that person.

      There are typically two reasons for things being hard. One is that it is hard for anyone to do it, in other words, it is intrinsically hard. The other is that it is hard for a group of the population a lack of the skills required to do said "thing". You can't blame the "thing" for the users lack of skills. People thinks programming in Python is hard too, doesn't mean there is anything wrong with Python.

      Please note - I am not saying you are such a person with a lack of skills, I am just pointing out that the fact that a lot of people find something to be hard has no bearing on whether it is in fact hard for an appropriately skilled person.

      Seriously. Check it out.

      I have and it is good stuff. Also, please note that I am not a Rails apologist, I am just addressing some areas where I disagree with you.

    25. Re:Switch to django and python for starters by youngdev · · Score: 0

      This is a red herring. Anyone who disqualifies candidates because they don't know a specific framework or even a specific language is missing the boat. It is much easier (and cheaper) to train a smart engineer to use your dev tools than it is to make a mediocre developer into a smart one. Choose your engineers based on breadth of experience and give them the opportunity to use that experience to give your product insights it would not have by hiring a clone of the guy who left. If an engineer does not want to learn a new toolkit, then they would have never been an asset anyways. Great engineers understand that this industry is always changing and we have to roll with the changes to keep up.

  2. Concentrate on the 5% by Samschnooks · · Score: 2, Insightful
    You see, the other 95% (Convention as you put it.) you're talking about can be done by anyone: that's one of the reasons frameworks exist. In other words, it can be shipped to the lowest cost country in the World.

    The customization is what is going to keep you employed. That's the specialization that keeps the customers from going overseas - even if you're Indian yourself. There's always someone willing to do it for less. No exceptions. So, develop those resources if you want to keep doing what you're doing.

    1. Re:Concentrate on the 5% by Anonymous Coward · · Score: 0

      No exceptions

      Well, except for those exceptions where you're the lowest bidder.

      ( i hear you though, the exceptions would tend towards a small percentage given the population size ).

    2. Re:Concentrate on the 5% by AmberBlackCat · · Score: 1

      So now we have one guy who says employees should use the obscure methods because it will keep the company more dependent on the employees while we have another guy who says managers should avoid the obscure parts because it makes them too dependent on the employees...

  3. Expand the toolkit by thethibs · · Score: 4, Insightful

    Would it be out of the question to assess the needs of the troublesome 5% (and perhaps the other 10% that were shoehorned into Rails) and add a framework that's more in line with those needs?

    Data exchange is sufficiently mature that interaction between applications in different environments is not an issue, so all you are left with is the added overhead of supporting two frameworks; not a bad thing if you consider the added flexibility of using the framework best suited to each application. Having options is usually a good thing.

    --
    I'm a Programmer. That's one level above Software Engineer and one level below Engineer.
    1. Re:Expand the toolkit by Bearhouse · · Score: 4, Insightful

      Mod up! If the only tool you have is a hammer, you end up treating everything like a nail.

      As the OP pointed point, all development environments sooner or later hit this wall. I've never found one, (and am pretty sure that one will never exist), that ticks all the boxes for a typical mixed environment (the GUIs, OLTP, distributed database management, web access, making the coffee...).

      In the 80s, I worked for a company that - as was fashionable at the time - developed its own '4GL' and decreed that everyone use it. In a satellite office, we tried, but found that in certain circumstances it just plain would not do what we needed. Guess what? We went back to 'hard coding' those key functions...

      Don't worry about it, (after all, same bits of windows, to name just one OS, are written in assembler to speed performance).

      So as the man says, expand your toolbox and your competencies - it'll make you a better project manager (to handle the interfaces) and programmer.

    2. Re:Expand the toolkit by truthsearch · · Score: 3, Insightful

      so all you are left with is the added overhead of supporting two frameworks

      And that's often much better than supporting one framework plus your own customizations. Once you customize it's often extremely difficult to upgrade the framework and have your patches still work. So there can be a lot of extra development time involved. Plus just the learning curve to get intimately familiar with the internals of the framework when that's often not necessary.

    3. Re:Expand the toolkit by Anonymous Coward · · Score: 0
      This is a typical example of why developers use profilers, to find that several lines of code that is the workhorse of the application. It is not uncommon to have a few critical functions. High level frameworks are perfectly good for everything else.

      Here is what I have done. First, and this is obvious to most developers, and most do it automatically, but it is good to check, make sure that the code itself follows a convention. Make sure there are no duplicates in functionality. Make sure that data is handled in a consistent manner with a consistent set of functions. Developers love to write their own functions for common task thinking that they do it better than anyone else. Unless each class of task uses the same function, and data is stored in only one place, there is no real way to know which tasks are consuming all the resources, and if those resources are being consumed legitimately, or just wasted.

      Second, use a profiler to determine what functions are using all the resources. This looks like where you are right now. I found it was not always necessary to leave the framework. Maybe there is another way to approach the problem that would not cause a bottleneck. Maybe it is a bug in the framework, or someone is using depreciated functions. I have seen where people have put in i/o commands in lopps that are critical to the performance of the functions, i/o commands that not only did not need to be in the loop, but not even in the function itself.

      If it looks like the framework is not going to work, refactor the functions to discover what is causing the issue. Sometimes you will find that many of the function all execute a common task. Sometimes not. At this point it may be necessary to leave the framework. Yu may be able to get away with just passing data to another process, like a data filter. In many cases, the issue a loop that is calling another function with a lot overhead. In this case the solution might be to pull the loop into another function that can execute with less overhead.

      The point is that in many cases some creative design can make things that run fast enough. In other cases, for instance data analysis, it is useful to drop the entire data set into a process that can efficiently handle such a task. In most cases, however, if the task is typical, and the boards are not all complaining about inefficiency, then there may be some fundamental error in the coding.

  4. It depends on the complexity by CoopersPale · · Score: 1

    It really depends on the complexity of the problems you're trying to solve.
    If you have complex business processes they won't be easily modelled by rails, or any other framework.
    So horses for courses, really. It's a judgement call, and depends on the specifics of your application.

  5. Hard to say, but... by SlashDotDotDot · · Score: 4, Informative

    Making this sort of decision really requires more technical details than you provided in the summary or the linked article.

    If you do choose to make custom modifications to Rails (or any other third party dependency in your system), make them very carefully. Keep notes about what you changed, and why. Comment the modified source code with a consistent, searchable tag, like

    // MYCOMPANY Begin custom changes
    // Optimized this block for queries where the
    // search string is only one word long, and
    // measured a 20% performance increase on the
    // production server under moderate load.
    // 3-Jan-2009
    ...
    // MYCOMPANY End custom changes

    Also, check the third party source into your own version control system so that you can track the changes explicitly.

    Since you are talking about making changes for performance reasons, be sure to follow good optimization practices. Measure first, optimize only the true bottlenecks. Measure under realistic scenarios. If optimizations are even slightly confusing or subtle, comment them thoroughly. Keep the original, unoptimized code, maybe just in comments next to the new code, or maybe in a separate "reference implementation" function so that you can fall back to a known reliable version.

    --
    /...
    1. Re:Hard to say, but... by Lserevi · · Score: 1

      I would add that you should try to hide the implementation of your customizations behind modules that can be easily adapted to use a standard extension if and when one becomes available.

    2. Re:Hard to say, but... by chachacha · · Score: 2, Interesting

      Keeping commented out code around is not only distracting to developers but harmful. Code in comments isn't syntax checked, isn't compiled, and isn't tested and therefor quickly begins to suffer from bit rot. It would be better to refactor the surrounding code to work with different plugin-able implementations and to fully support both the "old" and the "new and improved" implementation if the intent is to be able to reliably revert that part of the system to a different implementation.

      --
      I do like programming things that work super quickly, especially when they work super quickly, super quickly.
  6. No maintenance resources? by helixcode123 · · Score: 1

    The poster states they have resources for making the customizations but not for maintaining them. Why not just use the same resources that made the customizations for the maintenance?

    --

    In a band? Use WheresTheGig for free.

    1. Re:No maintenance resources? by Anonymous Coward · · Score: 0

      Outside of software companies, most management considers spending time maintaining a codebase only slightly less of a waste than spending the time required to write good code - which is seen either as an excuse for laziness or as perfectionism. Employers usually expect maintenance-free software working soon and all time spent on software to go towards new features; even the best software team managers can only wrangle so many concessions before they're silenced by the imaginary profits shouting in upper management's ears.

    2. Re:No maintenance resources? by quanticle · · Score: 1

      Well, perhaps a developer has time now to make the changes, but won't have time later to maintain them?

      --
      We all know what to do, but we don't know how to get re-elected once we have done it
  7. Extend sanely by Bantik · · Score: 2, Informative

    First off, I totally agree with Samschnooks that as a development team, that 5% is your responsibility, and what you're really getting paid for. But given your concerns about maintainability, and what I'm reading as your concern that custom code that you create may end up being addressed by the framework, I do have some advice.

    See what of your own code can be crafted into a plugin to extend the framework. Rails plugins are quite easy to create and insanely easy to use.

    Be diligent about abstracting the functionality that you need, keeping domain-specific business logic out of the plugin and in the application instead. You'll find that plugins are easy to write test cases for and will keep your custom logic very modular.

    If someone else ends up releasing a plugin that addresses your needs, you can simply swap it out; the same applies if the framework gets extended to include what you need.

    If maintenance is a real issue for you, release the plugin yourself as open source and recruit some assistance from the community. Chances are, you're not the only one in the world who needs the functionality.

    --
    Ruby on Rails resources and more at idolhands.com
  8. hmm by roland_mai · · Score: 1

    I don't quite see how using django solves your problems. If you want to use a particular vesion of rails and not upgrade, there's of course: rake rails:freeze:gems No updates means that your software will be out of date eventually. That's like saying, I have an ActiveX plugin that works only in IE7. What can I do to make it work with IE8 without doing anything?

  9. welcome to the real world by speedtux · · Score: 2, Insightful

    Lots of tools have the property that they make the first 95% or so of the solution really easy and the remaining 5% nearly impossible. On balance, you're worse off than if you had done the whole project in another tool.

    1. Re:welcome to the real world by b4dc0d3r · · Score: 1

      I remember using MFC, and finding very common problems had no MFC equivalent. I had to either call Win32 directly (which is fine for uncommon problems), or futz about updating poorly documented auto-generated code that I didn't understand well enough to be in there making changes. This is because MFC project team just couldn't predict what would be common, and it's the reason OP is having issues, and the reason I avoided toolkits until I couldn't any longer.*

      It's very important to be able to tell a product what you want/need, and with open source you get the opportunity to be very clear, in the form of submitting patches.

      *I usually drop a toolkit when I realize that a very common function requires several lines of code and an extra variable, such as "Does this directory name end in a terminator, or should I add one?" Especially if it's a platform-specific one that doesn't address the quirks of that platform.

    2. Re:welcome to the real world by Anonymous Coward · · Score: 0

      what i find most awesome about rails is that it makes the 95% easy but in fact doesn't stay in your way doing the last 5% yourself.

  10. Build vs. Buy by michaelmalak · · Score: 4, Interesting

    What you call "convention vs. customization" is really just a special case of "build vs. buy". You can research the standard factors that go into such a decision, but the most important one is whether the part you intend to build is both a) essential to the business and b) something that would give you a competitive advantage over buying.

  11. Depends on your perspective by cerberusss · · Score: 1

    What have your experiences been with this problem? Have you found any best practices to avoid digging custom holes you can't climb out of?

    What's your perspective here?

    • Financial
    • Manpower
    • Engineering

    If you're looking at this from the financial point of view, I'd say that you now have enough experience to plan carefully. Also, the customer should know about and pay for maintenance.

    From the manpower point of view, you might need more junior developers who can start with maintenance issues.

    If you're just looking for engineering elegance, I'd say that's solved in the maintenance (tail) of the project as well. Be sure to have a senior developer keep track of the big picture in the maintenance phase.

    --
    8 of 13 people found this answer helpful. Did you?
  12. I agree with the above poster. by Jane+Q.+Public · · Score: 4, Interesting

    I work on a major website, all done in Ruby/Rails. We, in contrast, have found that the tremendous ability to customize the framework is liberating, rather than constrictive.

    Without knowing much more detail about your problem, it is difficult to give advice. Having created large, complex websites, and maintained them for long periods of time, we have yet to run into intractible problems as a result of the language or framework themselves. The fact that there are many large, complex Ruby on Rails websites being created and maintained by Fortune 500 companies also contradicts the idea that Ruby and Rails have serious, show-stopping shortcomings.

    I strongly suspect that part of the problem is that you do not know your platform (in particular, Ruby) as well as you perhaps could. Ruby is very extensible via Gems that are freely available or that you can write yourself, or even just code modules. Rails is similarly, wonderfully extensible via plugins. Plugins are also freely available for just about every situation you can imagine, or again you can write your own.

    Ruby is one of the most flexible languages in existence. Rails is hardly perfect, but any shortcomings are easy to code around by adding your own extensions. But expecting any framework to be complete for your purposes, before you begin, is pretty much wishful thinking.

    Once again, I do not know enough about your situation. But if you expect any framework to be "plug and play" for very complex tasks, like an erector set, you will be disappointed. There is no substitute for knowledge of your platform, and programming ability.

    1. Re:I agree with the above poster. by Anonymous Coward · · Score: 1, Insightful

      Having created large, complex websites, and maintained them for long periods of time, we have yet to run into intractible problems as a result of the language or framework themselves.

      I guess that means that you by "large and complex" mean that the codebase is large and the functionality is complex. Sites that are large in terms of actual traffic often run in to limitations caused by the framework(s).

      Don't trust a framework until you've tested it under real load. The fact that some company uses a framework is not a guarantee that that it will work for you, or even that it works all that well for them.

  13. Manage change, three ways by davecb · · Score: 1

    The general answer is to manage the change you suffer, so as to keep it from getting ahead of you.

    You can do this several ways, but the best requires you be the creator of the interfaces that are to change. If you are, you can make it easy for your customers (and your own team) to change asynchronously, basically by version-numbering your interfaces. Paul Stachour has a good talk on this at multicians.org.

    A primitive form of this is freezing your interfaces: once they're in the Application Binary Interface (ABI), don't change then until the hardware changes so much that everyone has to recompile (e.g., when switching to 64-bit). This is heavily used in operating systems, but not in the world of programming languages.

    Finally, if you're the consumer of someone else's changes, steal a technique from the porting/migration community and automate your changes when your supplier forces you into them. One tools, aimed at Vim/Emacs users is "port", described at Strength-Reducing the Task of Porting. It only takes about 10 minutes to create a change-database entry and optionally a sed script, so you can make a controlled change of all your sources to match a vendor's newest brainstorm.

    --dave

    --
    davecb@spamcop.net
  14. Just start replacing stuff by level4 · · Score: 2, Informative

    My company started writing a big app in Rails. We hit limitations (for us) fairly quickly so just started replacing the bits we wanted to work differently. The great thing about Ruby is you can just switch stuff in and out. The great thing about Rails is that it's well-designed enough that you can do that fairly easily.

    Sessions, for example. We wanted to share sessions between sites, so just stopped using the Rails one and started using ours. We just put a new session class system in a gem, require it, and talk to that instead of the built-in. Works brilliantly and with a little finesse you can make it totally transparent.

    I think the key is to think of Rails as a framework - as in, a literal scaffolding that you place things in. The basic structure is sound enough and very useful. It's filled with some useful default code, but if that doesn't meet your needs, feel free to start replacing it wih things that do.

    --
    Let my new 7-digit UID be a lesson to all - write down your passwords.
  15. Write Tests, Open Source, & use Rack by remitaylor · · Score: 2, Interesting

    [test!]

    A good test suite == "best practice to avoid digging custom holes you can't climb out of"

    I work at a Rails shop too and, when I/we need to do something highly custom, we create it as a gem (or a Rails plugin) and post it somewhere incase someone else finds it useful. None of the plugins/gems I've released have required any maintenance to speak of, unless I've wanted to add additional features.

    Be sure to write tests for your customizations (gem/plugin)! This will make it really easy to discover if your plugin no longer works for the next version of Rails/ActiveRecord/whatever it is you're extending.

    [open source!]

    If your changes might help other developers (they're not very, very specific to your product), open source them as a gem and let people know how to use it.

    Not only can others benefit from your changes, but they can commit back too! Put the gem up on github[1], as it's the current de facto standard home for such things.

    [rack it up!]

    If you really need crazy performance out of Rails, look into using Rack[2]. Rails 2.3 (currently Rails Edge, will be released this month) *finally* uses Rack. Something like Rails Metal[3] makes it easy to return directly from Rack, letting you *highly* optimize certain requests. This is like rewriting some of your Ruby as C extensions to speed it up - Rack is really easy to use.

    Good luck!

    [1]: http://github.com/
    [2]: http://rack.rubyforge.org/
    [3]: http://weblog.rubyonrails.org/2008/12/17/introducing-rails-metal

  16. JRuby by BrainInAJar · · Score: 3, Informative

    Why not deploy your app on JRuby, and if there are still performance bottlenecks, write those parts in real Java ?

    1. Re:JRuby by Anonymous Coward · · Score: 0

      LOL at "optimizing" by writing stuff at the "bare metal" Java layer. You kids make me laugh.

    2. Re:JRuby by Anonymous Coward · · Score: 0

      I don't think anyone suggested that it's as fast as bare metal, just better suited to the task than bare metal, and relatively quick none the less.

    3. Re:JRuby by dkf · · Score: 1

      Why not deploy your app on JRuby, and if there are still performance bottlenecks, write those parts in real Java ?

      Apart from whether to use Java or not, this post exposes a really good point: if you've got performance problems, you're often best off rewriting part of your app in a lower-level language. Keep the rewritten part small though, since it's usually easier to work in a higher-level language. And always measure whether you're addressing a real bottleneck and making it better...

      (The identities of the higher/lower-level language aren't so important as the principle of splitting.)

      --
      "Little does he know, but there is no 'I' in 'Idiot'!"
    4. Re:JRuby by Anonymous Coward · · Score: 0

      the recommendation for JRuby in particular is because it's faster than the ruby VM, but more importantly it can call native (java, though JNI can act as a roundabout way to make it even faster) methods

    5. Re:JRuby by Anonymous Coward · · Score: 0

      Or they could just use Ruby and C.

    6. Re:JRuby by Anonymous Coward · · Score: 0

      Great idea! Why don't we all go back to using compiled .cgi, it's slightly faster than Java!

  17. Contribute by RAMMS+EIN · · Score: 2, Interesting

    ``Our biggest worry isn't necessarily that we don't know how to customize, but rather that we won't have the resources to maintain customized code going forward; it's quite simple to update Rails as it matures versus the alternative.''

    As Alan Kay said, the best way to predict the future is to invent it. If you are worried about your useful code being broken by a future version of Rails, contribute it to Rails so that that future version will include it. Or, if you can't get it into the framework, make it available as a separate plugin.

    Assuming that it's ok to share the code and that the code is useful outside your project, this will allow open source to work for you and ease your maintenance burden. If it's not ok to share the code or it isn't useful outside your project, then it's part of the project and the project will have to carry the cost.

    --
    Please correct me if I got my facts wrong.
  18. I wouldn't by r · · Score: 1

    Maintaining custom patches for a foreign codebase is going to be painful, proportionally to the number of patches, and how badly spread out they are through the codebase.

    Consider this: every time the Rails team changes things, you'll have to go through your patches and make sure they still apply correctly. And if, heavens forbid, they do some major refactoring, you'll have to spend the time figuring out what functionality got moved where, and re-apply the patches as necessary.

    My project was maintaining a custom set of patches for a major open source library for a while, and it was fairly labor-intensive: every time the library provider released a new version, a senior engineer spent a good part of a day going through the codebase and repatching it, testing the new version, etc. The problem was, however, that they released new versions frequently, and we needed them as soon as they were released.

    If your patches aren't going to migrate upstream, I'd be very wary of spending a lot of time maintaining them as the core library keeps evolving. Try to measure how much time it would take to update your local patched Rails when they release a new version (especially a major one, if you can), and project future work estimates from that.

    For us, we ended up sacrificing functionality for development speed, and we switched to a less capable library that worked right out of the box without endless patching.

    --

    My other car is a cons.

    1. Re:I wouldn't by quanticle · · Score: 1

      Consider this: every time the Rails team changes things, you'll have to go through your patches and make sure they still apply correctly.

      If that's a major chore for you, may I suggest investing in a test suite, so that you don't have to go through manually and test all your patches?

      The problem was, however, that they released new versions frequently, and we needed them as soon as they were released.

      What sort of features were they adding that made it necessary for you to upgrade so frequently? Might it have been possible for your team to not upgrade to the latest version every time?

      --
      We all know what to do, but we don't know how to get re-elected once we have done it
    2. Re:I wouldn't by r · · Score: 1

      If that's a major chore for you, may I suggest investing in a test suite, so that you don't have to go through manually and test all your patches?

      Yes, that would help with testing, but also multiplies the work: now you have patches and the new test suite to maintain and shepherd through upgrades. :)

      Testing patches actually wasn't the main obstacle. The far bigger time sink was when some patched piece of functionality moved over to a different location in the codebase. Then the engineer had to go and become familiar with their changes, find how things got rearranged, and adopt the patch to the new code. That's a lot of unnecessary work just to maintain the status quo.

      As for whether we needed to upgrade so frequently - yeah, we actually did. Hopefully the OP doesn't, though. :)

      --

      My other car is a cons.

    3. Re:I wouldn't by SanityInAnarchy · · Score: 1

      Consider this: every time the Rails team changes things, you'll have to go through your patches and make sure they still apply correctly. And if, heavens forbid, they do some major refactoring, you'll have to spend the time figuring out what functionality got moved where, and re-apply the patches as necessary.

      So write plugins, instead of monkeypatching.

      Better yet, use a framework like Merb, which has a well-specified Plugin API. Stick with that, and your plugin will work for at least the rest of Merb 1.x. If there's something you can't do with only the plugin API, that is considered a bug.

      Merb 2.0 will also be Rails 3.0, so alternatively, wait until then -- Rails will then have a plugin API also.

      --
      Don't thank God, thank a doctor!
    4. Re:I wouldn't by terjeber · · Score: 1

      Maintaining custom patches for a foreign codebase is going to be painful

      Well, the thing is, in Ruby it is not. Given the tools that Ruby gives, such as mixins, modifying the core of a framework in a maintainable manner is a lot easier. Now, if you go out and fix the framework in a non-Ruby manner, for example by altering the framework source in-place, you will have problems, but if you do, you need to re-take Ruby 101.

  19. Open Source by burnin1965 · · Score: 1

    Our biggest worry isn't necessarily that we don't know how to customize, but rather that we won't have the resources to maintain customized code going forward; it's quite simple to update Rails as it matures versus the alternative.

    Since you are benefiting from the open source nature of ruby on rails shouldn't you simply provide your customizations back to the ruby on rails project so they can be maintained as part of the the framework or start an open source project separate from ruby on rails where the community can assist in maintaining it?

    1. Re:Open Source by quanticle · · Score: 1

      It depends on the nature of the customization. If the customization is fairly domain specific, then neither of the above two scenarios work, since there may not be enough interested people within the community to take on the burden of supporting the project.

      --
      We all know what to do, but we don't know how to get re-elected once we have done it
    2. Re:Open Source by Bill,+Shooter+of+Bul · · Score: 1
      I've tried doing similar things. Possible outcomes:
      1. Project accepts your code. (all is right with the world)
      2. Project rejects your code, because they have a different plan for solving the problem ( 2 major releases away!)
      3. Project denies that the problem exists

      I've experienced all three. The second two, are far more likely than the first.

      --
      Well.. maybe. Or Maybe not. But Definitely not sort of.
  20. there is no such thing as non conventional web app by gert+cuykens · · Score: 1

    As the evolution of browsers is going right now you should not need a framework anymore. Just a good js/as3 custom team and a rails/python server team. My example http://code.google.com/p/appwsgi/source/browse/trunk

  21. NO, by Jane+Q.+Public · · Score: 1

    the site is large, in size AND traffic, and it has many complex functions.

    We DO use it under real load, and we have no problems that have been directly traceable to either our chosen language or web framework!

    On the contrary: most of our serious problems have been traceable to problems with our commercial host, EngineYard.

    1. Re:NO, by Anonymous Coward · · Score: 0

      Approximate requests per seconds and response time during peak load?

  22. Turn customization into profit..... by goffster · · Score: 1

    When you know the true cost of customization, then charge what it is worth + x%. Allow the true cost to fund the resources necessary to keep it in order.

  23. I feel compelled to add by Jane+Q.+Public · · Score: 3, Insightful

    that the other serious problems we have had have been programming bugs; but those bugs were due to our own coding or design lapses, not framework limitations.

    Most people who speak of "limitations" to their framework are people who expect the framework to do all their work for them: this is simply unrealistic. If that were how it worked, it would not be called a "framework", but rather a "product".

    1. Re:I feel compelled to add by smoker2 · · Score: 1, Insightful

      Most people who speak of "limitations" to their framework are people who expect the framework to do all their work for them: this is simply unrealistic. If that were how it worked, it would not be called a "framework", but rather a "product".

      I like that.
      Equally, most people who dismiss Linux because of its perceived lack of something or other, are people who expect the computer to do their thinking for them (or at least restrict them to safe choices). If that's what operating systems were about, then we would all be using appliances.

    2. Re:I feel compelled to add by terjeber · · Score: 1

      Most people who speak of "limitations" to their framework are people who expect the framework to do all their work for them: this is simply unrealistic.

      Amen. Like the poster above who wants rails to include, in its core functionality, the ability to store images, automatically retrieve the image and a thumbnail of said image depending on the situation. This isn't stuff that belongs in an application server framework, but it does belong in an image manipulation framework and a DB driver (re-sizing images in one, storing stuff in the other).

      I find that a lot of people who ask for special functions like this are just simply bad developers. Often self-taught through some horrible abomination like Visual Basic and/or PHP. Obviously not always :-)

    3. Re:I feel compelled to add by Jane+Q.+Public · · Score: 1

      There are free plugins that do this (using RMagick), which is exactly as it should be! Not even any need to re-invent the wheel. :o)

      However, we use filesystem storage for media, finding direct DB storage to be somewhat problematic.

  24. Re:going forward? by Anonymous Coward · · Score: 0

    He never called anyone "stupid". He merely stated that the saying "sounds stupid". There's a difference between being stupid and doing something stupid.

  25. Reality check by The+Clockwork+Troll · · Score: 1

    If the framework is good,
    And your team is good,
    And they have thought hard about how to express their design problem in terms of the framework, and found it wanting,

    Then perhaps it is not The Best Framework for your team.

    If that seems like an oversimplification, consider it another way:

    What is your product, and how many resources do you have?

    How much time you do you want to be spending tweaking frameworks?

    --

    There are no karma whores, only moderation johns
  26. Language is not the answer by woboyle · · Score: 1

    After 25 years in the architecture and development of application frameworks and transaction processing systems (used by major manufacturers world-wide) I have come to the conclusion that selection of a language is not the answer to software (and framework) entropy. Over the past several (10) years, I have been exploring MDA (Model Driven Development) as a possible solution to this problem, with some positive results. Long term, I see that robust modeling tools with advanced code generation capabilities as a much more robust means of dealing with environmental and process changes. Unfortunately, current tools are just becoming useful in this regard. My current preferred tool set is Sparx Enterprise Architect, but it is still too difficult to generate a domain-specific framework model that can reflect an adaptive approach to the problem.

    --
    Sometimes, real fast is almost as good as real-time.
    1. Re:Language is not the answer by msuarezalvarez · · Score: 1

      You surely managed to make it sound important... ;-)

    2. Re:Language is not the answer by quanticle · · Score: 3, Informative

      I still remain skeptical about the benefits of model-driven-development. I recall that, at the latter end of the 1980s, developers were promised much the same thing with the push toward CASE tools. Of course, developers and managers quickly learned that such tools were only of use in a certain limited number of scenarios, and that attempting to use those tools outside of the scenarios for which they had been designed quickly led to the same problems.

      Frankly, I'm not sure that "software entropy" is solvable by any sort of tool or language. Rather, it is solved by training developers to write tests, and enforcing certain minimum style standards on the code, so that any developer can look at any portion of the codebase without feeling too unfamiliar with it.

      --
      We all know what to do, but we don't know how to get re-elected once we have done it
  27. best Practice #1 by QuietLagoon · · Score: 0, Troll
    Have you found any best practices to avoid digging custom holes you can't climb out of?"

    .
    Best Practice #1 - don't use Ruby on Rails. It is a dead end.

  28. modparentup by Anonymous Coward · · Score: 0

    ergo

  29. JEE tech is too complex and fragile by presidenteloco · · Score: 3, Interesting

    We are well into a project that has JBoss SEAM as its basis, but required significant mods to give us multi-database capability and a FLEX front end. So instead of a community maintained opinionated meta-framework, we now have our own super complex, fragile framework cluster(****).

    It is also effectively a dense, opaque yarnball. The stack traces of exceptions are so long, due to the interceptor architecture, that the Java stack trace displaying algorithm gives up and prints ...

    So my advice would be, at the risk of trolling, but I intend it as a serious debate position, don't start with something as excessively complex as JEE technology.

    Because JEE technology is barely manageable, maybe, if you stick EXACTLY to the most popular opinionated meta-framework for it, but if you deviate off the straight and narrow path, you are on your own in a dense jungle with a dull machete.

    --

    Where are we going and why are we in a handbasket?
  30. Agreed by Jane+Q.+Public · · Score: 1

    One has to take the name "framework" literally... it provides a foundation, YOU provide the structure. Expecting your framework to be a complete solution in itself is like expecting a building foundation to be a complete home: you will be disappointed. And you will have nobody to blame.

  31. That's rich! by Jane+Q.+Public · · Score: 0

    Haha. This is the first time in a long time I have seen anyone seriously suggest using Java for better performance...

    1. Re:That's rich! by BrainInAJar · · Score: 1

      For web stuff it's not bad.
      Memory hungry, but faster than any of the other web frameworks/languages by a long shot

    2. Re:That's rich! by Per+Bothner · · Score: 3, Informative

      Java is quite fast, thank you.

    3. Re:That's rich! by Tchaik · · Score: 1

      He's suggesting using the Java virtual machine, not programming in Java. Ruby's current implementation is notoriously slow, although this is resolved with the latest version of ruby (with the production version just around the corner)

    4. Re:That's rich! by Anonymous Coward · · Score: 0

      I think the suggestion was to use the java virtual machine to run the ruby app (with jruby), and then re-write the slow parts in java instead of ruby, calling the procedure from ruby (the rest of the app).

    5. Re:That's rich! by zuperduperman · · Score: 1

      This is the first time in a long time I have seen anyone dumb enough and ignorant enough to trot out that old line.

      Java blows ruby out of the water on the server side any way you like to measure it. In fact, for a lot of uses it competes pretty well with C / C++.

    6. Re:That's rich! by Anonymous Coward · · Score: 0

      Haha. This is the first time in a long time I have seen anyone seriously suggest using Java for better performance...

      Well, haha back at you. The late 90s are over, and any Java VM worth its salt uses JIT compilation that puts its performance within striking distance of pretty much any other language or platform; pure Java tends to be a lot faster than pure Ruby, so I don't know why you would be surprised at the suggestion that bottlenecks could be reasonably rewritten in Java. The performance benefit from that type of thing is probably more than you would get by rewriting Java bottlenecks in C, so it seems perfectly reasonable to me.

      Why do you think most new languages are being designed to run on the JVM? Here's a hint: it's not because Java is so great, it's because the JIT compilers that it uses these days are better than the JITs for any other environment around. Sun may suck a big one, but at least they got one thing right, and that's server-side execution speed.

    7. Re:That's rich! by Jane+Q.+Public · · Score: 1

      I am aware that Java is generally faster than Ruby. But it ISN'T fast. It is anything but.

      The only reason it is even acceptable in a lot of situations today is because the hardware has gotten so much faster.

    8. Re:That's rich! by Anonymous Coward · · Score: 0

      Haha. This is the first time in a long time I have seen anyone seriously suggest using Java for better performance...

      Ruby is so slow, I've seen it shot down for several projects as a non-starter. It's not only slower than Java, it's slower than Perl!

      Ruby is so slow that it makes Java look completely acceptable.

    9. Re:That's rich! by swilver · · Score: 1

      It's generally the fastest garbage collected language there is that allows easy refactoring and creating highly maintainable code. If you consider Java slow, than you must be programming in C/C++ which is not very well suited for the tasks the OP requires. A great many people seem to conclude that just because they've seen a few poorly performing Java applications (usually old apps with a user interface) that the language itself is slow, however the only conclusion you can draw from that is that those specific applications are slow and perhaps poorly written. The latter is quite often the case as a language with a fairly low barrier to entry attracts developers of all skill levels.

      In general though, performance (and also memory consumption) is pretty much irrelevant as long as it outperforms whatever back-end your program is using (ie, the database/harddisk/network/user almost always remains the bottleneck), allowing you to focus on maintainable code. Once in a while though you get to write some clever algorithm in Java that actually is CPU bound, and the performance has never disappointed me.

    10. Re:That's rich! by Jane+Q.+Public · · Score: 1

      "It's generally the fastest garbage collected language there is that allows easy refactoring and creating highly maintainable code."

      True, but that is not saying much. As I stated before, it may be the fastest in its class, but it still ain't fast.

      "If you consider Java slow, than you must be programming in C/C++"

      No, my language of choice is Ruby, which is generally slower than Java. But again... that doesn't make Java fast.

    11. Re:That's rich! by JavaRob · · Score: 2, Interesting

      As I stated before, it may be the fastest in its class, but it still ain't fast.

      What do you use when you need something better performing than Ruby? You aren't going to say "hand-tuned assembly language", are you?

      I've been using Java for a long time (this may be obvious from my userid & screen name), though it's not the only language I use nowadays.

      Startup is slow (though finally they have addressed this for client apps in a recent release, and it's irrelevant for stable server apps); memory consumption is still not optimal (this hasn't seen massive improvements), but performance is excellent nowadays, assuming your code isn't crap (or using some library that's doing a billion extra things at each call).

      The stats that show up in various performance shootouts, which place it just a tad behind straight C/C++ and miles ahead of languages like PHP, Perl, Ruby, Python, etc., match up with my experiences pretty well ...though of course actual webapp hotspots are usually in data access or remote communication -- and have nothing to do with the development language.

      There are also now more situations where the hotspot compiler can result in *faster* execution than C/C++ because it operates using live runtime performance data, which is obviously unavailable to a static compiler.

      Do you have any specifics to point to, or are you just talking?

    12. Re:That's rich! by terjeber · · Score: 1

      No, my language of choice is Ruby, which is generally slower than Java. But again... that doesn't make Java fast.

      Speed is a relative thing in the computer world. Java today can in many cases compete with C++ in speed, and it immensely more maintainable with fewer resulting problems. So, yes, I would in fact say that Java is fast. Not compared to hand-written assembly that solves a limited problem, but in the league it plays, one that partly includes C++, Java is fast.

      Have you written any Java code that wasn't fast? Perhaps it was you :-)

    13. Re:That's rich! by Jane+Q.+Public · · Score: 1

      I have already made my single point, several times. It is a complete mystery to me why others want to elaborate upon it.

    14. Re:That's rich! by Jane+Q.+Public · · Score: 1

      I am aware that Java 5 (aka 1.5.x) made some major speed improvements, but this is the first I have heard anybody claim that it "competes" with C++. Obviously it is faster than the more dynamic languages like Python or Ruby. I never claimed otherwise. So what is your point here?

      "Have you written any Java code that wasn't fast? Perhaps it was you :-)"

      I am not aware of having stated anything that warranted insults.

    15. Re:That's rich! by terjeber · · Score: 1

      am aware that Java 5 (aka 1.5.x) made some major speed improvements, but this is the first I have heard anybody claim that it "competes" with C++.

      Well, I am glad that you say "first I have heard" since that explains it. You simply haven't been around that much to hear. Perhaps you do not work in the right industry. Perhaps you haven't been keeping up with Java at all. For one, Java is at 6, and it has been competitive for quite some time. As the benchmark here shows, java is very competitive with C++. This is for CPU intensive benchmarks. Once you add disk and database access into the mix, as you do in most applications, the speed difference between Java and C++ applications becomes negligible.

      I think your opinion is highly colored by your prolonged lack of information about Java and benchmarks since Java performance parity with C++ for a large number of tasks was widely reported at least five or six years ago. Particularly the IBM Java VM gained a rep for being very fast, with subsequent inclusion of similar features in the Sun VM. You can read about it for example here.

      Remember, a Java application can do something no (or most) C++ applications can not do, namely run-time performance tuning.

      For a number of tasks C++ will probably always be faster than Java, but those tasks are fewer and further between every day, and for the tasks that so many people work on today, namely creating good web-based stuff, Java is probably the fastest language there is since C++ is not a widely used web-app development language.

      So, given context, namely web-based applications, it is perfectly fine to use "high performance" about a Java solution since it is the best performer of them all. There are very few web-apps written in C++.

    16. Re:That's rich! by Anonymous Coward · · Score: 0

      Question was JRuby.
      JRuby is almost last on that list.

      Now, ensure that you also score memory performance.

      And jruby is now last.
      Java is now second half of the list.

      (many benchmarks are short, and not memory intensive. Languages with garbage collection skip all the 'free' / 'delete' calls, and just keep on allocating. This causes them to look favouribly in most benchmarks. Always check memory used, not just time finished.)

    17. Re:That's rich! by Per+Bothner · · Score: 1
      Question was JRuby.

      Right, but the suggestion was of using JRuby for the Ruby implementation (including Rails), and using "real Java" for the performance bottlenecks. I responded to a comment making fun of that idea.

      Now, ensure that you also score memory performance.

      "Memory performance" is not a goal in itself - it only matters to the extent that it affects speed (though GC, cache misses, and so on). (And of course if you don't have enough memory to run your application at all or without paging, but that's seldom a problem these days.)

      Note I'm not saying that memory usage is unimportant - today calculation is free and accessing non-cache memory is expensive. But nobody cares about memory usage except to the extent that it affects speed.

      As you point out, these are short artificial benchmarks, so they may not tell us much about real-world performance. My point remains: Don't dismiss the performance of Java. A lot of smart people have worked hard on making Java run fast, and that is one reason it is widely used in "the enterprise".

    18. Re:That's rich! by Jane+Q.+Public · · Score: 1

      "I think your opinion is highly colored by your prolonged lack of information about Java and benchmarks since Java performance parity with C++ for a large number of tasks was widely reported at least five or six years ago. Particularly the IBM Java VM gained a rep for being very fast, with subsequent inclusion of similar features in the Sun VM. You can read about it for example here."

      Not at all. I think your own opinion is colored with simple exaggeration.

      My "prolonged lack of information" has been all of one version: 5 to 6 (and actually one minor version, since technically this is really the difference between 1.5 and 1.6).

      However, I do admit that I have not been very much exposed to Java for a little time; once I became familiar with Ruby, I dumped Java like a hot potato. Certainly Java has its place, and its advantages. But going back to Java after working in a dynamic language feels a lot like being in prison. I do not mean to exaggerate myself; I am only trying to convey that in comparison, the language is very restrictive.

    19. Re:That's rich! by terjeber · · Score: 1

      I have long since moved to Ruby my self, and I did not at all comment about Java as a language. My comment was only directed at your rather misinformed "That's rich" statement about Java performance since that exposed a substantial gap in your knowledge.

    20. Re:That's rich! by JavaRob · · Score: 1

      We're trying to figure out what your point *is*, and if it makes any sense at all.
      You started with:

      Haha. This is the first time in a long time I have seen anyone seriously suggest using Java for better performance...

      But then you agree that:

      Obviously it is faster than the more dynamic languages like Python or Ruby. I never claimed otherwise.

      Er... if it's faster than Python or Ruby, why is it so funny to use it for better performance?

      There's also a lot of evidence that Java's performance in general is quite close to that of C/C++, but many tens of times faster than Python/Ruby/etc.. ...so, it seems pretty reasonable to use Java for a performance improvement. I've done it before a number of times -- my last large project involved reimplementing a large PHP-based site in Java, adding new features and vastly increasing performance (and reducing hardware requirements).

      That's why people keep asking to you to elaborate -- you aren't even bothering to provide *anecdotal* evidence to back up your point.

    21. Re:That's rich! by Jane+Q.+Public · · Score: 1

      I made a very simple statement (and one that happens to be true): "This is the first time in a long time I have seen anyone seriously suggest using Java for better performance..."

      Why has everybody been trying to read more into that than there is?

      I happen to program almost daily in Ruby, which tends to be slower than Java... and if I heard someone say that about Ruby I would laugh even harder.

      Where is the contradiction in this?

    22. Re: That's rich! by JavaRob · · Score: 1

      Ah, now that's rich! You say you "program" in Ruby, but I can't think of the last time I heard anyone seriously suggest that you were even a competent programmer.

      Oh, wait -- the "factual" nature of that statement doesn't mean it's not misleading, full of crap and worth calling out. I simply don't know anything about you.

      Maybe you're just trolling, at this point; whatever.

    23. Re: That's rich! by Jane+Q.+Public · · Score: 1

      If you are just going to come in here and spout insults over something you ASSUME I meant but did not even write, then you really aren't contributing anything. In fact, isn't THAT pretty much the definition of troll or flamebait?

    24. Re:That's rich! by Nevyn · · Score: 1

      As the benchmark here shows, java is very competitive with C++.

      Sure, until you add the memory used back in ... and then it falls to mid way between C and Python. Of course you then add in "size of code" (read: programmer time) and it's about par with Python ... and it's much easier to hook C code into python for the bits that need to be fast.

      And the new "shootout" specifically asks for the "simplest" versions in each language, so I'd say it significantly underreports C/C++ code's speed compared to other things (I see a lot of "in the wild" C code that does really weird stuff so it can, supposedly, get a tiny speed/mem imporovement).

      But, sure, feel free to take note of only the bits of info. that makes your point look credible and be shocked that everyone doesn't automatically agree.

      --
      ustr: Managed string API with ave. 44% overhead over strdup(), for 0-20B
    25. Re:That's rich! by terjeber · · Score: 1

      Sure, until you add the memory used back in

      Not quite sure what you mean by this. GC or the fact that C++ uses less memory than Java.

      I see a lot of "in the wild" C code that does really weird stuff so it can, supposedly, get a tiny speed/mem imporovement

      Yes, one does. I have even written some since I was doing embedded work once and every byte counted and every cycle counted. This is called optimization and we do it using various types of tools. For Java there is not as much reason to create "weird" code to make it go a little faster since the VM can perform that kind of optimizations. In Java you can, given the ease of development over C/C++, spend time making algorithmic optimizations, which usually have significantly higher impact on performance.

      about par with Python

      Never got comfortable with the notion of having white-space be relevant when I develop software, so Python never did it for me. I'm a Ruby kind of person. My point was not which language was faster, just the notion that Java was under performing for the tasks here mentioned. Something that is plainly wrong. I know this from both benchmarks and practice with Java and web applications.

    26. Re: That's rich! by JavaRob · · Score: 1

      Okay, last shot, then I give up.

      Read the first statement I made in the GP post. It's factually true (I haven't HEARD that you're competent), but very misleading, because there's no reason I *would* hear anything positive or negative about your programming.

      I was making a point, which I explained in the second paragraph.

      Your original "That's rich!" comment was mocking someone for suggesting Java to speed up a RoR app, but apparently you have no basis to mock them; you simply haven't heard that suggested before, so while your statement was true -- you technically hadn't heard it seriously suggested -- it was highly misleading, because you simply aren't in much contact with Java, so you don't know how well it performs, or if sections of pure Java would be a good solution to Rails performance problems.

    27. Re:That's rich! by Nevyn · · Score: 1

      Sure, until you add the memory used back in

      Not quite sure what you mean by this. GC or the fact that C++ uses less memory than Java.

      In the link you gave to the new shootout, it has three "comparison type" boxes: 1) CPU. 2) MEM. 3) LOC. Java does well if you just turn on the first box, I explained what happened as you turned the other two boxes on.

      And, unlike the other poster, I'm not implying that Java isn't "fast enough" just that "faster than C or C++" is misleading at best.

      This is called optimization and we do it using various types of tools.

      This isn't quite the same thing, for instance I've seen code that refused a real string type in C (for "performance"/"memory") and thus. strcmp() was at the top of it's "cumlative time in functions" list in certain paths. I've also seen code which had all it's used memory as a mmap() of a single file (basically a custom DB) with all it's data being pointers into that memory, which made it pretty unmaintainable -- but argubly the speed/memory saving was worth it.

      One of the joys of C is that programmers using it tend to make those kinds of choices more often than their counterparts using Java or Python. But it does cast somewhat of a shadow on the shootout as a reference point between the performance of Java and C (as they don't accept solutions in that style).

      --
      ustr: Managed string API with ave. 44% overhead over strdup(), for 0-20B
    28. Re: That's rich! by Jane+Q.+Public · · Score: 1

      Okay. I concede your point. The difference of course is that you made the insinuation deliberately, and I did not. But as I say, I get the point.

      There was no actual mockery intended, just a simple comment.

    29. Re:That's rich! by HAWAT.THUFIR · · Score: 1

      I am aware that Java is generally faster than Ruby. But it ISN'T fast. It is anything but. The only reason it is even acceptable in a lot of situations today is because the hardware has gotten so much faster.

      Err, that's the *point* of Java. It's predicated on hardware getting better and better. If hardware didn't improve there'd be no point in Java for the long term.

  32. Going... by eigenstates · · Score: 1

    First, PLEASE no more going forward. It's silly and makes any words after sound like... I don't know. I just tune out after I hear that. It's filler. Where else would one be going in that sentence? Are we in fact going anywhere?

    Second, trying to answer your question-

    1. Don't write custom code. Find some other more generic way to do it or someone that already has. Blame them when it breaks with any framework upgrade- see the horrors of Drupal upgrades.

    2. Write it and write it well with documentation. I just re-read some notes on programming philosophy that I always repeat in mantra- program to the interface (or abstraction). Write it portable so the maintenance is actually in the implementation as opposed to the library. As one poster suggested- submit your lib to the repository for other to perfect and use- especially with Rails which is built on submissions like this.

    3. Write it in Logo. This ensures job security if it is used. More likely they will shout and throw little turtle icons at you.

    Personally, I am still in the camp of writing more internally than using libraries outside the framework core. It keeps the app unique and just buggy enough to have a job to come back to :) There are other more serious reasons such as the family aspect that self authorship bring to a team- "We did that" really makes the team feel very good at the end of the day.

    --
    quis custodiet ipsos custodes
    1. Re:Going... by xombo · · Score: 1

      Stay away from Drupal.
      I think there is a huge conspiracy going on between Drupal "press" and Drupal "consultants".

  33. Ask Slashdot by starrsoft · · Score: 4, Insightful
    FTFA:

    So we have two basic options: pay for bigger hardware, or spend more time writing/maintaining custom code that allows us to live on our existing hardware.

    Hardware is Cheap, Programmers are Expensive:

    Given the rapid advance of Moore's Law, when does it make sense to throw hardware at a programming problem? As a general rule, I'd say almost always. Consider the average programmer salary here in the US. You probably have several of these programmer guys or gals on staff. I can't speak to how much your servers may cost, or how many of them you may need. Or, maybe you don't need any--perhaps all your code executes on your users' hardware, which is an entirely different scenario. Obviously, situations vary. But even the most rudimentary math will tell you that it'd take a massive hardware outlay to equal the yearly costs of even a modest five person programming team.

    --
    Read my blog: HansMast.com
    1. Re:Ask Slashdot by Anonymous Coward · · Score: 0

      Got to be careful there. If it won't run on your existing hardware, it may also not scale, in which case if you are providing an open service, as against something for a fixed number of customers, the cost of additional hardware may be unbounded above.

  34. ??? Why ??? by Jane+Q.+Public · · Score: 1

    You could have just forked the library, and kept your own code (and version) rather than updating to the latest of their version. Your "solution" puzzles me, as it seems to be shooting yourself in the foot.

  35. Ask Around by Radhruin · · Score: 1

    Chances are, someone in the community has experienced your very problem, and it's likely someone has a solution already. At the very least, you'll get some ideas from people who actually use the product.

  36. Re:Rails is alive, get used to it by msuarezalvarez · · Score: 1

    Pluginize, git them out, outfactor. You are kidding, right?

  37. Simple by bytesex · · Score: 1

    Just deal with the other 5% in the 'old fashioned' way; using CGI or C - doing everything from the ground up. And if somehow you can't - because you can't just get the session state from the ruby framework, or you can't get the style sheets from it, then you have to wonder why not. And blame ruby for it, not yourself or CGI.

    --
    Religion is what happens when nature strikes and groupthink goes wrong.
  38. Version Control by omb · · Score: 3, Insightful

    I hate code full of company comment cruft.

    Use a good VersionControl system, git, murcurial or Subversion if you must, __but__ keep the meta-data out of the code. If you use sensible tools you get all that, and its much easier to work with the upstream,

    1. Re:Version Control by Bazzargh · · Score: 1

      Agree 100% with the parent. You should be using version control. In fact, its such a common issue that there's even a term for what the original poster is asking about:

      VENDOR BRANCHES

      Go google that now. You can find more information for your system here...

      * In (a) CVS book
      * In the SVN book
      * One method of doing this in bzr

      With git or mercurial, patch queue solutions are probably what you want - stgit or the newer TopGit for git, Mercurial Queues for mercurial. You want to use patch queues so that you have a clean idea of how to get from their code to your code - managing vendor code via merging branches means your code history is littered with merge info making your patches less clear to your maintainers.

    2. Re:Version Control by palegray.net · · Score: 1

      Right... so when your org decides to move to a new version control system, or the codebase becomes part of a larger project used by other orgs with different version control setups, your code will be so marvelously clear. I'm keeping comments in the code.

    3. Re:Version Control by terryducks · · Score: 1

      Nope - keep the answers to "why" and "because" in the code. your maintenance guys will thank you for it.

      the crap comments are the ones you don't want.

  39. Use Rack to factor out the 5% by jfmiller · · Score: 1

    Keep your code and use Rack to factor out the last 5%. You can keep you code base, and still get your performance. Merb is a an excellent tool for this. It is similar enough to rails to be easy to pick up, but it is light weight and has the ability to run a small application in a single file.

    Without knowing how tightly coupled that 5% is it is hard to be more specific, but definatly look into Rack.

    --
    Strive to make your client happy, not necessarly give them what they ask for
  40. Extend by chrysalis · · Score: 1

    Ruby is a very dynamic language, that makes it easy to extends and to customize classes. Rails itself is designed to be extended using plugins. You can write a plugin that won't define any new class, but that will just add or replace methods from Ruby, Rails or other plugins. This is really a great feature of Ruby, that avoids a lot of hassle.

    --
    {{.sig}}
    1. Re:Extend by zuperduperman · · Score: 1

      He's not worried about how to extend it. He's worried about how to maintain those extensions when rails itself changes - which is a particularly acute problem with dynamic languages like Ruby and the very extension methods you are advocating.

      Since there are no statically defined interfaces or type checks you are going to have hundreds of silent / subtle bugs appear as you upgrade rails if you are not careful. (Careful probably means documenting the changes to the extreme and implementing a huge wad of unit tests to exercise every possible code path).

  41. Go with proven technologies... by tomtermite · · Score: 1

    With over ten years under its belt, WebObjects has proven very beneficial to our company. Of course, Java developers are sometimes hard to find, and the learning curve for WebObjects can be steep, but the community is tight-knit, and the Wonder (open source) frameworks have addressed that persnickety 5% you describe...

    After all, iTunes, UPS and other enterprise solutions show that a core set of frameworks, scalable architecture, and talented developers can yield a business model that works.

    --
    - Ubique, Tom Termini www.bluedog.net - WebObjects / J2EE SOA / iPhone solutions for knowledge workers
  42. integrate into your process by bugi · · Score: 1

    Integrate the rails hacking into your release process.

    * import rails into your scm -- one that has good branching and merging

    * regularly update your scm rails trunk to recent upstream release

    * branch rails locally as part of your release process. that includes using the branched release in QA.

    * get as much of your local changes as possible merged upstream! it's a pita to start, but your effort will be rewarded.

    Use the right tool for the job.

    * use standard APIs so you can switch back and forth between your implementation and others' easily. when possible, of course; not all commonly used APIs are well thought out.

    * if rails doesn't do something well, use another tool that does. examples:

    ** regenerating content all the time? look at memcached.

    ** need local disk-backed storage? sqlite, not mysql/pg/etc.

    * are you sure rails is your bottleneck? not disk-wait for your database?

  43. Good frameworks provide flexibility by Anonymous Coward · · Score: 2, Interesting

    The true differences between frameworks are inevitably revealed as soon as you try to build a product of significant complexity. A truly flexible framework makes it easy to override, overload, or otherwise replace functionality WITHOUT having to modify the framework itself. This has long been my issue with a number of web frameworks implemented in a variety of frameworks. There are many frameworks that will make a fairly simple form based web application come together very quickly. If you've got 5-10 forms, a simple data model, and low enough load to run on a single host, there are lots of frameworks that will let you churn out an app in the blink of an eye. But as soon as you have a sophisticated and complex data model, loads that require scaling not just the web layer, but also the persistence layer, across multiple hosts and even multiple data centers, and you have to support a variety of views (html, web services, json for ajax, iphone, pdf, etc), a lot of frameworks fall completely flat and are unable to help and, in many cases, become an active obstruction.

    It has been a number of years since I seriously investigate RoR for a web project because the vast majority of my work involves very high performance and high volume sites and when I looked into RoR, it offered no easy mechanism to work cooperatively in a cluster with any more sophistication than sticky load balancing and a single shared db. I'm sure it is much improved since then, but every time I take a quick look-see, it still seems to be very lacking - not just in scalability, but in extensibility in general, and I just can't tolerate that.

    There aren't many frameworks that I've encountered that offer the kind of flexibility to really allow you to take our app any direction you want to go. The one that does requires a fair bit more work up front, but boy does it pay off as soon as you have to get sophisticated. Of course, it is native to the language everyone round here loves to hate, Java, but I highly recommend you look into Spring and SpringMVC. Plug in any persistence mechanism you like, including a mixed persistence layer. Plug in any view technology you like. Use AOP to handle cross cutting concerns. You have the flexibility to replace any built-in component with an implementation of your own, so you are never required to modify the source code of the framework itself.

    At every turn, SPring has provided the flexibility I've need to build very sophisticated applications for a number of years now. It will take quite a bit to move me to another platform for anything but the simplest of apps. I recommend you check it out. The fact that it runs in a language that is 25x faster than Ruby doesn't hurt any, either. And the ecosystem of useful code is larger for Java than for any other language I'm familiar with. JEE is needlessly complex, but you can do just about everything JEE does via Spring with a tiny fraction of the complexity, and for the very few things spring won't do, Spring will happily expose JEE directly to you. Oh, and I gather it runs in .NET, too, though I have no idea if it is quite as functional, since it is developed from a java-centric paradigm.

  44. Do mixins help? by Anonymous Coward · · Score: 0

    How are you customizing?

    Early on with Rails we had all sorts of issues - usually with the database drivers - that we "fixed" by using mixins. It meant that we didn't touch core code, but we could slot in alternative functionality wherever it was required. Our code tended to break with each new release of Rails, but our tests showed up the weak spots straightaway.

    I could be wrong, but I believe that with mixins Ruby itself gives you a mechanism, while not perfect, gives you something of what you need - the ability to break convention where you have to.

  45. Build separate functionality using same cookies by Anonymous Coward · · Score: 0

    The easiest solution I have found is to build side web pages out using whatever your server supports, utilizing the same cookies or sessions as the main pages.

  46. I am a chef and my kitchen is a Rails® kitche by Anonymous Coward · · Score: 0

    I am a chef and my kitchen is a Rails® kitchen.
    My freezer is a Rails® freezer.
    My cupboard is a Rails® cupboard.
    -- stocked with cans of Rails®.
    Rails® can-opener.
    Rails® microwave.
    I've never been more efficient. I could have put some ratatouille on faster than it took to type the above, and it would have been done before I finished this post.

    So can you guess where I'm a chef?

    --
    I guess what I'm getting at is that even though you can roll a to-do list with a can opener, microwave, and three and a half minutes of spare time while you're coding, if you really are a chef you probably shouldn't. A professional chef shouldn't be microwaving things from a can or reheating frozen cordon bleu from the supermarket, and you shouldn't either.

    Forget the framework: get some fresh vegetables (yes, you will have to write database queries by hand, boo-hoo) -- and start dicing.

  47. Best Practice: Open Source It by Anonymous Coward · · Score: 0

    Since you're developing solutions for the 5%, but you don't want to maintain it, maybe you should consider open sourcing that 5%. Or maybe you don't really have a solution, just a hack?

    If it's just a hack, let's face it, nobody wants to maintain that crap.

  48. 95% on the first 95%, and 95% on the by Anonymous Coward · · Score: 0

    Ah, you spend 95% of your time on the first 95%, and 95% of the rest on the last 5%.

    1. Re:95% on the first 95%, and 95% on the by thethibs · · Score: 1

      And what do you do with the last 0.25%?

      --
      I'm a Programmer. That's one level above Software Engineer and one level below Engineer.
  49. Django is not really an improvement by Shin-LaC · · Score: 1

    Everything your code does is something the framework doesn't do for you: the real problem is not customization, but how cleanly the framework allows you to extend it, how stable the interface (between the framework core and your extensions) is, and so on.

    That's why I'm surprised to hear people recommend switching from Rails to Django. My experience in going through that route is that Django is less flexible and harder to customize than Rails. For example, in both frameworks you can write custom SQL queries, but while find_by_sql in Rails returns fully-formed model objects (as long as you fetch all the needed attributes in the query), raw SQL queries in Django only return raw data tuples. You cannot integrate your custom SQL with Django's ORM (ie, you cannot get a Django model object from cursor.execute), so you end up getting a bunch of IDs from your custom SQL, and then passing them to Django so it can query the database again for the same objects, using two queries to do the work of one.

    Next time I want to make a web application in Python, I'm going to skip Django and look into Pylons instead.

  50. Obvious solution by Anonymous Coward · · Score: 0

    If your problem is that it is a bottleneck, you could just slow all the other software down, have it count to pi every once in a while, randomly.

    Yes, I do work in management.

  51. Re:there is no such thing as non conventional web by mgkimsal2 · · Score: 1

    And "Rails" isn't a framework? And by "as3" I assume you mean ActionScript3, presumably for Flex, which one might reasonably assume is a framework, no?

  52. Big Surprise by holophrastic · · Score: 2, Insightful

    Those you know me, know me a lot. I had the same problem five years ago. And it started to turn working for clients and revenue-generating work into working for the framework and framework-customizing work.

    So I built my own framework, from the ground up.

    Now it's all my conventions, and no one else's. I customize in ways that I know will be compatible for future upgrades. Of course, I get to make those upgrades myself too.

    But it means that I do everything "for the last time". If it's something that seems valuable, it gets thrown into a framework-compatible routine, and I never need worry about it ever again.

    A lot more work early on. A lot more work for quite a while. And then, blissful no work for anything. Seven of the nine things in the "essentials" section of my invoices -- that every client project needs just to start -- amount to 90% of the essentials dollar amount, and amount to, no kidding, the twenty seconds to install hte framework for teh new client -- and by that I mean run the script that copies files, migrates databases, and changes passcodes. From then on, approximately 75% of the work is remembering the name of the existing function -- or looking at another client project to find it; writing documentation simply hasn't made it to the top of the list in five years.

    I spend about 85% of my effort dealing with client content/sales/training/trust, and only 15% on the actual programming.

    1. Re:Big Surprise by midnighttoadstool · · Score: 1
      A very good strategy for the future considering the likely jobs market in a few months.

      People using well-documented, flexible frameworks are suckers.

    2. Re:Big Surprise by holophrastic · · Score: 1

      Agreed.

      Although, I'm detecting a hint of sarcasm. Which makes sense only because you're missing a key piece of information -- I own the two businesses involved. The job market in which I'm interested is in not having to hire other programmers.

      So yes, considering the employees market, allowing other companies to control mine by defining the tools I use for me is simply not beneficial when compared to my doing it myself. As usual, doing it myself is teh better way to go -- long term.

  53. Do it properly: switch over to .Net by Anonymous Coward · · Score: 0

    The .Net platform is where its at for professional development.

  54. Nonsene. by Jane+Q.+Public · · Score: 1

    If you go back and read it again, you may see that my comment was perfectly honest and accurate.

    Of course, you have no way of knowing exactly what I have heard; but neither do you have any real reason to doubt my statement.

    1. Re:Nonsene. by terjeber · · Score: 1

      If you go back and read it again, you may see that my comment was perfectly honest and accurate.

      How was it accurate? Java is the second highest performing programming language of the modern OO and equivalent languages. It's performance is some times slightly slower, some times slightly faster than C++. In reality, Java is very close to C++ in performance for all the most common programing tasks today. Your statement implied that Java was very far from high performance, which was 100% wrong.

      So, being 100% wrong, what was it that was accurate about your statement?

      Of course, you have no way of knowing exactly what I have heard;

      I couldn't care less about what you have heard, and what you have heard is utterly irrelevant to whether Java is performant or not.

      but neither do you have any real reason to doubt my statement.

      If by "your statement" you refer to the implied statement about Java performance, then yes, I have many real reasons to doubt it, since it is wrong. Measurably wrong.

    2. Re:Nonsene. by MTocci · · Score: 1

      Have you seen this site,

      http://bruscy.republika.pl/pages/przemek/java_not_really_faster_than_cpp.html

      This guy made a few tweaks to the C++ code (and documents them) and finds that C++ is about 2 - 3 times as fast as Java.

    3. Re:Nonsene. by Jane+Q.+Public · · Score: 1

      "How was it accurate? ... "

      It was accurate because what I stated, way back in the very beginning, and what you were supposed to be replying to, was that this was the first time in a long time I "had heard" somebody recommend Java for performance reasons. That was a completely truthful -- and accurate -- statement! I challenge you to demonstrate otherwise! (Hint: you would have to be my Siamese twin in order to convincingly do so.)

      "I couldn't care less about what you have heard, and what you have heard is utterly irrelevant to whether Java is performant or not."

      Then what the FUCK are you doing participating in this conversation at all, since it was about THAT STATEMENT, and NOT about Java's actual performance! That statement is what you replied to, and that statement was the subject!!!

      "If by 'your statement' you refer to the implied statement about Java performance, then yes, I have many real reasons to doubt it, since it is wrong. Measurably wrong."

      I implied NOTHING! You are trying to read far too deeply between the lines! Next time I want someone to read my mind, I will hire a goddamned psychic!

      Do NOT come barging into conversations I am having with others, change the goddamned subject, then in effect call me an idiot because you got it all wrong! And apparently, based on your most recent comments, get angry about it as a result! Jesus, what a clueless asshole.

      Go away! I shall not respond to you further.

    4. Re:Nonsene. by terjeber · · Score: 1

      this was the first time in a long time I "had heard"

      Which just means that you are ignorant and have a desperate need to flaunt it.

      since it was about THAT STATEMENT, and NOT about Java's actual performance!

      Sorry, I misunderstood your comment. I took the "that's rich" part to actually mean that you commented on Java performance. I was not aware that you only had some masochistic need to announce that you were ignorant. I am absolutely sure that Julia Roberts also has never heard that Java has a certain level of performance, but I doubt she has a need to advertise this particular ignorance in various public fora. I would assume that Julia Roberts tend to speak of things she actually has knowledge off, most people do. When people are ignorant of a particular subject they tend to either try to educate them selves on it or just not participate in discussions about it.

      I will hire a goddamned psychic!

      You really shouldn't. They can't really read your mind. Honestly. They can't. Instead of doing that you should limit your commentary to discussion topics you in fact have information about.

      Do NOT come barging into conversations I am having with others, change the goddamned subject

      This is a public forum, not a messenger client. You are not participating in private conversations ever when you post in a public forum, you are shouting from mountain tops and inviting everybody to join in. If you don't understand the difference between talking to someone over the phone and posting in public discussion fora, I would recommend you stop the latter until you have acquired enough knowledge to understand the difference.

    5. Re:Nonsene. by terjeber · · Score: 1

      I have read the article in question, and it takes a specific "performance test" to task over bad methodology. I have not endorsed said methodology but referred to an article on the topic of performance that is more in depth.

      If you have any information about the methodology applied in this article, please let me (and the author) know.

      I also referred to this one, again not the one with the flawed methodology. If you feel there is anything wrong with either of these, please feel free to enlighten me.

    6. Re:Nonsene. by Anonymous Coward · · Score: 0

      *applause*

  55. Re:there is no such thing as non conventional web by gert+cuykens · · Score: 1

    Aldo I probably was mistaken about rails as just a ruby interpreter. ActionScript3 is a language that you can compile with the flex compiler. ActionScript3 and mxml are different things. My point was it can be done for web apps. You just need to learn both web client and server world. Frameworks are for people that do not have the time or knowledge to implement both.

  56. Being Sunday, I do not have that information. by Jane+Q.+Public · · Score: 1

    But come Monday, I can ask the guy who does our load testing.

  57. Replying to the actual question by lordlod · · Score: 1

    You have identified the key problem nicely in your question. How to maintain your changes when the base changes underneath you.

    The first thing I recommend is to go back to your basic OOP structures. If you can, inherit and extend rather than modify their code. The interface will change far less than the internals.

    If you have to modify the internals try and keep it as contained as possible. Consider creating new functions rather than modifying theirs. Try and collect as many changes together as you can, each function changed is a pile more work.

    When you are updating to the newer versions try and do a three way merge, it makes it far simpler. Many of the distributed VCS like git have it built in or you can use tools like kdiff3 to do it manually.

  58. "knowing" django? by Anonymous Coward · · Score: 0

    >will you disqualify fifty really smart guys for
    >five mediocre ones who happen to know Django?

    You don't hire developers because they "know" django, or any other framework or language. You hire them because they are good developers.

    Real developers learn how to use new libraries and languages all the time. Only HR drones concern themselves with "X years of experience with Y technology".

  59. Hammer and Nails by bolix · · Score: 1

    It sounds to me like the OP is complaining that his hammer won't work with every nail.

    No tool is perfect and each has limitations.

    Use each tool as appropriate and do not prescribe to purism over functionality.