The hottest Substack posts of Stateless Machine

And their main takeaways
3 HN points 18 Jul 24
  1. Unit tests should not interact with anything outside the program. This keeps tests clean and focused just on the code being tested.
  2. To make testing easier, functions should use interfaces to handle outside interactions. This allows for fake implementations during testing.
  3. By controlling how the outside world is accessed in a programming language, tests can be made deterministic. This means results are reliable and consistency is ensured.
0 implied HN points 11 Jul 24
  1. Having a good boss is harder than having good coworkers because you usually only have one boss. With colleagues, you can mix and match different relationships, but there’s less room to do that with your boss.
  2. Relationships with peers often feel like a trade-off. You help each other out, creating a sense of teamwork, while the boss-employee relationship can lack that mutual support.
  3. A boss may not have strong incentives to be a great leader. They prioritize their own goals, which may not align with making you happy, so it can be tough to expect them to act like a supportive figure.
0 implied HN points 10 Jul 24
  1. There’s a debate about whether using an ORM is beneficial or not. Some people think it’s unnecessary and prefer to write SQL directly.
  2. ORMs and raw SQL both try to solve similar problems but don’t actually provide a true 'mapping' between objects and database queries.
  3. Query builders can be a good compromise, allowing easier SQL query creation while helping with the mapping between database and code.