Suggestions
Beth Andres-Beck
Senior Software Engineer at OneMedical Group
Beth Andres-Beck is a seasoned full-stack developer with over fifteen years of experience, specializing in producing efficient and reliable code to tackle complex challenges. With a strong background in Agile methodologies, they excel in team management and facilitation. Beth is passionate about working in diverse and inclusive teams, particularly at organizations with a focus on feminism and representation in leadership positions. Their career has seen them contribute to various high-profile companies, continuously evolving their skills and honing their expertise in software development.
Highlights
There are three ways programming tools may be of exponential value:
- When they let non-programmers build useful programs (like Excel and Salesforce)
- When they let people who are not yet net-productive software developers contribute to collaboratively-built software while learning the trade (like pair programming and frameworks)
- When they let expert developers reliably reason about larger, more complex systems than could be previously reasoned about (like OO and automated testing)
None of these make programming exponentially faster, but they can still create exponential value. The first means software where the economics don't work can still exist. The second creates more developers, who can then in turn create more developers. The third makes software projects that were previously impossible possible.
So far, the LLM-based programming tools aren't any of these. That doesn't mean they aren't useful: it just means they are useful on the scale that a faster keyboard could be useful, rather than creating massive value.
Even after twenty years of coding professionally, I constantly find refinements and new patterns.
In just the last few months, I figured out how to write tests to make cleaning up dark-launch feature flags graceful:
- Add a context where the feature-flag is “off”.
- Copy-paste the existing tests under that new context
- Remove any tests that should no longer pass after the feature flag launches from the outer context
- Initialize the feature flag to “on” for all other test.
- Go ahead and start implementation by adding your first test for the new behavior in the top-level context.
Now, as long as the tests are green and you don’t change the pre-existing tests you won’t break the existing contract when the feature flag rolls out.
If the flag rolls out, the cleanup for the feature flag is now graceful:
- Delete the test context where the feature flag is “off”
- Delete the conditional logic (conveniently, that will be the bits of the code the tests no longer run)
- Delete the method that checks the feature flag
This way, even your test clean up can be TDDed!
If you instead need to remove the new logic & a simple revert is insufficient, there are a few extra steps:
- Delete all the tests for the unwanted behavior that should never happen again
- Initialize the feature flag to false for the entire test
- Inline the now-redundant “when TheFeatureFlag is off” context
- Remove any duplicate tests
- Delete the conditional logic
- Delete the code that checks the feature
The problem with nesting both the old and new behavior under their own contexts is that it produces diffs with a bunch of indentation changes, making it harder for readers to verify the change. Additionally, it means that unexpected changes to other parts of the contract could go unnoticed, because the unit’s other tests are only run in one of the two states. In this case, using copy-paste leads to more graceful code, rather than less.
