拔牙后可以吃什么食物| 什么是指标| 樱桃和车厘子有什么区别| 常吃南瓜子有什么好处和坏处| 牙疼吃什么药止痛快| 什么是乳腺结节| 拍立得相纸为什么这么贵| 扭转乾坤是什么生肖| 小白和兽神什么关系| gamma什么意思| 猫怕什么声音| 电商五行属什么| 验血能查出什么| 印度为什么叫阿三| 孕中期失眠是什么原因| 梦见屎是什么预兆| 健康证什么时候可以办| 儿童肠系膜淋巴结炎吃什么药| 隐性基因是什么意思| 胰腺炎为什么喝水就死| 佐匹克隆片是什么药| 龟奴是什么| 尿浑浊是什么病的前兆| 画眉是什么| 长期做梦是什么原因| 乳杆菌是什么| 为什么手会不自觉的抖| 什么的怀抱| 放量十字星是什么意思| 北京豆汁什么味道| 暴饮暴食会得什么病| 吃什么补钾快| 什么叫尿毒症| 用盐刷牙有什么好处和坏处| 诺丽果有什么功效| 人的血压一天中什么时候最高| 检查幽门螺旋杆菌挂什么科| 达泊西汀是什么药| 阿尔茨海默症是什么| 绿色通道是什么意思| 一月二十五号是什么星座| 发现新大陆是什么意思| 过期的咖啡有什么用途| 脚气是什么菌引起的| 向日葵代表什么意思| 为什么韩国叫棒子国| 星标朋友是什么意思| 气滞血瘀吃什么食物好| 血小板低是什么症状| 蹂躏是什么意思| 脚肿挂什么科| 私通是什么意思| 济公搓的泥丸叫什么| 吃皮蛋有什么好处和坏处| 未加一笔是什么字| 吃什么补蛋白质| 红细胞偏低是什么意思| 日本是什么时候投降的| 黄酮对女性有什么作用| 五月二十一是什么星座| 吃什么主食减肥最快| pe什么材质| 金牛座前面是什么星座| 什么鱼不能吃脑筋急转弯| 鱼香肉丝属于什么菜系| 营养素是什么| 大麦茶是什么做的| 木耳不能和什么食物一起吃| 梦见石榴是什么意思| 唐筛临界风险是什么意思| 什么是热射病| 骨钙素低是什么原因| 刚愎自负是什么意思| 水命和什么命最配| 干贝是什么| 乳晕是什么| 晚上睡觉放屁多是什么原因| 佩戴貔貅有什么讲究与禁忌| cea检查是什么意思| 白头发缺什么维生素| 教师节属什么生肖| 中出是什么意思| 天蝎座后面是什么星座| 湛江有什么好玩的| 心脏变大是什么原因| 哺乳期感冒能吃什么药| 千娇百媚是什么意思| 刮痧出痧说明什么| 婴儿口水多是什么原因| 日语一库一库是什么意思| 做梦梦到钱是什么预兆| 别致是什么意思| 盐酸西替利嗪片主治什么| 法国货币叫什么| 牧师是什么意思| 伤元气是什么意思| 此地无银三百两什么意思| 摘环后需要注意什么| 808什么意思| 什么奶粉跟母乳一个味| 做梦笑醒了有什么征兆| 梦见一个小男孩是什么意思| 指什么门| 庄周梦蝶是什么意思| 西芹和芹菜有什么区别| 黑色是什么颜色组成的| 7月20是什么星座| 似水年华是什么意思| 益生菌是什么东西| 忌诸事不宜什么意思| 异国风情是什么意思| vae是什么意思| 茉莉花茶是什么茶| 保健是什么意思| 柠檬加蜂蜜泡水喝有什么功效| hpc是什么意思| 人参果什么季节成熟| 内热吃什么药清热解毒| 茯苓的作用是什么| 心脏缺血吃什么药| 人为什么会焦虑| 官杀旺是什么意思| 18k金是什么| 狙击蟹吃什么| 实相是什么意思| sc1是什么意思| 什么是蜘蛛痣| 12月1日是什么意思| 长春都有什么大学| 布洛芬什么时候起效| 老年人适合吃什么| 什么负什么名| 肠系膜淋巴结肿大吃什么药| 吃头孢不能吃什么水果| 疝气是什么原因引起的| 来例假头晕是什么原因| 血红蛋白高是什么意思| 查抗体是做什么检查| hpv阳性是什么病| 脾的主要功能是什么| 茯苓不能和什么一起吃| 中药是什么| 吐黄痰是什么原因| 肝主筋的筋是指什么| 实字五行属什么| 雌激素过高吃什么药| 吃什么药不能喝酒| 尼日利亚说什么语言| 小便尿不出来什么原因| 一什么蝉| 石榴木命是什么意思| 嗜酸性气道炎症是什么意思| 安大爷是什么意思| 甘草是什么| 可小刀是什么意思| 嘴里起血泡是什么原因| 糖尿病可以吃什么肉| 孩子为什么长不高| 自然流产是什么症状| 什么品牌的母婴用品好| 淋巴结在什么位置| 牙齿咬不动东西是什么原因| 师长是什么军衔| 相什么并什么| 晚上吃芒果有什么好处和坏处| 木加号读什么| 燊是什么意思| yeezy是什么牌子| 98年属相是什么| 玻璃什么时候传入中国| 2月4号是什么星座| 弱水是什么意思| 什么是同素异形体| b27是什么检查| 吃什么能美白| 胆囊挂什么科| 水滴鱼长什么样子| 痤疮涂什么药膏| 知己是什么意思| 隔应是什么意思| 梦到很多蛇是什么意思| 亭亭净植的亭亭是什么意思| 一什么无| 肺脓肿是什么病严重吗| 头顶发热是什么原因| 梦见楼塌了是什么意思| 波长是什么| 气短是什么症状| 液化是什么意思| 湿气是什么意思| 大肝功能是检查什么| 雨水是什么季节| 永加一个日念什么| 为什么会得焦虑症| 朱元璋是什么朝代| 二百五是什么意思| 历年是什么意思| 洋葱有什么功效与作用| 女人得性瘾什么症状| 吃什么补脾胃| 林格液又叫什么| 拔罐对身体有什么好处和坏处| 查肾挂什么科| 淀粉在超市里叫什么| 什么是it行业| 股骨头疼痛什么原因| 什么生辉| 灰太狼是什么意思| 龟苓膏是什么做的| 眼力见是什么意思| 手心发热什么原因| 记性不好吃什么药| 蛇进家是什么意思| 去离子水是什么水| 3月7号什么星座| 倾城是什么意思| 黑鱼不能和什么一起吃| 婴儿黄疸母亲忌口什么| 慈禧属什么生肖| 什么睡姿对髋关节好| 狗什么东西不能吃| 人乳头瘤病毒是什么意思| 张牙舞爪是什么意思| 宫颈炎用什么药| 孕妇吃什么蔬菜对胎儿好| 嘴唇淡紫色是什么原因| 掉以轻心是什么意思| phr是什么词性| 整编师和师有什么区别| 大便秘结是什么原因| 胆小如鼠是什么生肖| 吃什么对痔疮好得快| 不可磨灭是什么意思| 肝功能查什么| 好看是什么意思| 偏头疼吃什么药好| 血糖高做什么运动好| 阴茎发麻是什么原因| 钾血症是什么病| 不言而喻的喻是什么意思| 秋季养胃吃什么好| 为什么会胃疼| 槟子是什么水果| mbti测试是什么| 精神卫生科看什么病| 膝盖痒是什么原因| 誉之曰的之是什么意思| 女生为什么会痛经| 尿蛋白高是什么原因引起的| 上海最高楼叫什么大厦有多少米高| 双肺门不大是什么意思| 什么叫撤退性出血| 子宫前位什么姿势易孕| 蜜蜡五行属什么| 红烧肉配什么菜好吃| 大四什么时候毕业| 闪光点是什么意思| 脚浮肿是什么原因引起的| 天秤和什么星座最配| 煮虾放什么调料| 怀孕后吃避孕药有什么后果| 口甘读什么| zara是什么牌子| 2007属什么生肖| 百度

