6 ms·
If you optimize a framework for beginners, you're optimizing for learnability. That's great for the first few days or even weeks of learning. But once you're pa
by dhh 15y ago
If you optimize a framework for beginners, you're optimizing for learnability. That's great for the first few days or even weeks of learning. But once you're past that, it's not so great. What you care more about is the usability of the thing once you know it. There are plenty of cases where learnability and usability are in conflict. Letting learnability win is a short-term relief.
If you on the other hand optimize for usability, for making things simple and easy to use for someone who understands the basics, you'll often end up with something that has great learnability as well. Maybe not as much as could be achieved as if that was your only goal, but plenty still.
The other aspect is whether you as a framework designer are designing something for yourself and your peers or if you're trying to dumb things down on behalf of beginners. In other words, designing for what you think beginners might find easy in their learning phase. That's really hard to do. Most technology I've seen designed in such a master/apprentice fashion sucks.
Finally, when you're comparing complexity, it's generally more helpful to look at the complexity involved with completing an entire task. Comparing complexity of "hello world" tells you little about what the complexity is going to be like developing a complete, modern web application from database migrations to XSS/CRSF protection.
That's where learnability and usability are again in conflict. Yes, it's harder to learn a framework that has answers for things like "how do I migrate a database once I have data I care about", or whatever feature you want to focus on, but once you hit that problem, you'll be glad that it's there and find the solution less complex than stringing something together from tons of separate parts yourself.
All that being said, I think Sinatra is wonderful. So what if it's not a fit for building a whole Basecamp or Github? It's great for teaching someone the basics of how HTTP works and it's great for smaller surface apps or for smaller, isolated parts of bigger apps.
- dhh 15y agoOn top of that, I actually talk to beginners all the time who are thrilled with the ease of learning Rails. They're building real apps they never thought they could complete on their own. Naturally, there's some selection bias there (most people who give up are unlikely to write), but that doesn't change the joy for the people who did have a great and easy time.
- gmichnikov 15y agoI apologize if you've addressed this elsewhere, but do you have any specific suggestions beyond http://guides.rubyonrails.org/ http://guides.rubyonrails.org/ for a beginner (who knows basic HTML/CSS but not much else) trying to learn Rails? I've been using RailsTutorial, and while it's packed with info, I feel like I would benefit from a more solid understanding of many of the basics.
- dhh 15y agoI've heard great things about http://railsforzombies.com/ http://railsforzombies.com/ and of course a good book, like http://pragprog.com/book/rails4/agile-web-development-with-rails http://pragprog.com/book/rails4/agile-web-development-with-r....
- berberous 15y agoGoing to have to disagree; railsforzombies is so thin on information, I don't really feel like it's worth the time. Then again, it takes only like 20-30 minutes. So go for it I guess. I've found this to be an AWESOME resource: http://openclassroom.stanford.edu/MainFolder/CoursePage.php?course=WebApplications http://openclassroom.stanford.edu/MainFolder/CoursePage.php?... It's a full Stanford class of lecture videos. It really solidified my understanding of the concepts I learned from Hartl's tutorial.
- Soleone 15y agoWow, thanks so much, this looks like an amazing resource indeed!
- ghr 15y agoLike you said, I get people to use Sinatra for a while before getting in to Rails. It gets them in to MVC style apps while keeping things simple. Definitely recommend it as a stepping stone to Rails.
- micdijkstra 15y agoI don't think you need to go from Sinatra to Rails - I actually started with Rails and like dhh said - before I knew it I was building real apps. Rails provided a great framework to get something up and running. It provides MVC and interacts with a database. After familiarising myself with Rails I started using Sinatra (which doesn't offer any MVC or support you get from Rails) and then ultimately started coding just in Ruby. I don't think there's any issue with the learning curve for Rails because it provides the support where you need it. I speak to new developers all the time who use Rails and get it almost instantly - releasing apps a week or two later.
- bodegajed 15y agoI beg to disagree. Learnability and usability can get along together. Good examples are Jquery and Cakephp. Both have executed this very well from producing well written and well maintained documentation then add a good amount of plugins that is contributed by the community. For example, in cakephp we have this cook book http://book.cakephp.org http://book.cakephp.org which the quality of the content surpasses every cakephp book on amazon. So, like apps "simple & feature rich" can get along together like "learnability & usability" can get along too. It just needs more work.
- dasil003 15y agoRead closer. Never does he say usability and learnability are opposed, just that there are opposing cases and that he doesn't agree with optimizing for learnability first.
- bodegajed 15y agoBut he's saying like you can only choose one from the two. >There are plenty of cases where learnability and usability are in conflict >That's where learnability and usability are again in conflict But it is hard to work on both so you may need to work on usabilitiy first then work twice as hard for learnability.
- swq 15y agoThe problem with cakephp is that every book written on this subject surpasses the quality of the framework itself. cakephp is easy to learn, but for me it's unusable in the long run. Easy stuff get's even easier, hard stuff get's harder. That's exactly what David meant. If you trade everything for learnability, it's not usable.
- adriand 15y agoThat sums up my experience with cakePHP too. I don't know what's happened with this framework in the last couple of years, but when I was first learning Rails and enjoying it, I used cakePHP for a big project because I knew PHP well, and didn't yet feel comfortable with committing to using Rails for it. That was a decision I regretted many times. The hoops I had to jump through to deal with complex database queries were ridiculous. The difference in quality and robustness between ActiveRecord and cakePHP's ORM (at that time, anyway) were pronounced, with AR coming out way, way ahead. There's no doubt, in my mind, that if you are going to take on a large, ambitious web application project, you'll be better served by Rails.
- bashar3a 15y agoThis might be a good success story from a non-developer who created MixTape.me http://lifehacker.com/5336113/how-to-build-a-web-application-from-scratch-with-no-experience http://lifehacker.com/5336113/how-to-build-a-web-application... using Rails
- pankajdoharey 15y agoI personally went from PHP > RUBY > Ruby(cgi) > Sinatra > Rails, And i think the journey was great because sometimes we need to learn and work in really bad technologies to appreciate something as good as rails. We should strive to make the learning curve more enjoyable rather than making it beginner friendly, The only way i know of doing that is to show evolution of technologies, there merits and de-merits and why or how we have reached where we have reached and why we took the technological decisions that we took. How we reached to rails from PHP or cgi. How treacherous the journey was. Rails just has too much magic and higher level of abstraction built in that it easier for beginners, But when you want to do something really great you need to look under the hood. That is RUBY, Rack and HTTP. Because sooner or later you will realize that a web app is nothing more than HTML/CSS/Javascript so you know the nuts and bolts of the underlying infrastructure the better. I think learning something as basic as sinatra is much better than learning rails , so that you have some idea of the underlying stuff and then when you move to rails you can learn more of rails by just looking at its code. Personally i learnt a great deal from looking at rails source than looking at a tutorial. But surely it would be a daunting task for a noob. Also learning Rack comes naturally with sinatra. and as you look at Rack, sooner or later you would figure out how to write a cgi adapter for your rack app. Then Comes rails which saves you from all the mundane task you were doing developing in sinatra and much more. This way you would have a better understanding and appreciation for rails and all the stuff that you don't have to do or write in rails. At the same time you will have a better understanding of how a particular feature is working in rails. This improves your debugging skills because you know where to look for when something goes wrong. Finally Ruby is the elephant in the room so you need to be better at ruby to become excellent at rails, Which often is shadowed by the magic that rails provides, so learning RUBY first is more important than rails, sinatra or anything.
- envex 15y agoTo be fair, you went from PHP > Ruby. You can't really call a framework a language.
- pankajdoharey 15y agoTrue PHP is weird A Language + Framework in one. Or you can call it a webDSL if you want.
- Argorak 15y ago>All that being said, I think Sinatra is wonderful. So what if it's not a fit for building a whole Basecamp or Github? It's great for teaching someone the basics of how HTTP works and it's great for smaller surface apps or for smaller, isolated parts of bigger apps. Sinatra is actually a great foundation for big things, although it doesn't give you the whole stack, but only the way how to build your stack. I've been developing on Padrino (which builds on Sinatra) for 2 years now and I am still surprised by how easy adding features/plugins to Sinatra (and by that, Padrino) is, especially as the most useful Rails plugins now also come with a "pure rack" variant. On the other side, I often ran into problems with the huge stack that Rails has, so that I had to tackle issues far before I actually needed a feature.
- joshsusser 15y agoOne of my favorite Alan Kay quotes: "Make simple things simple, and complex things possible." And the Albert Einstein quote everyone mangles: "A scientific theorem should be as simple as possible, but not simpler." It's a matter of finding the sweet spot where the system is easy enough to learn to be accessible, and sophisticated enough to be powerful. In terms of usability, I've generally been happy with where Rails falls on that spectrum. The real challenge with Rails is learning the codebase well enough to make effective contributions to the framework.
- hisea 15y agoRails is not for beginners. A MD is not for beginners either. Policing is not for beginners either. Even cooking is not for beginners. I had my first son 9 month ago before I learned how to change a diaper. Being a Dad is definitely not for beginners. Life is not easy, nothing is for beginners. People just learn along the way if they think this is the skill they need to learn and they have a strong will. The most important thing is to BEGIN.