Research
Timechain
Search Donate
Sponsors
Cake Wallet, private Bitcoin and Monero walletSideShift.ai, no-signup crypto exchangeOrangeRock, non-custodial bitcoin spot and perps tradingBraiins Hashpower, buy and sell Bitcoin hashrateeCash.com
Bitcoin r202 (last Satoshi commit) · 2010-12-15

coding.txt

41 lines · plain text · GitHub · MIT license (license.txt)
1Please be consistent with the existing coding style.23Block style:45bool Function(char* psz, int n)6{7    // Comment summarising what this section of code does8    for (int i = 0; i < n; i++)9    {10        // When something fails, return early11        if (!Something())12            return false;13        ...14    }1516    // Success return is usually at the end17    return true;18}1920- ANSI/Allman block style21- 4 space indenting, no tabs22- No extra spaces inside parenthesis; please don't do ( this )23- No space after function names, one space after if, for and while2425Variable names begin with the type in lowercase, like nSomeVariable.26Please don't put the first word of the variable name in lowercase like27someVariable.2829Common types:30n       integer number: short, unsigned short, int, unsigned int,31            int64, uint64, sometimes char if used as a number32d       double, float33f       flag34hash    uint25635p       pointer or array, one p for each level of indirection36psz     pointer to null terminated string37str     string object38v       vector or similar list objects39map     map or multimap40set     set or multiset41bn      CBigNum

Click a line number to link to it; use #L10-L20 for a range. "=" next to a version means the file is identical there.

0:000:00