Interview with David Henner about RoReCommerce and not only
сентября 25, 2011 | Published in English, Интервью | 4 Comments
В статье — переводе моего интервью с Девидом Хеннером, Антон Копилов попросил меня опубликовать оригинал на английском. Для всех ценителей английского языка =) предлагаю оригинальный, немного сырой текст интервью. Заранее извиняюсь за мой английский, благо — его не так много в тексте. (все картинки кликабельны)
Hello, David! David, introduse yourself please.
I’m David Reyn Henner. I doing some contract work while I am also trying to start up my own company. My Startup’s name is and we sell Men’s Fashion online and through direct sales. For a hobby, I haven’t been doing much outside the ruby world. I’m hoping I can start golf and workout more soon though.
Devid tell me about your project that is named , please.
is an e-commerce starter application written in rails 3. It’s a project designed for an e-commerce startup that has a goal to become large. For example, I built in a double entry accounting system. This might not be needed for a small shop but it doesn’t hurt. I also wanted to make sure the application was developer friendly. I’ve documented the majority of the methods in the models and I also kept most methods easy to read.
David, can you provide links to some of the biggest e-commerce sites that use rorecommerce? Do you use rorecommerce in you start-up too?
Yes I do use ror-e for my own e-commerce startup. Right now there is only a coming-soon page at . I do know a couple sites that use ror-e but I prefer not to name these sites without asking permission. Several consultancies are using ror-e I have not asked for their client’s names because I feel that should be private information.
Some of the consultancies that have contacted me are:
- endpoint.com
- circarconsulting.com
- railsfactory.com
- and several other freelance consultants
My guess is that aroun 40 sites use ror-e.
Why did you deside to create new ecommerce solution on Rails if Ruby/Rails community alredy has Spree?
ror_ecommerce started as just a starter application for a rails 3 application. I wanted a project that had factory-girl, rspec and rails 3 so I could start developing applications faster. Then I started working with spree. I didn’t like the way spree had a lot of magic. At that time Spree was using resource_controller and I found resource_controller tried to do so much magic that you had to spend hours figuring out how to override it. I think that forced a lot of spree’s code to live in the controllers. After a few weeks of frustration I decided I would take what I had learned from spree and create my own e-commerce platform.
What is the main difference between RoReCommerce and Spree?
Wow… I could talk hours about this. First, ror-e had the advantage to learn from spree. I don’t want to talk poorly about spree but to talk about the differences I might come across as «harsh».
Spree tries to be its own framework. What this means is that spree overrides several things in rails itself. I have not followed up with recent editions of spree but the first thing I noticed about Spree is that the app folder is in the vendor folder. RoR-e tries to behave like a normal rails application. The app folder is right what it belongs. RoR-e doesn’t override Rails because I found that trying to understand where spree overrode rails caused for frustrating hours of development.
Spree has the concept of extensions. I believe they are moving toward engines but these engines almost never work for all versions of spree. RoR-e behaves like a rails application. If you need extra functionality you can create an engine or just treat ror-e as a normal app and start changing behavior.
In Spree writing a new method in the order class involved doing class_eval. When you have code in an extension overriding a method and then you override the class again you eventually have code about the order in several different places. It is impossible to follow. For ror-e, if you want to override a method all you have to do is go to the model and make a change.
I found upgrading spree to be nearly impossible. People tell me that ror-e should be an engine. I find it would be very difficult to make ror-e backward compatible and make it a rails engine. If you want backward compatibility I’d add functionality to ror-e by adding engines. That being said the preferred way to develop on ror-e is to just checkout the repo and treat it as your own code.
Spree’s cart is just an order object. I found this to be scary. First off an order and a cart are two different things. A cart is just a bunch products. Until you checkout the cart doesn’t need to do anything except know what products are there. The order on the other hand is «sacred ground». The order object should not be updated or changed after you checkout. ror-e’s cart is very advanced yet simple. The only purpose of the cart is to have a bunch of products. The advanced part comes with the «save for later» and «purchased» functionality. ror-e’s cart never removes the products. This allows you to easily see all the products a user has ever added to their cart. This is a marketing team’s dream. Also the order is considered sacred.
I could continue talking about «the cart», «how address’s are stored», «returns», «shipments», «tracking inventory» … I had the advantage of looking at what I did not like about spree. I feel spree’s solution was good for most people when spree was created. Rails and best practices has changed and I feel ror-e took advantage of hind-sight.
How many people work with you on RoReCommerce, and how many people use your e-commerce solution?
I’ve had several contributors. Most help with a small improvement or setup issues with windows or Linux. After the fix they normally stop contributing. One thing I have been poor at is keeping contributors actively contributing. I think most people that contribute have a small issue on their own project and they just want to give a little back. Once their problem is solved they go back to their day jobs. That type of contributor is great though.
I do have someone helping with refactoring the admin-cart. I made a poor choice with the admin-cart and I can’t wait until it is complete. Once it is complete the admin cart will look and feel like the normal cart.
What gems do you use in RoReCommerce and why did you select them?
ror-e has a long list of gems. The gems that stand out are:
- dalli (for memcached)
- compass (for css)
- sunspot_rails (for search)
Most of the other gems are standard gems most developers are familiar with.
Dalli is a way to access memcached. I will actually be reducing memcached in the future. I will keep it in the project but I sorta over-used memcached in the admin cart. My plan is to make the admin cart behave more like the regular cart in the near future.
Compass is an awesome way to add ruby code in your css. I like it because I can organize my css and have partials for the header, footer and other sections of the app. Then ruby compiles your css. This allows you to reuse these partials very easily.
Sunspot can be taken out easily enough if you don’t want to have the power of solr for searching your products. It’s a great gems so I recommend keeping it unless you have a good reason to take it out.
Why did you chose sunspot_rails for Solr when Sphinx is more popular solution for search?
I looked at sunspot_rails and Sphinx. Sunspot was very simple to setup and easy to remove if you didn’t need the functionality. I didn’t look at the popularity of the gems. I looked at the api and sunspot looked great. Also Sunspot was recommended to me by the guys at heroku. Ironically I don’t see sunspot supported there so I will start looking into why and that could be a gem I switch. Gems that have a lot of support one day have no support the next. It is a constant battle to keep up to date. That the greatest part about open source and most difficult part about open source.
What hardware and software do you use? What frameworks and gems do you prefer for testing (rspec, minitest, shoulda, fatory-girl, fabrication, etc.). Why you prefer those testing tools?
Hardware: I have a macbook pro for development. I use Textmate and VI for development.
My standard setup for testing is: rspec with factory-girl. I prefer them because those are the tools I am familiar with. My goal to is switch to test-unit or minitest because they ship with rails and they will not easily break tests with upgrades in ruby.
Sometimes during development of some application people create new gems, what gems have you created while you have been developing rorecommerce? Can you tell me about them?
I am actually starting a new gem right now. It will be like scaffolding for tests after our code is done. I have several controllers that need tests. Instead of manually creating every line of code for the controllers, this gem will inspect the class and determine what scaffolded tests you need.
David, tell me your story about how you chose Ruby and Rails? What languages/frameworks have you used before Ruby and Rails?
I choose Ruby on Rails because the 15 minute blog video DHH made many years ago. Before I was In the semiconductor industry. I needed a way to add my automated MatLab graphs to the web. I choose PhP at first and as soon as influence my company to use PhP I found RoR. I’m glad I didn’t stay with PhP. Before MatLab I wrote C and Assembly code.
In what projects except rorecommers do you take part? Tell a little about every of them.
I’ve forked my own version of nifty generators. I actually made some contributions to spree. I used to spend hours looking through spree’s message boards trying to help out. I also like going on stack overflow and answering questions. If I had all the money I needed I thing I’d spend my days teaching. I really enjoy helping people learn.
Prior to ror-e I would spend 80 hours a week at work. I didn’t give myself time to contribute to open source.
Do do you learn some new programming languages or frameworks? What you think about coffescript?
I feel coffeescript will soon be widely accepted in the ruby community. I’ve become a huge fan of javascript/jQuery over the past few years though. I know I will make the switch but I am waiting to see how well the community takes to coffeescript. Given the difficulty with debugging coffescript I feel tools will need to be made for debugging before coffeescript gain total acceptance.
Do you use Sinatra or Padrino in some of your projects? What you think about those frameworks?
I’ve used Sinatra. I think it has its place in the ruby community. If you need to build a small project or service it’s great. I also believe the community should focus on only 2 or 3 web frameworks. Having options is great. Having too many options means the community might be heading in multiple directions. The reason PhP is so chaotic, is that they have not agreed to have the majority of the developers to work on the same framework.
What you think about future of Ruby and Rails and about recently presented Rails 3.1? In last 3.1 version Rails is very monstrous with a big collection of new gems. And matz in one of his interview said that ruby core team started developing ruby 2.0
RoR always seams to progress faster than I expect. 3.1 is awesome but it does some things that is dangerous for junior developers. For Example: identity mapping is super cool, but if programmers rely of identity mapping code will be almost impossible to debug.
On a whole I love 3.1 and I’m even more excited about 3.2. Aaron Patterson promised a faster RoR and less objects in rails 3.2. I can’t wait.
As for ruby 2.0. It looks like ruby will have more fun tools for mixins in ruby 2.0. I’m also hoping MRI ruby learns a bit from rubinious. Rubinious has a few great concepts. My guess adding actors or another type solution to tackle concurrency will be huge for the future of ruby. Given that all hardware has multiple cores these days concurrency will be problem to solve. I’m also interested in ruby-lite.
Can Ruby grab a piece of pie of PHP in near future?
Ruby vs PhP… I personally think Ruby will take more developers from Java than PhP. PhP developers rarely practice Object Oriented Programming. I think many PhP developer don’t want to jump over that hurdle.
Do you have experience using mongodb? What orm for mongodb do you choose and why? what do you think about mongodb? Lately many developers has used mongodb everywhere… is faster than…
Mongo is a good tool. For the company I created I actually had a few weird business rules that needed a more flexible cart. So I took out ror_ecommerce’s cart and replaced it with a mongo based cart. I used mongoid. I don’t know if it is better or worse than mongo-mapper.
As for developers starting to use Mongo over SQL I don’t like the trend. Most people use mongo like a relational DataBase. It isn’t a relational DB. If you model your DB like a relational DB, you should use SQL.
What do you think about node.js? Why it became so popular to mention it in ruby or rails vacancies?
Node.js is a fun project. I can’t wait until it becomes more stable though. I think Node.js will either become stable or a new project will learn from node.js and stabilize it. I’ve heard node.js is constantly breaking older functionality. This needs to stop before I would recommend using it in production. That being said… node.js or something similar has a very long future.
Node became popular for 2 reasons. Speed and it’s great for pub-sub’s. My hope is that developers in the ruby community don’t get fixed on speed and remember stability and reliability are also important.
What do you wish for RubyDev readers and for all Ruby/Rails newbies?
Newbies… Figure out if programming is what you love. If it is, find people that you can learn from and good luck.
RubyDev readers… I don’t speak Russian so I wish I knew more about RubyDev. Give ror-e a try, if you like it, tell me. If you don’t like it, tell me twice. I want to hear good and bad feedback. I feel the project will only get better if more people tell me what they do and don’t like. Thanks in advance. :)
Thank you for you answers, David!
Links:
сентября 25, 2011 at 17:54 (#)
Thank you :)
сентября 25, 2011 at 18:27 (#)
Anton, всегда пожалуйста=)
сентября 26, 2011 at 08:26 (#)
Думаю стоит заменить выражение «вылаживаю оригинальный»….
сентября 26, 2011 at 09:35 (#)
none, спасибо, заменил, мне тоже это слово не нравится, просто как-то на автомате его использую.