CodeStandard/C++.txt
2024-06-07 20:00:25 +03:00

35 lines
1.2 KiB
Plaintext

Upgrade code: 7E57EE0B-9FF4-4A12-9776-B5B7FBBC803E
00. give maximum info to compiler
01. express intent
02. const correctness - values, refs, in-build types
03. full logic (dont skip else after return)
04. skip control block if possible
05. use reference for polymorphism
06. pointer is a nullable reference
07. use smart pointers for ownership
08. use RAII for cleanup on errors
09. dont =delete move ctor (delete copy ctor instead)
10. auto stick and auto deduce!
11. west const
12. noexcept false if noexcept was considered and discarded
13. use algorithm and numeric instead of loops
14. maybe unused to combat assert warnings in realease build
15. nodiscard if function doesnt mutate any state
16. mark unreachable code to draw attention
17. dont use && and || to compose differenet semantic checks!
18. dont bundle return points together!
19. dont mix virtual inheritance and MFC classes
Èìåíîâàíèå èäåíòèôèêàòîðîâ ðåñóðñîâ
IXTRAD - àññîöèàöèè ôàéëîâ, ìåíþ è èêîíîâ äëÿ òèïîâ äîêóìåíòîâ
IXTRR - èêîíêè, êàðòèíêè, êóðñîðû è ïðî÷
IXTRC - êîììàíäû, êîíòðîëû
IXTRD - äèàëîãè
IXTRE - ñîîáùåíèÿ îá îøèáêà
IXTRS - ñòðîêè
IXTRO - èìåíà ïàðàìåòðîâ â ðååñòðå
ID, IDC, AFX - èäåíòèôèêàòîðû MFC