HOW TO BUILD SOFTWARE (MVP)

3. DEVELOPMENT

The Development phase is where your software vision starts to take shape and come to life. It’s the stage where your ideas and requirements are transformed into a functional product through coding, design, and integration. This phase encompasses several key activities, including writing and testing code, setting up development environments, and ensuring that the software meets its intended requirements.

3.1

VERSION CONTROL

3.2

CODING

3.3

INTEGRATION

 

3.1 VERSION CONTROL

KEY TERMS: repositories, git, github

"Version control enables creativity because it reduces the fear of making mistakes."

- Adam Barr

Version control acts as a safety net for managing changes in your code. Tools like Git, along with platforms like GitHub, is the go-to choice for both open-source and private software projects and are designed to make this process easier and more efficient. By using version control, you can track every change made to your code, collaborate with others seamlessly, and manage different versions of your project. This ensures that your codebase is organized, secure, and easy to manage, no matter how complex your project becomes.

Version control systems (VCS) act as a library and time vault for your digital assets, helping teams avoid conflicts and stay aligned. They are essential for fixing bugs and adding features without disrupting the live version, eliminating the need for manual versioning methods like saving multiple copies of files.


Icon_Bulb_Neon

tips & tricks


Commit code early and often to keep track of your progress and reduce the risk of losing work. Small, frequent commits make it easier to identify and fix issues, enable better collaboration with teammates, and simplify rollbacks if something goes wrong. This habit leads to a cleaner, more manageable codebase. 

repository basics

Repositories are like advanced folders that serve as time capsules for your code. When setting up repositories, it's important to choose the right level of granularity, balancing factors like function, required skills, relationships to other components, and release processes.

versioncontrol

There are different version control patterns that teams can adopt based on their needs.

Gitflow: This pattern uses two main branches—master (for deployable code) and develop (for ongoing development). Feature branches are created from the develop branch, and after the code is reviewed and tested, it's merged back into develop. When a release is ready, the develop branch is merged into master.

GitHub Flow: A simpler pattern that uses only a single master branch. Development happens in feature branches, which are merged into master after being reviewed.

Here are the key tasks you'll need to familiarize yourself with.

Setting Up Repositories
  • Create a new repository or clone an existing one to organize and store your project's code.
  • Define the structure and organization of the repository to suit the project's needs.
Branching
  • Create branches to develop new features, fix bugs, or experiment without affecting the main codebase.
  • Name branches clearly to indicate their purpose (e.g., feature-login, bugfix-header).
Committing Changes
  • Save changes to your local branch by making commits with descriptive messages explaining what was changed and why.
  • Commit frequently to ensure small, manageable updates that are easier to review.
Merging
  • Combine changes from different branches, usually by merging a feature branch into the main branch (e.g., master or develop).
  • Resolve any conflicts that arise during merging to ensure a smooth integration.
Pull Requests (PRs)
  • Submit pull requests to propose changes from one branch to another, typically reviewed by team members before merging.
  • Use PRs to discuss code changes, suggest improvements, and ensure quality.
Reviewing Code
  • Review code changes made by others in the team, providing feedback or requesting further changes if necessary.
  • Ensure code quality and consistency before approving and merging PRs.
Tagging Releases
  • Create tags in the repository to mark specific points in the project history, often used to identify releases (e.g., v1.0.0).
  • Tags help in tracking versions and rolling back to previous states if needed.
Reverting Changes
  • Roll back changes if something goes wrong, either by reverting specific commits or resetting branches to a stable state.
  • Ensure that any issues introduced by recent changes are quickly addressed.
Collaborating and Syncing
  • Pull the latest changes from the remote repository to stay updated with the work of other team members.
  • Push your commits to the remote repository to share your work with the team.
Managing Conflicts
  • Identify and resolve conflicts that occur when two or more developers make conflicting changes to the same part of the codebase.
  • Carefully review and test the code after resolving conflicts to ensure stability.
Maintaining the Repository
  • Clean up outdated branches, tags, and unnecessary files to keep the repository organized and efficient.
  • Ensure that the repository remains secure and accessible only to authorized team members.

In Summary:

  • Create or clone repositories to organize your project's code, and define their structure based on project needs. Set up repositories with a clear structure to manage and organize your code effectively from the start.

  • Use branches to develop features, fix bugs, or experiment without affecting the main codebase. Create and name branches to separate different types of work, ensuring the main codebase remains stable.

  • Make frequent commits with descriptive messages to document changes and keep updates manageable. Commit changes regularly with clear messages to track progress and make it easier to understand modifications.

  • Merge changes from different branches and resolve conflicts to ensure smooth integration into the main codebase. Integrate code from various branches and address any conflicts to maintain a cohesive and functional codebase.

  • Submit pull requests for code reviews, discussion, and quality checks before merging changes into the main branch. Use pull requests to facilitate peer reviews, discussions, and ensure code quality before final integration into the main branch.