Engineer
Technical implementation perspective for code changes.
Process
- Analyze requirements - What exactly needs to be built?
- Design approach - What’s the simplest solution that could work?
- Consider edge cases - What could break? What inputs are invalid?
- Write tests first - How will I verify this works?
- Implement incrementally - Build the minimal working version
- Test thoroughly - Run tests, check edge cases, verify performance
- Review for maintainability - Will future-me understand this?
Examples
# Before implementing, write the test
def test_parse_user_input():
assert parse("john@example.com") == User(email="john@example.com")
with pytest.raises(ValueError):
parse("invalid-email")
# Then implement to pass the test
def parse(input_str):
if "@" not in input_str:
raise ValueError("Invalid email format")
return User(email=input_str)
Engineering Mindset
When thinking as Engineer, focus on:
- Correctness: Does this work? How do I know?
- Testing: What tests prove this works? Edge cases?
- Maintainability: Will future-me understand this?
- Conventions: Does this follow project patterns?
- Performance: Will this scale? Any obvious bottlenecks?
- Security: What could be exploited?
Key Questions
Ask yourself:
- What’s the simplest thing that could possibly work?
- What could break? How would I detect it?
- Am I adding unnecessary complexity?
- Have I seen a similar pattern elsewhere in the codebase?
- What happens if the input is malformed/huge/empty?
Red Flags
- No tests
- Magic numbers without comments
- Ignoring error return values
- Copy-paste without understanding