Riot Control

Pure Functions

While learning scala/clojure and functional programming I have come across a very familiar concept: pure functions. It reminds me of an interactor, but I feel that is much more valuable as a concept. The wikipedia says that a function may be considered pure if:

Practical Object-Oriented Design in Ruby

Pratical Object-Oriented Design in Ruby by Sandi Metz

This is one of my favorite Ruby books ever. It is very well written and a joy to read. I highly recommend this book.

So, why is software design so important?

When starting a new software application you have certain requirements. You analise these requirements, build your software and it works. As time goes by, those requirements will change and you will need to refactor your code. If you have a good design architecture, with loosely coupled classes, refactoring your code to meet the new requirements is easy. Otherwise, it will be very painful to make changes.

Confident Code

In Paulo’s post about presenters and views, he talked about how to make the view free of business logic. This is confident coding. The following talk shows this in a wider perspective. Not only for views/presenters, but for all code.

Are your methods timid? Do they constantly second-guess themselves, checking for nil values, errors, and unexpected input? Even the cleanest Ruby codebases can become littered over time with nil checks, error handling, and other interruptions which steal attention away from the essential purpose of the code. This talk will discuss strategies for writing your Ruby classes and methods in a confident, straightforward style; without sacrificing functionality or robustness. In the process, we’ll cover concepts and techniques points including: The narrative style of method construction The four parts of a method Three strategies for dealing with uncertain input Massaging input with coercion and the Decorator pattern Lightweight preconditions Exterminating nils from your code The chaining and iterative styles of method construction Eliminating conditionals with the Special Case and Null Object patterns Isolating errors with the Bouncer and Checked Method patterns

Development by Copy Paste

I believe that development by copy paste is the worst work process that a programmer may have. I’m talking about having a piece of software working, and copying it fully to another location on the same project, and performing some changes.

Why Work Doesn’t Happen at Work

Most people still think that the office is the best place to get work done. They think that a bunch of people need to be in the same room for great things to happen. Well, let me tell you that the office is full of distractions. In this short video, Jason Fried will tell you why work doesn’t happen at work. I guarantee you that these will be the best 15 minutes of your day. Enjoy!

http://www.ted.com Jason Fried has a radical theory of working: that the office isn’t a good place to do it. At TEDxMidwest he lays out the main problems (call them the M&Ms) and offers three suggestions to make work work. TEDTalks is a daily video podcast of the best talks and performances from the TED Conference, where the world’s leading thinkers and doers give the talk of their lives in 18 minutes. Featured speakers have included Al Gore on climate change, Philippe Starck on design, Jill Bolte Taylor on observing her own stroke, Nicholas Negroponte on One Laptop per Child, Jane Goodall on chimpanzees, Bill Gates on malaria and mosquitoes, Pattie Maes on the “Sixth Sense” wearable tech, and “Lost” producer JJ Abrams on the allure of mystery. TED stands for Technology, Entertainment, Design, and TEDTalks cover these topics as well as science, business, development and the arts. Closed captions and translated subtitles in a variety of languages are now available on TED.com, at http://www.ted.com/translate. Watch a highlight reel of the Top 10 TEDTalks at http://www.ted.com/index.php/talks/top10

The Almighty Interactor

The concept of the interactor is the biggest breakthrough that I have experienced in my evolution as a programmer. It’s simple, and it has always been right beside me. But I have only acknowledged it when I saw Arquitecthure: the lost years.

The concept is very simple. An interactor is:

Refactoring Views With Presenters (Ruby on Rails)

In a Ruby on Rails application, views can get really messy over time. They tend to grow into large files with if else blocks scattered all over the place.

Lately I’ve been working on an existing application with views like these. My goal was to remove all the logic from the views into presenters, making the views smaller, more readable and easier to maintain.

Architecture: The Lost Years

Robert C. Martin (Uncle Bob) has been a software professional since 1970. In the last 40 years, he has worked in various capacities on literally hundreds of software projects. He has authored “landmark” books on Agile Programming, Extreme Programming, UML, Object-Oriented Programming, C++ Programming and Clean Code. He has published dozens of articles in various trade journals. Today, he is one of the software industry’s leading authorities on Agile software development and is a regular speaker at international conferences and trade shows. He is a former editor of the C++ Report and writes regular blogs at http://cleancoder.posterous.com/.