Dev DNA
This is my Dev DNA: the path that shaped how I build. I used to share it at the end of Le Wagon, and I still send it when students, juniors, or mid-level folks ask how to go further in Ruby and Rails. It’s biased towards software engineering on the Rails stack. Build things. Make a mess. Learn from it.
The golden advice
Build things. If you’re practicing by yourself, find a problem you want to solve. Be it a page component in which you have interest (e.g.: a navbar that hides on a threshold) or an entire, but simple, app (e.g.: a downscaled Evernote clone), it’s important to have clear goals and to be able to see the results of your work as you try new things. In the words of Sandi Metz: Go ahead, make a mess. The way to write good code is paved by lots and lots of bad code.
Courses
UPCASE - by thoughtbot (partially free)
You folks probably heard me talk about thoughtbot enough already, but, geez! Their UPCASE platform is not suggested enough! It’s the platform they use for training their teams internally. And they release most (if not all) of its content for FREE. I’m still going through their courses myself and I fully recommend you folks checking it out.
If you’re interested in learning TDD, check their testing section for 3 entire courses on the subject and many The Weekly Iteration episodes (a weekly program of them) on it.
Learn Enough (partially free)
If there were a Bicycle Science discipline, a lot of the academic approach towards it would be:
We’ll teach you the intricacies of chain-driven sprockets and tension-spoked wheels before you get to ride that thing.
And, shockingly, you’d fall the first time you tried riding that bike. Michael Hartl is a strong name in the Ruby community, and his approach is learn enough. Learn enough, try things, learn more as you go. Great way of learning, and my suggested way as well.
Books
Yeah yeah… you can read articles and tutorials. But nothing beats an actual book if you want to connect with your forebearers.
💚 Starter Books
99 Bottles of OOP: A Practical Guide to Object-Oriented Design (~$39 or free)
The book is free if you can’t afford it and send the author a “proper postcard”. Thank you, Rachel, for the tip.
I used to suggest Sandi Metz’s POODR as the first read after Wagon. But 99 Bottles of OOP (which she wrote with Katrina Owen) beats it now by a mile as an introductory material to OOP (object oriented programming), being a lot more practical and easy to follow for a beginner in both Ruby and OOP.
Ruby Science (free)
A bit of a recipe book released for free by the thoughtbot team. Read the summary and intros and maybe glance at it from cover to cover. But the important thing is to keep it nearby.
Are you wondering how to cleanup your controller or all those messy validations on your model? How to validate a form object? You’ll find here some of the best ways to leverage the power of Ruby and Rails to your advantage.
Eloquent Javascript (free)
It’s a thorough guide on JS. You can start by reading the first 10 chapters, which will give you the brunt and basics of the language. Chapter 11 can be a rough introduction to asynchronous programming, but it’s needed if you want to build advanced front end interfaces (a basic level is enough for most projects). In any case, read this if you’re interested in leveraging the best JS to offer and upscale your front end code.
💛 Mid level Books
Practical Object-Oriented Design in Ruby (~ $15 - $25)
Another entry from Sandi Metz. It’s packed full of content worth years of experience for the road ahead of you. It’s likely you won’t be able to apply most of it on your first projects, or worse, it’s likely that your first tries to follow into Metz’s steps are going to lead you to code that was better off before your refactoring attempts. But… DO READ IT. And DO MAKE A MESS of your code. The only way to learn how to write good code is write a lot of bad code first. The lessons you learn here are going to follow you for your whole career and they will eventually fall into place, giving you a much clearer perspective on how to approach complex problems.
❤️ Advanced Books
Design Patterns: Elements of Reusable Object-Oriented Software (~ $25)
Another recipe book. THE recipe book when it comes to design patterns. Written by the Gang of Four. Its examples are for JAVA and SmallTalk, but the structure of the patterns is agnostic and can be applied in any language. I often find myself searching through it and reviewing the implementation of my classes, trying to identify the best to solve the specific pain I have.
🖤 Dangerous Books
Metaprogramming Ruby (~ $25)
Wanna learn some spells? Here’s your book. Metaprogramming is one of the most controversial subjects you can find, and it’s arguably one the strongest super-powers of Ruby. But, as they say, those come with great responsibilities. You’ll either find yourself writing amazing code with it, or the kind of arcane scribblings for which your coworkers will hate you. It’s a great read since, despite the advanced and confusing subject, Perrotta managed to write the book as, believe it or not, an engaging story about your day job.
This book is also suggested as study material by Ruby Association if you ever want to study to get yourself a Gold Certification.
Ruby Under a Microscope (~ $20 - $40)
So… classes are actually instances of… themselves(?), and an instance doesn’t inherit directly from its class? And classes are not actually classes? Yeah. Most of what you hear as you’re starting with Ruby is just an elaborate lie to simplify things. They’re abstractly true, and help you think and talk about code seamlessly, but, under a microscope, things are a lot more complicated and weird. Interesting read that will help you solve the pesky problems you hope you’ll never have.
🎙️ Talks and Conferences (That Changed My Way of Thinking)
All the Little Things by Sandi Metz @ RailsConf 2014
The power of Object Oriented Programming lies in familiarity. The classes we deal with are sometimes incredibly abstract and difficult to grasp, and bad code is often a result of the failure to correctly comprehend what we are actually dealing with. In this talk Sandi Metz takes a very messy code example and slowly refactors it until it feels like what it should have been all along. The process by which she does it is an amazing example of how to go about refactoring code that you don’t even understand to begin with.
In Relentless Pursuit of REST by Derek Prior @ RailsConf 2017
This is one of the most eye opening talks I’ve ever seen about Rails. It gives you a deeper understanding of the RESTFUL pattern which will open your eyes for a much better pattern by which to organize your routes and actions. This is one of the most sorely missed skills I find even in senior developers and it’s not a huge technical leap to have this understanding. I suggest you watch it sooner rather than later and your apps will be enormously better for it.
Other Resources
Hotwire
Rails’ paradigms can change from version to version. The newest is Hotwire, which replaces a lot of the need for javascript controllers that request HTML via ajax, which can now be delivered through a websocket. This is the best guide I’ve found about it.
💻 How to build an App in a week
An amazing podcast episode with Ben Orenstein about building an app in a week.
📊 Refactoring Guru - Design Patterns
Offers a softer introduction to design patterns, with a very illustrated and exemplified approach. Haven’t checked their book, but if it has the same level of care as their site it should be amazing.
🛤️ Rails Doctrine
Worth a read. Understanding the principles behind Rails’ decisions helps you make much better use of its tools. You get into the proper mindset and stop fighting the system.
💎 Ruby Tapas
Short weekly screencasts for Ruby tricks.
📚 Book and Courses Recommended by Plataformatec (Full list below)
That’s the checklist you receive in order to join plataformatec (creator of devise and simpleform). Some repetition from the stuff above, but I chose to keep it exactly as they sent it to me.
Ruby / Rails / OOP
- Book Practical Object-Oriented Design in Ruby
- Book 99 Bottles of OOP: A Practical Guide to Object-Oriented Design
- Guide Action Controller Overview
- Guide Rails Routing from Outside in
REST / Microserviços
- Book REST - Casa do Código (Portuguese)
- Book Building microservices
SQL
- Course Learn SQL
Tests
- Guide A Guide to Testing Rails Applications
- Article The Forgotten Layer of the Test Automation Pyramid
- Article Test Case Paths: Happy, Sad & Bad
- Course Rails Testing da Code School
- Book Rails 4 Test Prescriptions
- Book Cucumber e RSpec
- Talk Pirâmide de testes repensando a sua estrátegia e tática de testes (Portuguese)
Git
- Guide How to write a Git Commit Message
- Article 5 Useful Tips for a Better Commit Message
- Article Keep your commits “atomic”