Skip to content
Navigation Menu
Sign in
Products
Platform
GitHub
Repository hosting, code review, and collaboration
Copilot
AI coding agent for tasks, projects and automated work
Build & Ship
Actions
CI/CD and automation
Code Quality
Quality analysis, fixes, and enforcement
Codespaces
Cloud development environments
Secure
Code Security
Vulnerability detection and remediation
Secret Protection
Secret scanning and leak prevention
All Features
Developers
Learn
Documentation
Training
Certifications
Build
Build with Copilot
Customize Copilot
Integrations
Explore
Trending repos
GitHub Sponsors
Events
Changelog
Changelog
Your source for the latest features, improvements, and fixes across GitHub products, all in one place.
Businesses
By Stage
Enterprises
Team
Startups
Nonprofits
By Industry
Healthcare
Financial services
Manufacturing
Government
See all industries
Evaluate GitHub
Why GitHub
Customer Stories
Business insights
Trust Center
Add-ons
GitHub Advanced Security
Enterprise-grade code security
Copilot for business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Resources
Learn & Connect
Documentation
Resource center
Blog
Events & webinars
Community Forum
Customer Stories
Integrations
Support
Customer support
Training
GitHub Status
Company
About
Partners
Changelog
GitHub Universe
GitHub Universe
The event for developers, by developers — talks, workshops, and what’s next for GitHub.
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
sevenjay
sevenjay.github.io
Repository navigation
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
More
items
Coding Principle
Jump to bottom
Edit
New page
jay.chang edited this page
Apr 24, 2019
·
1 revision
title: Sevenjay's Coding Principle
可讀性的程式優於快速的程式
除了程式可容易閱讀之外,必定要寫註解
不確定使用方法就別用
盡量用你知道最安全的方法
可重複使用的程式碼就不要複製貼上,獨立出來
命名要有原則
除了為了註解跟可讀性,盡量讓程式簡潔
使用己經過標準驗證的,比如使用STL,atoi(),不要用itoa
不要忽視warning
使用版本控制
不要的程式不要只是mark掉
不要相信使用者及預設的環境,assert它或處理它。
使用日誌(log)工具來隨時追蹤跟診斷。
謹慎的使用任何型別轉換,比如int跟long int在各平台上不一定大小相同。
OOP Principle
減少使用Global Variable(Singleton也是),除非在multi-thread才使用Singleton管理共同存取的單一資源。
Wiki pages
Pages
6
Loading
Home
Uh oh!
There was an error while loading.
Please reload this page
.
Loading
0. Markdown test
Uh oh!
There was an error while loading.
Please reload this page
.
Loading
C++ Standard
Uh oh!
There was an error while loading.
Please reload this page
.
Loading
Coding Principle
title: Sevenjay's Coding Principle
OOP Principle
Loading
Coding Style
Uh oh!
There was an error while loading.
Please reload this page
.
Loading
hackmd
Uh oh!
There was an error while loading.
Please reload this page
.
Add a custom sidebar
Clone this wiki locally
You can’t perform that action at this time.