网友给贵州省委书记留言获回复 共计32条

Indentation

百度 天津泰凡科技有限公司CEO贾勇哲带队研发的基于“大数据应用分析及可视化平台”核心技术产品,开创了多种“大数据应用解决方案”,并形成了一批自主知识产权和技术转化成果,公司2018年预期收入约1200万元。

Use spaces, not tabs. Tabs should only appear in files that require them for semantic meaning, like Makefiles.

The indent size is 4 spaces.

Right:
int main()
{
    return 0;
}
Wrong:
int main() 
{
        return 0;
}

The contents of namespaces should not be indented.

Right:
// Document.h
namespace WebCore {

class Document {
    Document();
    ...
};

namespace NestedNamespace {

class OtherDocument {
    OtherDocument();
    ...
};

}

} // namespace WebCore

// Document.cpp
namespace WebCore {

Document::Document()
{
    ...
}

namespace NestedNamespace {

OtherDocument::OtherDocument()
{
    ...
}

} // namespace NestedNamespace

} // namespace WebCore
Right:
// PrivateClickMeasurementDatabase.h
namespace WebKit::PCM {

class Database {
    ...
};

} // namespace WebKit::PCM
Wrong:
// Document.h
namespace WebCore {

    class Document {
        Document();
        ...
    };

