2008. 10. 24. 23:02 :: Code Convention
1. Comments의 분류
Comment는 Block Comments와 End-line Comment로 분류.
1.1 Block comments 사용 경우
- File의 시작
- Function definition의 시작
- Statement 앞
- Declaration등이 grouping이 가능한 경우
- Pseudo-code로 algorithm을 기술하는 경우 등
1.2 End-line comments 사용 경우
- Data declaration & definition
- Block의 끝 (예: for, while, if등의 compound statement의 길이가 길 때)
- #endif
- File의 시작
- Function definition의 시작
- Statement 앞
- Declaration등이 grouping이 가능한 경우
- Pseudo-code로 algorithm을 기술하는 경우 등
1.2 End-line comments 사용 경우
- Data declaration & definition
- Block의 끝 (예: for, while, if등의 compound statement의 길이가 길 때)
- #endif
2. Prologue
소스파일, 헤더파일, makefile 등의 파일 맨 앞부분에 붙여준다
소스파일, 헤더파일, makefile 등의 파일 맨 앞부분에 붙여준다
2.1 Prologue 내용
- Project name (Project 일 경우)
- Copyright or Copyleft 에 대한 내용
- File name
- 작성자에 대한 정보
- revision (수정 정보)
- 그외의 정보
- Copyright or Copyleft 에 대한 내용
- File name
- 작성자에 대한 정보
- revision (수정 정보)
- 그외의 정보
2.2 Prologue 예시
/*
* Project Name : _______
*
* Copyright _year 저작권자__
* ___저작권에 관한 내용_____
*
* author : 작성자
* File Name : 파일이름
* Revision History : 수정된 정보
* Project Name : _______
*
* Copyright _year 저작권자__
* ___저작권에 관한 내용_____
*
* author : 작성자
* File Name : 파일이름
* Revision History : 수정된 정보
(Date, ver, Name, Description)
Description : 파일 관련정보
*/