Update style guide #10461
pull sipa wants to merge 1 commits into bitcoin:master from sipa:stylish changing 1 files +34 −11-
sipa commented at 10:53 pm on May 26, 2017: memberAs discussed in this week’s IRC meeting.
-
Update style guide 47d8441466
-
sipa force-pushed on May 26, 2017
-
fanquake added the label Docs and Output on May 26, 2017
-
dcousens approved
-
paveljanik approved
-
practicalswift commented at 3:01 pm on May 29, 2017: contributor
ACK 47d8441
Very good! Thanks for clarifying!
-
in doc/developer-notes.md:36 in 47d8441466
39+ separate words. 40+ - Class member variables have a `m_` prefix. 41+ - Global variables have a `g_` prefix. 42+ - Constant names are all uppercase, and use `_` to separate words. 43+ - Class names, function names and method names are CamelCase. Do not prefix 44+ class names with `C`.
luke-jr commented at 6:23 pm on May 29, 2017:Why not prefix class names withC
? -
sipa commented at 6:29 pm on May 29, 2017: memberIt is always obvious from the usage that a name refers to a class and not a function/method, so no need to repeat that information in the name.
-
luke-jr commented at 6:39 pm on May 29, 2017: memberIs it?
function(0, class())
seems fairly non-obvious. -
gmaxwell commented at 8:13 am on May 30, 2017: contributorSeems fine to me.
-
in doc/developer-notes.md:35 in 47d8441466
38+ - Variable and namespace names are all lowercase, and may use `_` to 39+ separate words. 40+ - Class member variables have a `m_` prefix. 41+ - Global variables have a `g_` prefix. 42+ - Constant names are all uppercase, and use `_` to separate words. 43+ - Class names, function names and method names are CamelCase. Do not prefix
jonasschnelli commented at 8:41 am on May 30, 2017:Not sure if we had a discussion about that already: I often saw projects where the static class methods and global space functions where inUpperCamelCase()
while the class methods where inlowerCamelCase()
and I think this is useful. But no strong opinion.
laanwj commented at 2:56 pm on May 31, 2017:Except for the qt code, this just documents the style already in use. So while this sounds sensible for a new project, I don’t think we should change this now. -
jonasschnelli commented at 8:41 am on May 30, 2017: contributorACK 47d84414662c09bc08cfc96f78457ddd602a20ac
-
in doc/developer-notes.md:10 in 47d8441466
9-to clean up the patch automatically before submitting a pull request. 10+a single style, which is specified below. When writing patches, favor the new 11+style over attempting to mimick the surrounding style, except for move-only 12+commits. 13+ 14+Do not submit patches solely to modify the style of existing code.
laanwj commented at 2:58 pm on May 31, 2017:Thanks for adding this explicitly :+1: -
laanwj commented at 2:59 pm on May 31, 2017: memberutACK 47d8441
-
laanwj merged this on May 31, 2017
-
laanwj closed this on May 31, 2017
-
laanwj referenced this in commit 55b72f3880 on May 31, 2017
-
jtimon commented at 11:31 pm on June 1, 2017: contributorACK
-
sipa deleted the branch on Jun 23, 2017
-
PastaPastaPasta referenced this in commit e8d0f826c9 on Aug 17, 2019
-
PastaPastaPasta referenced this in commit 363fae27f0 on Sep 19, 2019
-
PastaPastaPasta referenced this in commit f8b494b8b7 on Sep 23, 2019
-
PastaPastaPasta referenced this in commit b32b6edd50 on Sep 24, 2019
-
PastaPastaPasta referenced this in commit ce50791755 on Nov 19, 2019
-
PastaPastaPasta referenced this in commit f943d95525 on Dec 9, 2019
-
PastaPastaPasta referenced this in commit 44fd3b8edf on Jan 1, 2020
-
PastaPastaPasta referenced this in commit 191a6d9431 on Jan 2, 2020
-
ckti referenced this in commit 07de8841b5 on Mar 28, 2021
-
gades referenced this in commit 1f4600e1dc on Jun 30, 2021
-
DrahtBot locked this on Sep 8, 2021