    namespace NestedNamespace {
    ...
    }

} // namespace WebCore

// Document.cpp
namespace WebCore {

    Document::Document()
    {
        ...
    }

} // namespace WebCore

A case label should line up with its switch statement. The case statement is indented.

Right:
switch (condition) {
case fooCondition:
case barCondition:
    i++;
    break;
default:
    i--;
}
Wrong:
switch (condition) {
    case fooCondition:
    case barCondition:
        i++;
        break;
    default:
        i--;
}

Boolean expressions at the same nesting level that span multiple lines should have their operators on the left side of the line instead of the right side.

Right:
return attribute.name() == srcAttr
    || attribute.name() == lowsrcAttr
    || (attribute.name() == usemapAttr && attribute.value().string()[0] != '#');
Wrong:
return attribute.name() == srcAttr ||
    attribute.name() == lowsrcAttr ||
    (attribute.name() == usemapAttr && attr->value().string()[0] != '#');

Spacing

Do not place spaces around unary operators.

Right:
i++;
Wrong:
i ++;

Do place spaces around binary and ternary operators.

Right:
y = m * x + b;
f(a, b);
c = a | b;
return condition ? 1 : 0;
Wrong:
y=m*x+b;
f(a,b);
c = a|b;
return condition ? 1:0;

Place spaces around the colon in a range-based for loop.

Right:
Vector<PluginModuleInfo> plugins;
for (auto& plugin : plugins)
    registerPlugin(plugin);
Wrong:
Vector<PluginModuleInfo> plugins;
for (auto& plugin: plugins)
    registerPlugin(plugin);

Do not place spaces before comma and semicolon.

Right:
for (int i = 0; i < 10; ++i)
    doSomething();

f(a, b);
Wrong:
for (int i = 0 ; i < 10 ; ++i)
    doSomething();

f(a , b) ;

Place spaces between control statements and their parentheses.

Right:
if (condition)
    doIt();
Wrong:
if(condition)
    doIt();

Do not place spaces between the name, angle brackets and parentheses of a function declaration or invocation.

Right:
f();
void g() { ... }
h<int>();
Wrong:
f ();
void g () { ... }
h <int> ();

Do not place spaces between the parenthesis and its parameters, or angle brackets and its parameters of a function declaration or invocation.

Right:
f(a, b);
void g(int a) { ... }
h<int>();
Wrong:
f( a, b );
void g( int a ) { ... }
h< int >();

Do not place spaces between square brackets, angle brackets and parentheses of a lambda function but do place a space before braces.

Right:
[](int x) { return x; }
[this] { return m_member; }
[=]<typename T> { return T(); }
[&]<typename X>(X parameter) { return parameter; }
Wrong:
[] (int x) { return x; }
[this]{ return m_member; }
[=] <typename T> { return T(); }
[&]<typename X> (X parameter) { return parameter; }

Do not place spaces between the identifier template and its angle brackets.

Right:
template<typename T> T foo();
template<typename U> struct Bar { };
Wrong:
template <typename T> T foo();
template <typename U> struct Bar { };

When initializing an object, place a space before the leading brace as well as between the braces and their content.

Right:
Foo foo { bar };
Wrong:
Foo foo{ bar };
Foo foo {bar};

In Objective-C, do not place spaces between the start of a block and its arguments, or the start of a block and its opening brace. Do place a space between argument lists and the opening brace of the block.

Right:
block = ^{
...
};

block = ^(int, int) {
...
};

Wrong:
block = ^ {
...
};

block = ^ (int, int){
...
};

In Objective-C, do not place a space between the type name and the protocol name.

Right:
id<MTLDevice> device = ...;
Wrong:
id <MTLDevice> device = ...;

Line breaking

Each statement should get its own line.

Right:
x++;
y++;
if (condition)
    doIt();
Wrong:
x++; y++;
if (condition) doIt();

Chained = assignments should be broken up into multiple statements.

