Close and Go BackBack to Viget

General

Preventing Broken Windows

Ryan Foster
Ryan Foster, Web Developer, November 29, 2011

When you see poorly written or poorly executing code in a project you've inherited, what's your first reaction? It probably depends a lot on context. Is it cruft? Meh, its not hurting anyone (yet). Is it failing on edge cases? I'll fix it when someone complains. Is it one of several sore spots immediately visible? This whole thing is junk and it's too painful to fix.

Continue reading "Preventing Broken Windows"

The Balanced Developer

David Eisinger
David Eisinger, Senior Developer, October 31, 2011

In preparation for a recent team offsite, I spent some time thinking about what I hold dear as a software developer. One idea I kept coming back to is the notion of balance. I see balance manifesting itself several ways in the work of a successful developer, some of which follow.

Speed Versus Quality

The most obvious example is the balance of development speed and quality. When building software, it’s never a good idea to write code as fast as possible without any attention toward maintainability, just as it’s never a good idea to spend such an inordinate amount of time designing and tweaking your software that it never ships to customers. The balanced developer focuses on delivering value both immediately and through the life of the software.

Continue reading "The Balanced Developer"

Using Object-Oriented Programming to Manage Control Flow in Rails Controllers

Patrick Reagan
Patrick Reagan, Development Director, September 28, 2011

This post made the rounds the other day and really left us all scratching our heads. In the post, the author gives an example of how he relies on the use of exceptions as a sort of modern day GOTO statement instead of using conditionals to manage control flow in a controller. His assertion that his typical approach to writing controller code involves "... put[ting] a bunch of conditionals in there for different situations" hints at a deeper problem that I've seen in a lot of Ruby and Rails applications.

Instead of working to refactor the code in the controller, I'd like to back up a bit and take a look at an alternative refactoring that relies on OO concepts while taking advantage of some of the facilities that Rails has to offer. In the end, we'll be left with more idiomatic Ruby and Rails code that is also easier to understand and maintain.

Continue reading "Using Object-Oriented Programming to Manage Control Flow in Rails Controllers"

On Confidence and Real-Time Strategy Games

David Eisinger
David Eisinger, Senior Developer, June 30, 2011

I want to talk about confidence and how it applies to being a successful developer. But before I do that, I want to talk about Z, a real-time strategy game from the mid-’90s.

Continue reading "On Confidence and Real-Time Strategy Games"

Bundler Best Practices

Chris Jones
Chris Jones, Developer, February 25, 2011

Bundler is a great tool to have in the Ruby toolbox, but it's also a bit mysterious to some developers. "Oh cool, I put my gems in this file, bundle install, and that's it. Wait, what's this Gemfile.lock thing? Should that go in my repo? What's the difference between bundle install and bundle update? How do I install my gems when I deploy? Where are my pants?" Let's take a tour of Bundler and find the answers to some of these questions.

Continue reading "Bundler Best Practices"

We're the Developers

at Viget Labs. We write about web development trends, tips, best practices, industry events, and our projects — all with an emphasis on Ruby on Rails.

Upcoming Events

Future Insights Live - April 29 to May 4
Future of Web Apps, Future of Web Design, Future of Mobile, and Future of Web in the Enterprise have joined forces to bring you our most comprehensive event EVER!

Contact Us

Have any questions, comments, ideas, or secrets to share? Let us know.


What color is the sky?

Sorry, you need to have Javascript enabled to use this form. (Don't blame us, blame the spammers!) If you'd like to contact us, please visit our Contact page.