This week in #devs - Issue #2

Welcome to the second issue of “This week in #devs”, a series of posts where we share articles, thoughts, and conversations that happen in our #devs channel on Slack.

Oct 14th, 2024
By SINAPTIA

Our #devs channel is a cross-project, shared space where the entire dev team of SINAPTIA can ask questions, share opinions, and discuss interesting articles or tech they come across. The idea is to post a curated extract of what happens there every week.

Rails data migrations

Fernando shared news regarding Rails 8: new script folder and generator. Rails 8 introduces a new script folder dedicated to holding one-off or general-purpose scripts, such as data migrations, cleanup tasks, or other utility operations. This addition helps organize these scripts neatly, keeping them separate from your main application logic.

This news triggered a conversation about how we handled data migrations in the past. Patricio shared his experience with using the standard migration approach for handling data migrations in Rails applications. He mentioned that while it works well for simple cases, more complex scenarios can become cumbersome and difficult to manage. In those cases, he used rake tasks or scripts to complete the data migrations. A couple of alternative solutions were shared:

Finally, Fernando shared an interesting thread about Patterns for Data-Only Rails Migrations from the Rails discourse.

Git Stash

Diego asked a question about git stash. He accidentally dropped his stash by running git stash drop, and wanted to know if he could recover his changes. Patricio suggested using the reflog (git reflog) to see if he could recover something from there but unfortunately, deleted stashed changes are not recoverable. This triggered other developers to suggest how they normally stash their changes:

  • Fernando avoids using git stash; instead, he commits his changes. He argues that having a single git workflow is much simpler and benefits from leaving messages to himself in his git commits.
  • Julián uses git stash, but suggests never dropping: use git stash pop instead.
  • Esteban joked about saving the diff in a notepad 😂

AI Coding Assistants

Diego shared this interesting article about AI coding assistants: A study suggests these tools don’t increase coding speed. On the contrary, they led to a 41% increase in bugs, raising concerns about code quality.

That’s it for this issue. See you around next week!