Right:
rightSpacing = totalSpacing / 2;
leftSpacing = rightSpacing;
Wrong:
leftSpacing = rightSpacing = totalSpacing / 2;

An else statement should go on the same line as a preceding close brace if one is present, else it should line up with the if statement.

Right:
if (condition) {
    ...
} else {
    ...
}

if (condition)
    doSomething();
else
    doSomethingElse();

if (condition)
    doSomething();
else {
    ...
}
Wrong:
if (condition) {
    ...
}
else {
    ...
}

if (condition) doSomething(); else doSomethingElse();

if (condition) doSomething(); else {
    ...
}

An else if statement should be written as an if statement when the prior if concludes with a return statement.

Right:
if (condition) {
    ...
    return someValue;
}
if (condition) {
    ...
}
Wrong:
if (condition) {
    ...
    return someValue;
} else if (condition) {
    ...
}

Braces

Function definitions: place each brace on its own line.

Right:
int main()
{
    ...
}
Wrong:
int main() {
    ...
}

Other braces: place the open brace on the line preceding the code block; place the close brace on its own line.

Right:
class MyClass {
    ...
};

namespace WebCore {
    ...
}

for (int i = 0; i < 10; ++i) {
    ...
}
Wrong:
class MyClass 
{
    ...
};

One-line control clauses should not use braces unless comments are included or a single statement spans multiple lines.

Right:
if (condition)
    doIt();

if (condition) {
    // Some comment
    doIt();
}

if (condition) {
    myFunction(reallyLongParam1, reallyLongParam2, ...
        reallyLongParam5);
}
Wrong:
if (condition) {
    doIt();
}

if (condition)
    // Some comment
    doIt();

if (condition)
    myFunction(reallyLongParam1, reallyLongParam2, ...
        reallyLongParam5);

Control clauses without a body should use empty braces:

Right:
for ( ; current; current = current->next) { }
Wrong:
for ( ; current; current = current->next);

Any empty braces should contain a space.

Right:
void f() { }
struct Unit { };
union Unit { };
class Unit { };
enum Unit { };
int x { };
auto a = [] { };
while (true) { }
Wrong:
void f() {}
struct Unit {};
union Unit {};
class Unit {};
enum Unit {};
int x {};
auto a = [] {};
while (true) {}

Null, false and zero

In C++, the null pointer value should be written as nullptr. In C, it should be written as NULL. In Objective-C and Objective-C++, follow the guideline for C or C++, respectively, but use nil to represent a null Objective-C object.

C++ and C bool values should be written as true and false. Objective-C BOOL values should be written as YES and NO.

Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons.

Right:
if (condition)
    doIt();

if (!ptr)
    return;

if (!count)
    return;
Wrong:
if (condition == true)
    doIt();

if (ptr == NULL)
    return;

if (count == 0)
    return;

In Objective-C, instance variables are initialized to zero automatically. Don’t add explicit initializations to nil or NO in an init method.

Floating point literals

Unless required in order to force floating point math, do not append .0, .f and .0f to floating point literals.

Right:
const double duration = 60;

void setDiameter(float diameter)
{
    radius = diameter / 2;
}

setDiameter(10);

const int framesPerSecond = 12;
double frameDuration = 1.0 / framesPerSecond;
Wrong:
const double duration = 60.0;

void setDiameter(float diameter)
{
    radius = diameter / 2.f;
}

setDiameter(10.f);

const int framesPerSecond = 12;
double frameDuration = 1 / framesPerSecond; // integer division

Names

Use CamelCase. Capitalize the first letter, including all letters in an acronym, in a class, struct, protocol, or namespace name. Lower-case the first letter, including all letters in an acronym, in a variable or function name.

Right:
struct Data;
size_t bufferSize;
class HTMLDocument;
String mimeType();
Wrong:
struct data;
size_t buffer_size;
class HtmlDocument;
String MIMEType();

Use full words, except in the rare case where an abbreviation would be more canonical and easier to understand.

Right:
size_t characterSize;
size_t length;
short tabIndex; // more canonical
Wrong:
size_t charSize;
size_t len;
short tabulationIndex; // bizarre

Data members in C++ classes should be private. Static data members should be prefixed by “s_”. Other data members should be prefixed by “m_”.

Right:
class String {
public:
    ...

private:
    short m_length;
};
Wrong:
class String {
public:
    ...

    short length;
};

Prefix Objective-C instance variables with “_”.

Right:
@class String
    ...
    short _length;
