Building Front-End Standards from the Ground Up

This article caters to individuals gearing up to lay the foundations for front-end specifications. 🚀
1. Why standards are needed
What benefits can norms bring us, and what are the consequences if there are no norms? Here we mainly focus on code specifications.
Benefits of unified code standards:
Enhance code quality 🌟: Boost readability, maintainability, reusability, portability, and reliability, leading to a significant reduction in development costs.
Ensure coding consistency 🤝: Consistent coding styles make the code more maintainable and easily understandable for the entire team.
Boost team efficiency 🚀: Adhering to specifications minimizes time spent on addressing code quality issues, fostering early issue detection or prevention and enhancing overall delivery efficiency.
Mitigate disputes in code review 🤔: Having standards reduces conflicts during the review process, fostering smoother collaboration and minimizing arguments.
Lack of unified code standards can lead to:
Divergent code styles 🤷♂️, causing a mental burden on team members and potential code ownership issues (Shit Mountain 💩).
Challenging inter-team collaboration 🤝 due to differing styles, hindering efficiency and teamwork.
Excessive discussions in code reviews 🗣️, arising from the absence of standards.
Impaired productivity and quality 📉, risking team harmony and overall performance.
2. Why do many teams still lack standards?
Reaching consensus on this issue poses a significant challenge. Merely having specifications isn’t sufficient:
🕒 Tight deadlines often lead developers to prioritize speed over quality standards.
🤷♂️ Some team members resist changing their habits for the greater good.
🤝 Agreements made in meetings may not always translate into consistent actions afterward.
3. How to maintain standards
- Conduct inductive analysis on normative issues and document the findings (e.g., in a wiki) to explore industry-best solutions and foster unity within the team.
- Embrace an incremental approach, solving issues as they arise. Prioritize and categorize problems based on their importance, addressing a few in each iteration.
- Ensure that specification issues for the current iteration are promptly resolved to prevent accumulation (though, occasionally, compromises with the project manager may be necessary 😮💨).
- Maintain strict control over the code review process, refusing to turn a blind eye.
- Promptly discuss and reach conclusions when team members have disputes about specific specifications.
- Remember, rules are not just for the sake of having rules. The purpose of establishing norms is not necessarily to strictly adhere to a particular standard but rather for team members to reach a consensus.
- Encourage everyone to boldly question existing rules. Rules should be subject to scrutiny if they fail to enhance the readability, maintainability, reusability, portability, and reliability of the code.
- Lead by example, ensuring that the direction of the ship’s bow remains steady.
After two months of iteration, it was found that the effect was surprisingly good👏. Everyone’s awareness of norms has generally increased. When encountering normative issues, they no longer shrink back, but boldly raise them for discussion in the group.
4. Norms that developers need to establish and abide by
It can be roughly divided into the following directions:
- Development process specifications
- Code specifications
- git commit specification
- Project file structure specification
- UI design specifications
Development Process Specifications
A well-defined development process ensures a smooth project lifecycle. Incorporate these norms:
Task Management: Use dedicated tools (e.g., Jira, Trello) for efficient task tracking and prioritization.
Agile Methodology: Implement agile practices to foster iterative development and continuous improvement.
Regular Standup Meetings: Conduct daily standup meetings to enhance team communication and coordination.
Code Specifications
Consistent coding styles enhance readability and collaboration. Establish and adhere to these coding standards:
Naming Conventions: Maintain consistency in naming variables, functions, and classes.
Indentation and Formatting: Agree on coding conventions for indentation and formatting (e.g., tabs or spaces).
Comments: Encourage meaningful comments for complex code sections to aid understanding.
Git Commit Specification
A standardized approach to Git commits ensures a clear version history. Follow these norms:
Commit Messages: Compose clear and concise commit messages explaining the purpose of changes.
Branching Strategy: Define a branching strategy (e.g., Gitflow) for organized feature development.
Pull Request Guidelines: Establish guidelines for creating and reviewing pull requests.
Project File Structure Specification
A well-organized file structure simplifies navigation. Define a structure that makes sense for your project:
Root Directory: Keep the root directory clean, placing configuration files and documentation at the top level.
Module Organization: Organize code into modules or components for easy accessibility.
Assets and Resources: Clearly define directories for assets, resources, and external libraries.
UI Design Specifications
For projects involving user interfaces, design consistency is vital. Outline norms related to UI/UX:
Design Patterns: Follow established design patterns for a cohesive and user-friendly interface.
Responsive Design: Ensure UI elements adapt well to different screen sizes and devices.
Color and Typography: Set guidelines for consistent color schemes and typography choices.
By embracing and enforcing these norms, developers contribute to a collaborative and efficient development environment, paving the way for a successful project.
5. Summary
The primary goal of standardized specifications is to foster team member consistency, ultimately lowering communication costs and enhancing development efficiency.
Embrace standards, but keep them flexible. If the specifications you establish aren’t effective for your team, be ready to adjust and rewrite any rules as needed. The intention is not to impose a rigid way of working but rather to facilitate smooth interaction between teams 👏👏👏.






