Hacky Friday Stuff #13.12.2019
Tags: ruby, rails, javascript, fridaystuff
Published: 2019-12-13 14:21:52

*Links about web development, product engineering, tools and services from all over the internet.*

[Crystal 0.32.0 released](https://crystal-lang.org/2019/12/11/crystal-0.32.0-released.html)
This release comes with consistencies, happiness, improvements in std-lib and tools, and important changes in concurrency.

[Rails 6 adds ability to block writes to a database](https://blog.saeloun.com/2019/12/10/rails-block-writes-to-database-connection-while-prevent-writes)
Rails 6 introduced a new functionality to configure and manage multiple databases in our application.

[Ruby 2.7 adds shorthand syntax for arguments forwarding](https://blog.saeloun.com/2019/12/04/ruby-2-7-adds-new-operator-for-arguments-forwarding.html)

[Clever code is bad. Don't write clever code](https://guifroes.com/clever-code-is-bad/amp/)
“Wait! Isn’t code supposed to be smart? Programming IS hard! We have to be smart!” 
Nope.
Code is supposed to be simple. And programming is no place for being a smart-ass. Let me explain.

### Articles and tutorials

[To Domain Driven Design](https://dev.to/kmruiz/to-domain-driven-design-6ao)
Your company is built on top of a monolith. Your monolith is slow, opaque, error prone, not tested. Your developers and sysops teams are afraid of releasing new code, so they end up building and defining heavy process and long release cycles with long manual testing processes.
However, the monolith is still there, generating most of your revenue, but also chokes teams performance. How do you improve your main revenue source and also optimize teams for long-term predictability and evolution of your business? Here is where DDD comes in handy.

[From ActiveRecord Callbacks to Publish/Subscribe Pattern and Event-driven Design](https://karolgalanciak.com/blog/2019/11/30/from-activerecord-callbacks-to-publish-slash-subscribe-pattern-and-event-driven-design/)
Imagine that you are working on a large legacy application that also contains the dreaded ActiveRecord callbacks in the models handling most of the business logic. At some point, and under a certain level complexity, the mess caused by that choice might become hard to keep under control, the risk of introducing bugs will increase and the teams(s) working on the application will be way less productive. 
The solution would be to move to Publish/Subscribe pattern and in general, to take advantage of the event-driven design.

[Continuous Deployment With GitLab, Docker And Heroku](https://alediaferia.com/2019/12/07/continuous-deployment-gitlab-docker-heroku/)
Continuous Deployment refers to the capability of your organisation to produce and release software changes in short and frequent cycles.
In this article we’re gonna explore how to leverage tools like GitLab Pipeline, Heroku and Docker to achieve a simple continuous deployment pipeline.

### Frontend

[Thinking in React Hooks](https://wattenberger.com/blog/react-hooks)
> React introduced hooks one year ago, and they've been a game-changer for a lot of developers. There are tons of how-to introduction resources out there, but I want to talk about the fundamental mindset change when switching from React class components to function components + hooks.

[Overpacking: A Common Webpacker Mistake](https://rossta.net/blog/overpacking-a-common-webpacker-mistake.html)
How to save 6 minutes in a Rails team's deploy time.

[How to Use New CSS “:is()” for Easy Element Targeting](https://webdesign.tutsplus.com/articles/new-css-is-for-easy-element-targeting--cms-34223)
The new CSS `:is()` pseudo-class is shaping up to become a great way to target elements, saving on lines and lines of code, and keeping CSS as readable as possible. It is the next stage of the evolution of `:matches()` and `:any()`, adding a little extra functionality and increasing how semantic and intuitive the language behind selectors is.

[I created the exact same app in React and Svelte. Here are the differences.](https://medium.com/javascript-in-plain-english/i-created-the-exact-same-app-in-react-and-svelte-here-are-the-differences-c0bd2cc9b3f8)
React vs Svelte. Finally, a side-by-side code comparison! Because you’ve heard the fuss about Svelte, and now you want to know what the hype is all about.

### Gems, libraries, tools

[dry-validation](https://github.com/dry-rb/dry-validation/releases/tag/v1.4.0)
A new version 1.4.0 just released.

[rom-factory](https://github.com/rom-rb/rom-factory)
Data generator with support for persistence backends. Released with v0.10.0.

[fyne](https://github.com/fyne-io/fyne)
Cross-platform GUI in Go based on Material Design.
Version 1.2 is the current release that added support for iOS and Android devices as well as providing much simpler ways to write custom widgets.

### Videos

[RubyConf 2019 - Containerizing Local Development... Is It Worth it? by Tony Drake](https://www.youtube.com/watch?v=NZ02hy6QOOk&feature=youtu.be)
Containers are the current hotness for deployment. But, how about development? They can provide a good way to manage local dependencies even if you're just writing a gem instead of an app. While writing and running code directly on your laptop has its own obstacles, using containers for development is not a silver bullet and brings along its own set of headaches. Which cases do containers make sense and how would they be configured? 

### Podcasts

[Full Stack Radio. 130: David Khourshid - Building Better UI Components with State Machines](http://www.fullstackradio.com/130)
In this episode, Adam talks to David Khourshid about using state machines to build UI components that are simpler and more resilient to bugs.

[Code[**ish**]. 47. Working with an Event-Driven Architecture](https://www.heroku.com/podcasts/codeish/47-working-with-an-event-driven-architecture)
On this episode Alexey Syomichev talks with host Robert Blumen about enterprise architecture organized around an immutable event log. The discussion covers the notion of events - what are they, what do they contain, event data, event schema, event formats.

[dev(up); Pair Programming with Ben Oreinstein](https://www.developingup.com/episodes/48)
Development is not an individual activity, it is a team activity. To grow your development skills and knowledge you need to be able to work collaboratively with other developers.  In this episode, we discuss methods developers can use for implementing pair programming and the benefits it has for individuals and teams.