@end
Wrong:
@class String
    ...
    short length;
@end

Precede boolean values with words like “is” and “did”.

Right:
bool isValid;
bool didSendData;
Wrong:
bool valid;
bool sentData;

Precede setters with the word “set”. Use bare words for getters. Setter and getter names should match the names of the variables being set/gotten.

Right:
void setCount(size_t); // sets m_count
size_t count(); // returns m_count
Wrong:
void setCount(size_t); // sets m_theCount
size_t getCount();

Precede getters that return values through out arguments with the word “get”.

Right:
void getInlineBoxAndOffset(InlineBox*&, int& caretOffset) const;
Wrong:
void inlineBoxAndOffset(InlineBox*&, int& caretOffset) const;

Use descriptive verbs in function names.

Right:
bool convertToASCII(short*, size_t);
Wrong:
bool toASCII(short*, size_t);

The getter function for a member variable should not have any suffix or prefix indicating the function can optionally create or initialize the member variable. Suffix the getter function which does not automatically create the object with IfExists if there is a variant which does.

Right:
StyleResolver* styleResolverIfExists();
StyleResolver& styleResolver();
Wrong:
StyleResolver* styleResolver();
StyleResolver& ensureStyleResolver();
Right:
Frame* frame();
Wrong:
Frame* frameIfExists();

Leave meaningless variable names out of function declarations. A good rule of thumb is if the parameter type name contains the parameter name (without trailing numbers or pluralization), then the parameter name isn’t needed. Usually, there should be a parameter name for bools, strings, and numerical types.

Right:
void setCount(size_t);

void doSomething(ScriptExecutionContext*);
Wrong:
void setCount(size_t count);

void doSomething(ScriptExecutionContext* context);

Prefer enums to bools on function parameters if callers are likely to be passing constants, since named constants are easier to read at the call site. An exception to this rule is a setter function, where the name of the function already makes clear what the boolean is.

Right:
doSomething(something, AllowFooBar);
paintTextWithShadows(context, ..., textStrokeWidth > 0, isHorizontal());
setResizable(false);
Wrong:
doSomething(something, false);
setResizable(NotResizable);

Objective-C method names should follow the Cocoa naming guidelines — they should read like a phrase and each piece of the selector should start with a lowercase letter and use intercaps.

Enum members should use InterCaps with an initial capital letter.

Prefer const to #define. Prefer inline functions to macros.

#defined constants should use all uppercase names with words separated by underscores.

Macros that expand to function calls or other non-constant computation: these should be named like functions, and should have parentheses at the end, even if they take no arguments (with the exception of some special macros like ASSERT). Note that usually it is preferable to use an inline function in such cases instead of a macro.

Right:
#define WBStopButtonTitle() 
        NSLocalizedString(@"Stop", @"Stop button title")
Wrong:
#define WB_STOP_BUTTON_TITLE 
        NSLocalizedString(@"Stop", @"Stop button title")

#define WBStopButtontitle 
        NSLocalizedString(@"Stop", @"Stop button title")

Use #pragma once instead of #define and #ifdef for header guards.

Right:
// HTMLDocument.h
#pragma once
Wrong:
// HTMLDocument.h
#ifndef HTMLDocument_h
#define HTMLDocument_h

Ref and RefPtr objects meant to protect this from deletion should be named “protectedThis”.

Right:
RefPtr<Node> protectedThis(this);
Ref<Element> protectedThis(*this);
RefPtr<Widget> protectedThis = this;
Wrong:
RefPtr<Node> protector(this);
Ref<Node> protector = *this;
RefPtr<Widget> self(this);
Ref<Element> elementRef(*this);

Ref and RefPtr objects meant to protect variables other than this from deletion should be named either “protector”, or “protected” combined with the capitalized form of the variable name.

Right:
RefPtr<Element> protector(&element);
RefPtr<Element> protector = &element;
RefPtr<Node> protectedNode(node);
RefPtr<Widget> protectedMainWidget(m_mainWidget);
RefPtr<Loader> protectedFontLoader = m_fontLoader;
Wrong:
RefPtr<Node> nodeRef(&rootNode);
Ref<Element> protect(*element);
RefPtr<Node> protectorNode(node);
RefPtr<Widget> protected = widget;

Other Punctuation

Constructors for C++ classes should initialize all of their members using C++ initializer syntax. Each member (and superclass) should be indented on a separate line, with the colon or comma preceding the member on that line.

