跨语言编码标准

时间:2015-08-04 09:29:39

标签: c# coding-style typescript

我正在构建C#和TypeScript的框架。

比如说我在C#中有以下类

public FieldLabel fieldGroupLabel()
{
    FieldLabel ret;

    ret = super();

    switch (this.parmFieldId())
    {
        case fieldNum(SalesQuotationTable, SalesGroup): // replace this with the new field
            ret = 'My Group label'; // replace this with the id of the label you want to use
            break;
    }

    return ret;
}

我想在TypeScript中使用完全相同的功能,但根据coding guidelines,我应该使用camelCase进行功能

class Validator
{
    public bool Validate(string value)
    {
        return someCondition;
    }
}

我想知道我是否应该根据每种语言的编码指南独立构建每个框架,或者我是否可以忽略这个跨语言框架?

1 个答案:

答案 0 :(得分:4)

坚持每种语言的指导方针。

使用编码多种语言的人员来遵循当前语言的指南。如果你遵循另一种语言的指导原则,那些只使用一种语言的人会感到恼火。

对称性就在你脑海中。