Rails is an MVC framework. In small applications logic can be split between the model, view and controller layers. As applications grow many developers choose to introduce a service layer. The benefit of adding a service layer is that it can help you control your fat models.
Being unbusy is hard. Those of us who have goals and ambitions are constantly trying to cram more into the day in order to be more productive. But being unbusy is important, it allows for deep thinking and reflection. Being unbusy gives us time to clarify our thoughts and form opinions. Being unbusy gives us the opportunity to plan and solve problems.
Occasionally when I’m writing a new migration I encounter a strange error where models are not behaving as they should. I usually encounter the problem with large Rails apps that have a long history of migrations.
The symptom of the problem is that a model object returns nil for an attribute even though I have set the attribute and saved the record. When investigating the situation with pry I find that the model is missing a number of fields!
The problem is that the information Rails holds in memory, about the model, has become out of date. You can reset the cache using reset_column_information:
I’ve ditched my apple watch.
I had most of the notifications turned off and it had become a dumb watch. A dump watch that needed charging every night.
It was no longer adding value to my life so I searched for something new.
I found something that had a 2 year batter life and cost just £40. A swatch watch
Many professions have a checklist. Doctors and pilots are both highly skilled jobs that use checklists in order to minimise errors. As developers we have many things to keep in our heads and anything that we can offload to a checklist seems like a win.
Here is a checklist that I use for reviewing pull requests:
A typical Ruby program runs sequentually in a single thread, no two things can happen in parallel, everything happens one after the other. Multithreading allows you to execute different parts of the program simultaneously.
What benefit does this provide? Why would a programmer what write multithreaded code?
This post describes the basics of an agile workflow. The focus of agile is to produce working software. Agile involves the end user so that you build the software that they want. Agile adapts to change by dealing with small units of work and not planning too far ahead.
In short, agile avoids the waterfall problem of spending 6 months building a product that nobody wants.
The basis of most agile teams is the sprint. Sprints are typically 1 week or 2 weeks long. In order to start a sprint, a team needs to estimate their work and decide how much of it to put into their sprint.
To do that, we need to talk about sprint planning, estimating and velocity…