RSSAmplifier

Blog

Bartosz Krajka

Personal blog

bartoszkrajka.comRSS feed ↗10 posts

Latest posts

Friendship ended with RVM, now rbenv is my best friend

After about 10 years, I had to break up with RVM mostly because a third party (Claude Code) wouldn’t cooperate. RVM works through shell functions. When you install it, it wraps your cd command with a custom function that checks .ruby-version on every directory change. This only works in interactive shells that have loaded [ ]

webfilterproxyd causes bundler SSL errors

So, I had this ongoing issue with bundler: TL;DR I asked Claude Code to fix that for me and, quite surprisingly, it did. The culprit was webfilterproxyd which macOS sets up for when you enable web content filtering (in System Settings). I ve seen plenty of resources about bundler SSL errors, but I haven t found any [ ]

Bad modules, good modules

Is this a good module or not? My answer: can t tell. It depends on how the module interacts with other modules. What would make it a bad module? 1. Plenty of deps 2. A sibling module If there is many deps but from a limited number of modules, that s still a bad design but with [ ]

How to write tests

First realize what constitutes good tests. The answer: little (ideally: zero) false positives. Feel free to read my previous article that elaborates on this topic. But how exactly? Here is my answer: 1. Avoid false positives That s tautological, but has to be said. Anything that can lead to false positives has to be reduced [ ]

Tests should give confidence

This is the most important, yet the most unspoken trait of good tests. Tests should be the oracle. If all tests are green the app will work on prod. If at least one test is red the app won t work. Think Continuous Delivery. Every step in the process has to be automated. When [ ]

The simplest dependency injection

Consider a method that calculates some ETA: Notice how add3WorkingDays depends on the time when it s called (result is initially now). Because of that, you d have trouble writing reliable unit tests for this. My recommendation: change the implicit dependency of now to explicit one and inject it: It takes only so much to implement dependency [ ]

Don’t automate everything. Go Elon instead.

If you automate everything you end up with cargo-cult of your process. What you should do instead is employing Elon s 5 steps protocol ( the Algorithm ) that consists of in order: Always. In. That. Order. If you automate something that meets unnecessary requirements you re doing it wrong. If you automate something that shouldn t even exist [ ]

Unit tests can (and should!) go through many classes

We often design our code so that one procedure comprises many classes, often grouped by layers. For example, in web dev, that could be controllers, models, repositories, etc: Layers are good. Often at least two layers are desirable for maintainability: domain and low-level. If you re like me, you like 2-5 layers but not too many. [ ]

Making sense is overrated

Test first? How do I test something that is not yet written? And before all, why? It makes no sense. Try it a few times and you ll see how powerful it is! Open–closed principle? The more I close my code to modification, the more closed it gets for extention. You can t have both. It makes [ ]

Consistency in Programming – 10 Symptoms [CliftonStrengths #5]

There it is. 5th and the last theme. Crave for clear rules , as the official description says. What kind of rules could it be that I crave? What challenges can the rules bring? Consistency as a programmer 10 symptoms 1. Process is good Processes have negative connotations. They are on the right side of [ ]