Right:
MyClass::MyClass(Document* document)
    : MySuperClass()
    , m_myMember(0)
    , m_document(document)
{
}

MyOtherClass::MyOtherClass()
    : MySuperClass()
{
}
Wrong:
MyClass::MyClass(Document* document) : MySuperClass()
{
    m_myMember = 0;
    m_document = document;
}

MyOtherClass::MyOtherClass() : MySuperClass() {}

Prefer index over iterator in Vector iterations for terse, easier-to-read code.

Right:
for (auto& frameView : frameViews)
    frameView->updateLayoutAndStyleIfNeededRecursive();

OK:

unsigned frameViewsCount = frameViews.size();
for (unsigned i = 0; i < frameViewsCount; ++i)
    frameViews[i]->updateLayoutAndStyleIfNeededRecursive();
Wrong:
const Vector<RefPtr<FrameView> >::iterator end = frameViews.end();
for (Vector<RefPtr<FrameView> >::iterator it = frameViews.begin(); it != end; ++it)
    (*it)->updateLayoutAndStyleIfNeededRecursive();

Omit parentheses for a C++ lambda whenever possible.

Right:
[this] { return m_member; }
[this]() mutable { return doWork(WTFMove(m_object)); }
Wrong:
[this]() { return m_member; }
[]() { return static_cast<unsigned>(-1); }

Only use the arrow for function return types if it allows you to omit redundant information.

Right:
int foo()
{
    ...
}
Wrong:
auto foo() -> int
{
    ...
}
Right:
auto Foo::bar() -> Baz
{
    ...
}
Wrong:
Foo::Baz Foo::bar()
{
    ...
}

Pointers and References

Pointer types in non-C++ code
Pointer types should be written with a space between the type and the * (so the * is adjacent to the following identifier if any).

Pointer and reference types in C++ code
Both pointer types and reference types should be written with no space between the type name and the * or &.

