일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
- oh-my-zsh
- VSCode
- sealize
- angular
- hashchange
- 자바스크립개념
- ChangeDetectorRef
- Visual Studio Code
- Git
- fromEvent
- 변화감지
- Ionic
- NVM
- angular5
- border-width
- zsh
- JavaScript
- ion-range
- typescript
- change detection
- 테두리굵기
- IONIC3
- error
- getElementsByClassName
- Sentry
- php
- aab 배포
- code .
- 이미지바꾸기
- rxjs
- Today
- Total
목록book/The Practice of Programming (6)
hsunny study blog
Don't belabor the obvious. BAD CASE /* n default */ default: break; /* return SUCCESS */ return SUCCESS; zerocount++; /* Increment zero entry counter */ /* Initialize "total" to "number-received" */ node->total = node->number-recei ved ; ▲ All of these comments should be deleted; they're just clutter. Comments shouldn't report self-evident information. Comment functions and global data. Global v..
Magic number Magic number -> constants, array sizes, character positions, conversion factors, and other literal numeric values that appear in programs. Give names to magic numbers. raw number in program source gives no indication of its importance or derivation, making the program harder tounderstand and modify. Define numbers as constants, not macros. in C: #define int MAXROW = 24. MAXCOL = 80;..
There is a tendency among older C programmers to write macros instead of functions for very short computations that will be executed frequently; Avoid function macros. In C++, inline functions render function macros unnecessary; in Java, there are no macros. Parenthesize the macro body and arguments. WORD Parenthesize 괄호 안에 넣다 sanction 인가하다, 승인하다 irrelevant 무관한 outweigh ~보다 더 크다 subtle 미묘한 disca..
Use a consistent indentation and brace style Use idioms for consistency W O R D parentheses 괄호omit 빠뜨리다, 누락시키다, 생략하다dangling ~을 안달복달하게 하다exemplify 예를 들다idiom 관용구, 숙어
Indent to show structure.BAD CASEfor(n++;n
Use descriptive names for globals, short names for locals. Common name for local * for loop indices : i, j*for pointer: p, q*for string: s, t Be consistent. BAD CASEclass UserQueue {int noOfIternsInQ, frontOiTheQueue, queuecapacity;public int noOfUsersInQueue() {...}...} why?Because queues can only be accessed from a variable of type UserQueue. So, member names don't need to mention "queue" at a..