Hereās my take. In order to be able to write meaningful unit tests the code should be structured in a certain way, with very modular, decoupled units, dependency injection, favoring composition and polymorphism over inheritance and so on.
If you manage to write your code this way it will be an objective advantage that will benefit the project even if you donāt write a single unit test. But it does make unit tests much easier to write, so presumably youāll end up with more tests than otherwise.
IMO teams should prioritize this way of writing code over high test coverage of non-modular code. Unit tests for deeply-coupled code are a nightmare to write and maintain and are usually mostly meaningless too.
Basically: The game is Cataclysm: Dark Days Ahead. For those not aware of how the game works, it operates in turns, with every character and monster getting 100 turns to perform actions before the other creatures in the game get theirs. Each action takes a set amount of turns, and you can take actions until your 100 turns are used. So walking a tile might take 80 turns, and running that same tile 40, giving you an extra tile before the other creatures get to go.
What happened here is, a commit changed how limb breaks affect turns, but didnāt put a maximum cap. Meaning that players would spend 0 turns moving. If you donāt spend any turns, other things in the game never get theirs. In other words, time stops for everyone but you.
Not testing is crazy. Once you realize you can actually refactor without ever having the fear youāve broken something, thereās actually opportunity to make rapid improvments in structure and performance. Taking 2 minutes to write the test can save your hours of debugging. Unless youāre building a throwaway prototype, not unit testing is always the wrong choice.
On a serious note, I love cooking and washing and cleaning. Iām not staring at a screen and the objective is clear.
Iām not contemplating whether this is worth my time or stressed about other things. Although, I donāt cook for many people so I guess my outlook would be different in those cases.
The difference is, in the job interview youāre writing it from scratch yourself. On the job you have to take over from the guy who left 10 years ago and that button was designed in such a way that resizing it will add garbage data to all tables in the database and also send an email to all your customers telling them to switch providers.
programmer_humor
Active
This magazine is from a federated server and may be incomplete. Browse more on the original instance.