Right:
Image* SVGStyledElement::doSomething(PaintInfo& paintInfo)
{
    SVGStyledElement* element = static_cast<SVGStyledElement*>(node());
    const KCDashArray& dashes = dashArray();
Wrong:
Image *SVGStyledElement::doSomething(PaintInfo &paintInfo)
{
    SVGStyledElement *element = static_cast<SVGStyledElement *>(node());
    const KCDashArray &dashes = dashArray();

An out argument of a function should be passed by reference except rare cases where it is optional in which case it should be passed by pointer.

Right:
void MyClass::getSomeValue(OutArgumentType& outArgument) const
{
    outArgument = m_value;
}

void MyClass::doSomething(OutArgumentType* outArgument) const
{
    doSomething();
    if (outArgument)
        *outArgument = m_value;
}
Wrong:
void MyClass::getSomeValue(OutArgumentType* outArgument) const
{
    *outArgument = m_value;
}

#include Statements

All implementation files must #include config.h first. Header files should never include config.h.

Right:
// RenderLayer.h
#include "Node.h"
#include "RenderObject.h"
#include "RenderView.h"
Wrong:
// RenderLayer.h
#include "config.h"

#include "RenderObject.h"
#include "RenderView.h"
#include "Node.h"

All implementation files must #include the primary header second, just after config.h. So for example, Node.cpp should include Node.h first, before other files. This guarantees that each header’s completeness is tested. This also assures that each header can be compiled without requiring any other header files be included first.

Other #include statements should be in sorted order (case sensitive, as done by the command-line sort tool or the Xcode sort selection command). Don’t bother to organize them in a logical order.

Right:
// HTMLDivElement.cpp
#include "config.h"
#include "HTMLDivElement.h"

#include "Attribute.h"
#include "HTMLElement.h"
#include "QualifiedName.h"
Wrong:
// HTMLDivElement.cpp
#include "HTMLElement.h"
#include "HTMLDivElement.h"
#include "QualifiedName.h"
#include "Attribute.h"

Includes of system headers must come after includes of other headers.

Right:
// ConnectionQt.cpp
#include "ArgumentEncoder.h"
#include "ProcessLauncher.h"
#include "WebPageProxyMessageKinds.h"
#include "WorkItem.h"
#include <QApplication>
#include <QLocalServer>
#include <QLocalSocket>
Wrong:
// ConnectionQt.cpp
#include "ArgumentEncoder.h"
#include "ProcessLauncher.h"
#include <QApplication>
#include <QLocalServer>
#include <QLocalSocket>
#include "WebPageProxyMessageKinds.h"
#include "WorkItem.h"

“using” Statements

In header files, do not use “using” statements in namespace (or global) scope.

Right:
// wtf/Vector.h

namespace WTF {

class VectorBuffer {
    using std::min;
    ...
};

} // namespace WTF
Wrong:
// wtf/Vector.h

namespace WTF {

using std::min;

class VectorBuffer {
    ...
};

} // namespace WTF

In header files in the WTF sub-library, however, it is acceptable to use “using” declarations at the end of the file to import one or more names in the WTF namespace into the global scope.

Right:
// wtf/Vector.h

namespace WTF {

} // namespace WTF

using WTF::Vector;
Wrong:
// wtf/Vector.h

namespace WTF {

} // namespace WTF

using namespace WTF;
Wrong:
// runtime/JSObject.h

namespace WTF {

} // namespace WTF

using WTF::PlacementNewAdopt;

In C++ implementation files, do not use “using” declarations of any kind to import names in the standard template library. Directly qualify the names at the point they’re used instead.

Right:
// HTMLBaseElement.cpp

namespace WebCore {

  std::swap(a, b);
  c = std::numeric_limits<int>::max()

} // namespace WebCore
Wrong:
// HTMLBaseElement.cpp

using std::swap;

namespace WebCore {

  swap(a, b);

} // namespace WebCore
Wrong:
// HTMLBaseElement.cpp

using namespace std;

namespace WebCore {

  swap(a, b);

} // namespace WebCore

In implementation files, if a “using namespace” statement is for a nested namespace whose parent namespace is defined in the file, put the statement inside that namespace definition.

Right:
// HTMLBaseElement.cpp

namespace WebCore {

using namespace HTMLNames;

} // namespace WebCore
Wrong:
// HTMLBaseElement.cpp

using namespace WebCore::HTMLNames;

namespace WebCore {

} // namespace WebCore

In implementation files, put all “using namespace” statements inside namespace definitions.

Right:
// HTMLSelectElement.cpp

namespace WebCore {

using namespace other;

} // namespace WebCore
Wrong:
// HTMLSelectElement.cpp

using namespace other;

namespace WebCore {

} // namespace WebCore

Lambdas

Prefer lambdas with explicit template argument lists when the explicit type of a parameter is required in the body.

Right:
[]<typename T>(T arg) { 
    if constexpr (T::isGood)
        go();
}

Wrong:
[](auto arg) {
    using T = std::decay_t<decltype(arg)>;
    if constexpr (T::isGood)
        go();
}

Types

Omit “int” when using “unsigned” modifier. Do not use “signed” modifier. Use “int” by itself instead.

Right:
unsigned a;
int b;
Wrong:
unsigned int a; // Doesn't omit "int".
signed b; // Uses "signed" instead of "int".
signed int c; // Doesn't omit "signed".

Classes

Use a constructor to do an implicit conversion when the argument is reasonably thought of as a type conversion and the type conversion is fast. Otherwise, use the explicit keyword or a function returning the type. This only applies to single argument constructors.

Right:
class LargeInt {
public:
    LargeInt(int);
...

class Vector {
public:
    explicit Vector(int size); // Not a type conversion.
    Vector create(Array); // Costly conversion.
...

Wrong:
class Task {
public:
    Task(ScriptExecutionContext&); // Not a type conversion.
    explicit Task(); // No arguments.
    explicit Task(ScriptExecutionContext&, Other); // More than one argument.
...

Singleton pattern

Use a static member function named “singleton()” to access the instance of the singleton.

Right:
class MySingleton {
public:
    static MySingleton& singleton();
...
Wrong:
class MySingleton {
public:
    static MySingleton& shared();
...
Wrong:
class MySingleton {
...
};

MySingleton& mySingleton(); // free function.

Comments

Use only one space before end of line comments and in between sentences in comments.

Right:
f(a, b); // This explains why the function call was done. This is another sentence.
Wrong:
int i;    // This is a comment with several spaces before it, which is a non-conforming style.
double f; // This is another comment.  There are two spaces before this sentence which is a non-conforming style.

Make comments look like sentences by starting with a capital letter and ending with a period (punctation). One exception may be end of line comments like this if (x == y) // false for NaN.

Use FIXME: (without attribution) to denote items that need to be addressed in the future.

Right:
drawJpg(); // FIXME: Make this code handle jpg in addition to the png support.
Wrong:
drawJpg(); // FIXME(joe): Make this code handle jpg in addition to the png support.
drawJpg(); // TODO: Make this code handle jpg in addition to the png support.

If needed for clarity, add a comment containing the source class name for a block of virtual function override declarations.

Right:
class GPUProcessConnection : public RefCounted<GPUProcessConnection>, public IPC::Connection::Client {
public:
    /// ...

    // IPC::Connection::Client
    void didClose(IPC::Connection&) override;
    void didReceiveMessage(IPC::Connection&, IPC::Decoder&) final;
    bool didReceiveSyncMessage(IPC::Connection&, IPC::Decoder&, UniqueRef<IPC::Encoder>&) final;
    void didReceiveInvalidMessage(IPC::Connection&, IPC::MessageName) override;

    // ...
};

If needed for clarity, add // Messages before a block of IPC message function declarations.

Right:
class GPUProcessConnection : public RefCounted<GPUProcessConnection>, public IPC::Connection::Client {
public:
    /// ...

    // Messages
    void didReceiveRemoteCommand(WebCore::PlatformMediaSession::RemoteControlCommandType, const WebCore::PlatformMediaSession::RemoteCommandArgument&);
    void didInitialize(std::optional<GPUProcessConnectionInfo>&&);

    // ...
};

Overriding Virtual Methods

The base level declaration of a virtual method inside a class must be declared with the virtual keyword. All subclasses of that class must either specify the override keyword when overriding the virtual method or the final keyword when overriding the virtual method and requiring that no further subclasses can override it. You never want to annotate a method with more than one of the virtual, override, or final keywords.

Right:
class Person {
public:
    virtual String description() { ... };
}

class Student : public Person {
public:
    String description() override { ... }; // This is correct because it only contains the "override" keyword to indicate that the method is overridden.
}

class Person {
public:
    virtual String description() { ... };
}

class Student : public Person {
public:
    String description() final { ... }; // This is correct because it only contains the "final" keyword to indicate that the method is overridden and that no subclasses of "Student" can override "description".
}

Wrong:
class Person {
public:
    virtual String description() { ... };
}

class Student : public Person {
public:
    virtual String description() override { ... }; // This is incorrect because it uses both the "virtual" and "override" keywords to indicate that the method is overridden. Instead, it should only use the "override" keyword.
}
class Person {
public:
    virtual String description() { ... };
}

class Student : public Person {
public:
    virtual String description() final { ... }; // This is incorrect because it uses both the "virtual" and "final" keywords to indicate that the method is overridden and final. Instead, it should only use the "final" keyword.
}
class Person {
public:
    virtual String description() { ... };
}

class Student : public Person {
public:
    virtual String description() { ... }; // This is incorrect because it uses the "virtual" keyword to indicate that the method is overridden.
}

Python

For Python use PEP8 style.

大姨妈不能吃什么 什么是八字生辰八字 彪马属于什么档次 什么是夜盲症 下午五点到七点是什么时辰
珏字五行属什么 芈月传芈姝结局是什么 低钙血症是什么意思 慢性胃炎吃什么药效果好 果五行属什么
脑梗是什么引起的 心脏供血不足用什么药 肛门不舒服是什么原因 长期吃泡面有什么危害 婷婷玉立什么意思
pct是什么 肾阳虚吃什么中药 荣誉的誉是什么意思 不割包皮有什么影响吗 p医学代表什么意思
椎间盘突出是什么意思hcv7jop5ns0r.cn 预防更年期提前应该吃点什么药hcv9jop8ns3r.cn 淋巴结肿大是什么样子520myf.com 嗜睡什么意思inbungee.com 内裤上有黄色分泌物是什么原因hcv7jop4ns6r.cn
口我是什么意思hcv8jop9ns1r.cn 蒲公英有什么功效和作用hcv9jop0ns9r.cn 广东省省长是什么级别hcv9jop6ns8r.cn 今天冲什么生肖0297y7.com 2月22是什么星座hcv8jop0ns8r.cn
羊癫疯有什么症状表现hcv8jop9ns7r.cn 绍兴本地人喝什么黄酒hcv8jop2ns9r.cn 怕什么来什么hcv8jop1ns9r.cn 为什么会得近视眼hcv9jop6ns5r.cn 猎奇什么意思hcv8jop3ns2r.cn
为什么喝酒后会头疼hcv8jop8ns5r.cn 女人一般什么时候容易怀孕hcv8jop4ns6r.cn 5月12是什么星座hcv7jop5ns1r.cn 汗马功劳什么意思hcv8jop8ns7r.cn 嘴里起血泡是什么原因hcv9jop3ns1r.cn
百度