This website uses cookies for analytics and to improve provided services. By choosing I Accept, you consent to our use of them and other tracking technologies according to our Privacy Policy

From Monterail with Love #1

A couple of months ago Bartosz described how we use Facebook to improve communication in our team. Actually most of the content on our wall are more or less interesting links from the internet. We quickly noticed a troubling pattern though—they are easy to forget. And if you forget them, you can’t use them.

So we decided that we’ll be regularly preparing a brief summary of the best content so it’s easy to find and convenient to browse. Our goal is not to provide The Hot News™—you can find them anywhere—but the top of the top stuff which we believe will remain valuable for a long time. So… let’s start!

JavaScript rules

Roy Tomeij, one of the speakers on the last wroc_love.rb conference, suggested that classes should be replaced with data-* attributes for JavaScript selectors. Recently he followed it up with some benchmarks and shared the numbers. If that doesn’t convince you, read why classes are for designers and data-behavior is for JavaScript developers.

If you have problems organizing your JavaScript assets when using Sprockets, you should read an awesome article from Unholy Rails: adding JavaScript to Rails.

Improve your tests

How to (and why) test factories—short and easy, but very useful protip from Thoughtbot.

If yours tests take too long, check if you can replace doubles with OpenStruct. Xavier Shay did some benchmarks on the subject.

There is new shiny tool on the horizon, Testacular, and I think it can soon replace Selenium. It allows to run tests in multiple browsers with your favorite testing engine under the hood.

If you don’t feel comfortable writing tests, there is a new site for you: betterspecs.org, the collection of bad examples turned to good. It’s open-sourced so you can always add a new example or fix another if you disagree with proposed solution.

Coding patterns

DCI is a hot topic these days, but there is still lack of good examples, especially in Rails context. Victor Savkin fills this gap with an article Data Context Interaction: The Evolution of the Object Oriented Paradigm. If you like the solution proposed by Victor also check his gist collection and DCI-Sample repo.

Another interesting approach to DCI in Rails is shown on already mentioned Xavier Shay’s blog in article titled Dependecy Injection for Rails Controllers.

At last, an article about patterns themselves: The First Step to Applying Design Patterns: Don’t. Very good explanation why design patterns are awesome, when you should use them and when not.

See you next time!

senior developer at Monterail What Does It Mean to Be a Senior Dev at Monterail?
prototyping software development Why You Need Prototyping in Your Software Development
storm How Event Storming Will Improve Your Business Processes