5 ms·
I'll be a contrarian here: don't use mega-frameworks (Django, Rails). Instead, use micro-frameworks. Stay away from ORMs (I'm looking at you, Django). A skilled
by tonecluster 14y ago
I'll be a contrarian here: don't use mega-frameworks (Django, Rails). Instead, use micro-frameworks. Stay away from ORMs (I'm looking at you, Django). A skilled engineer can get a product comprised of small packages up and running in the same amount of time (and sometimes less time) as one built using a mega-framework.
(Imagine, using a python example, gEvent + zeroMQ + pystache + db-of-your-choice. You can do almost anything.)
- gav 14y agoI've been developing web applications for about 17 1/2 years. I've worked on a huge range of what would now be called "stacks"; everything from ASP/SqlServer to Java/Oracle to Perl/MySQL and a whole bunch in between. I even worked on "web services" in 1999 using Oracle/Corba/C++ and CSV-over-HTTP. The main thing I've learnt is that these choices made almost no difference to the success of the project. Skilled engineers using whatever tools they are experienced with make successful products.
- Deinumite 14y agoHonestly this sums up what I have been trying to articulate for a while now. I find people put too much stock in "what x uses" or "what is x written in?" That doesn't mean it's impossible to make bad decisions about what you use of course.
- notJim 14y agoI feel like most skilled engineers would end up re-writing a crappy version of a framework in the process of writing an app--so why not start with one? I think it depends partly on whether you're really writing an app, or hacking together an MVP. The reason I feel this way is that most apps have a great deal of simple CRUD (SELECT * FROM [table] WHERE id=? and UPDATE [table] SET [...] WHERE id=?), which is exactly the problem ORMs optimize for. Any skilled engineer is going to notice they're writing the same boilerplate SQL -> data structure of some kind (maybe it's a dictionary type structure) code over and over again and write a framework around that. Congratulations, you now have an ORM, except that it's one hacked together by a busy engineer, far less tested, and missing features that would save you writing a lot of boilerplate code. Meanwhile, your engineer realizes that one should separate view logic from business logic, and maybe have some glue in between, so you've got a request-handling layer, a view (+view model?) layer, and something that handles business logic and database access (or maybe those two things are separate, depending on your engineer.) Congratulations, you now have an MVC stack! Except again it's one that's far less tested, has no documentation, and has been hacked together by your engineer, who I should mention is very busy trying to write all this boilerplate code. So now you've got all that taken care of, it's time to allow people to login. Your engineer is now spending their time writing an authentication system. Your engineer is certainly skilled, but there are a lot of nuances to get right with this sort of thing, so your authentication system has a lot of little security flaws and subtle bugs that you will spend the next several months fixing. You see where this is going...
- PommeDeTerre 14y agoI think you're only looking at one side of the coin. While there may be benefits to using ORMs and web app frameworks, there are also many significant drawbacks. A lot of the time, these drawbacks can wipe out many, if not all, of the gains. You usually end up losing a lot of flexibility when using ORMs or frameworks. If you don't do things exactly the way the ORM or framework forces you to, you'll be in a world of pain. Of course, there will always be situations where you need to customize things to your particular case. ORMs and frameworks are notorious for making this far more difficult than it should be. I've seen teams waste more time twisting a framework or ORM to handle a unique situation than it may have saved them in the first place. It's naive to think that ORMs and frameworks necessarily have fewer bugs, or better quality, or better documentation, or more tests than custom-written code. I've worked on enough teams that have had a hell of a time due to ORM or framework bugs. It's worse when you're using a closed-source ORM or framework that you can't easily fix directly. Somewhat related to that, for any sizable or complex application, it's just not possible to completely avoid understanding the inner working of the ORM or other frameworks that you're using. Eventually you'll need to dig into them, whether it's to fix a bug, or to figure out how to do something that's poorly documented, or perhaps to figure out performance problems. This can be very time-consuming, often exceeding the effort needed to write, debug and test custom code. If you do need to make additions or fixes to an externally-developed ORM or framework, this can very easily cause headaches down the road when it comes to upgrading to a new version of the framework or ORM. You end up having to choose between using an old, patched version of the framework that lacks critical features or bug fixes, or you can upgrade and try to re-apply your fixes/additions, or maybe even moving to a whole new framework altogether. Having to deal with issues like these can make custom code look very compelling.
- fallenhitokiri 14y agoI believe ORMs are great for something notJim mentions in his first sentence: "why not start with one?". You lose some flexibility, you can encounter some bugs. But till you reach this point you do not have to write SQL and (hopefully) gain some development speed, at least if you find an ORM that fits your needs. For some people who do not mess with databases every days this is IMHO great. I sadly do not remember who said it but I liked the idea "machines should be able to generate SQL much faster and more reliable than me". I think if you really hit the limits of an ORM (one of the bigger ones) and are not experienced with databases (and SQL) you reached the point where you should look for someone who is. But if you never do and only need CRUD and some relations you can live a happy life.
- scott_meade 14y ago"A skilled engineer can get a product comprised of small packages up and running in the same amount of time (and sometimes less time)" Maybe "up and running", but then new skilled engineers that follow in enhancing and maintaining get to try to figure how it all works and waste the first x months of their time on board coming up to speed on the proprietary combination of frameworks and interfaces.
- tonecluster 14y agoThis assumes that the software is proprietary - which is something I didn't write in my comment. gEvent, etc, aren't proprietary - they're open-source. There's no reason an engineer who's been around the block at least once wouldn't be familiar with the various OS libraries in various languages (these days, that's probably ruby, python, nodeJS, and maybe java if you're working in big data). There's no way that someone who knows what they're doing would be able to learn Django or Rails implementations quickly but would take "x months" to learn a ruby + zeroMQ + mustache implementation. Months? Someone's sandbagging ;)
- fallenhitokiri 14y agoAuthor here. I know this could be a shock, but I can do almost anything with a mega-framework, too. Using a mega-framework there could be a point where I would have to work around the limitations while using a micro-framework just means that there could be the point that I invest time (implementing, maintaining, maybe even some troubles updating parts of the system to new versions,...) implementing something that a mega-framework provides out of the box. For the sake of fun I wrote a basic implementation using Django and PostgreSQL and one using Flask and Redis. I did not use a stopwatch but I would say that it took the same amount of time. The only difference? In my experience I will have an easier time adding a feature quickly thanks to all the batteries Django already includes.
- tonecluster 14y agoCould this be because you're much more acclimated/familiar with to Django then you are Flask (and the Flask stack you built)?
- fallenhitokiri 14y agoI have build sites and services in both of them. I am definitely more familiar with Django. But using flask-batteries is just more work / LoC to use them. Building a feature without batteries is IMO nearly the same in time and LoC. Of course you are more flexible and have a smaller default installation, which are great things, but most of the time Djangos batteries "just work" and every hour I can safe working on a project and still delivering the expected results is great for me and my clients.