Facebook Roadmap to Impact Notes
Introduction
Module Objectives:
- Explain how to approach a large programming project and build an execution plan.
- Understand how to execute on a plan and create focused, self-contained pieces.
- Learn how to write readable, maintainable code.
How to approach a large programming project?
- Clarify the goals (Description: You understand very clearly what the goals of the project are. It should be very high-level goals, not related to specific code. Who will benefit from the result and what is the impact?)
- What am I trying to do?
- What does success look like?
- Why do we want to accomplish this project? What is the impact?
- Investigate the existing code(Description: In real industry, it is very rare to start from scratch. Read documentation and code relevant to the system, have a general picture of the project on how components work together.)
- How much do I need to understand in order to achieve my goals?
- What is the code doing now?
- Is there documentation for this system?
- How does the data/flow get from point A to point b?
- Understand what needs to change (Description: Fixing a bug -> find out which part work not as expected. New feature -> where to integrate with existing code)
- What should the code be doing that it isn’t doing?
- Which pieces will be different?
- What will be the most challenging piece to modify?
- Review related solutions(Description: Very few solutions are completely novel, reuse existing code. e.g. Login service)
- Have other people faced similar problems?
- How does related team X do it?
- What open source projects might be relevant?
- Create a plan to achieve the goals(Description: Now you have an overview of what you want to do, and what resources you have
- How will I get from where the code is now to where it needs to be?
- What needs to change first
- Which classes do I need to touch?
- What experiments do I need to run?
- How will I know that my solution works?
Exercise:
- Clarify the goals - What accessibility challenges do our users have?
- Investigate the existing code - How is the user interface currently created?
- Understand what needs to change - Which pieces need to change to make our front-end more accessible?
- Review related solutions - How have others made their products more accessible?
- Create a plan to achieve the goals - How will I know that my front-end is accessible?
Executing the Plan
- Prioritization
- In order to achieve the goal, which piece of work are most important or must come first?
- Put aside the details and focus on the bigger picture
- In order to achieve the goal, which piece of work are most important or must come first?
- Break up large diffs
- One and ONLY one thesis per diff
- But not TOO small
- Gate the code
- Different reviewers, different diffs
- Separate risky diffs
- Separate logically independent changes
- Separate refractoring and logic changes
- One and ONLY one thesis per diff
- Include a test plan
- The test plan should be repeatable.
- The test plan should include step-by-step instructions.
- The test plan should document any pre-requirements(like gating of features)
- The test plan should actually test the code.
- The test plan should be automated when possible.
- Consider what types of tests are most appropriate
Writing readable, maintainable code
- Be consistent.
- Follow the style guide.
- Keep lines short. (80characters)
- Add appropriate documentation
- Decide if you need abstraction
- Incorporate feedback from others
Getting Unstuck: Finding Code
Getting stuck is a normal part of the software engineering process, at all levels of experience.
Objectives:
- Learn strategies for getting unstuck
- Understand when to ask questions and how to ask questions effectively.
Identify the scope of the problem
- What should the code do?
- How do I find the code?
- How do I do this?
- Why doesn’t this work?
What should the code do?
- Understand the big picture
- Communicate with stakeholders.
- Drive decisions.
- Code wins arguments.
- Prepare for the future.
How do I find the code?
- Understand the architecture.
- Search the codebase for keywords.
- Check the developer tools.
- Read code!
- Make small changes to observe their impact.
Getting Unstuck
How do I do this?
- Divide work into diff-sized chunks
- Learn from existing code.
- Get feedback from teammates
- Done is better than perfect.
- Ask questions.
Why doesn’t this work?
- Verify assumptions.
- Checkpoint progress.
- Step through the code.
- Print all the things!
- Ask questions.
Ask Questions Effectively
When to ask?
- After you’ve done your due diligence
- When you’re not making progress
- When it would save time
How to ask?
- Pick the right medium.
- Provide context.
- Explain what you tried already.
- Level up your questions.
- Spread the knowledge.