标签: naming-conventions

Delphi XE2 及以上版本中作用域单元的建议命名是什么?

随着 Delphi XE2 的出现,类似Xml.Internal.AdomCore_4_3或 的范围单元System.StrUtils开始流行。

我喜欢使用此类描述性名称的能力,但我对命名约定和首选目录结构是什么感到困惑。

  1. 应该是

    • com.company.project.Security.Compression.ZLib.pas就像在Java中一样

    • System.Security.Compression.ZLib.pas就像在 .NET 中一样

    • 或者是其他东西?

  2. 我应该将文件放在这样的目录结构中吗

    • System\Security\Compression\System.Security.Compression.ZLib.pas

    • 或者只是System.Security.Compression.ZLib.pas在根文件夹中?

看看 Embarcadero 组织其单元的方式,我留下的印象是他们只是保留了 Delphi 5/6/7/.../XE 中的目录结构

请指教。

delphi scope naming-conventions delphi-xe2

0
推荐指数
1
解决办法
594
查看次数

在 Ruby 中使用全部大写的类名是一种不好的做法吗?

考虑 Foo ID 的类:

class Fid
Run Code Online (Sandbox Code Playgroud)

这不是一个好名字,因为它掩盖了含义。

class FID
Run Code Online (Sandbox Code Playgroud)

这更好,因为它意味着 Foo ID。

Ruby 中的大多数类都是 CamelCase,那么使用全部大写是一种不好的做法吗?

JSON 类呢?

ruby naming-conventions

0
推荐指数
1
解决办法
2550
查看次数

如何在 Java 中命名返回 HashMap 的函数?

我知道如何在 Java 中命名 HashMap?,但是构建和分配键的函数的最佳名称是什么?返回的函数Map<State, County> countiesByState可以命名为

sortToState(myCounties)
mapByState(myCounties)
getCountiesByStateMap(myCounties)
getCountiesByState(myCounties)
getMapByState(myCounties)
Run Code Online (Sandbox Code Playgroud)

java naming-conventions

0
推荐指数
1
解决办法
2886
查看次数

命名约定,C# 异步方法

应该在将要异步执行的方法名称中添加一个 Async 前缀。与在 MS EF Core 中一样,所有运行 async 的方法都有 async 前缀。但它们也有同步方法,没有同步前缀。

在某些方法设计为并行运行的情况下有什么建议。

寻求建议。

c# coding-style naming-conventions

0
推荐指数
1
解决办法
1944
查看次数

python变量名中的下划线字符对解释器很重要吗?

我见过在 python 变量中使用下划线字符。解释器是否在存在下划线的情况下以不同的方式解释变量,_还是纯粹是约定问题?如果是约定,是否有关于python变量命名约定的标准文档?

我正在使用 python 3.8.5

python naming-conventions python-3.x

0
推荐指数
1
解决办法
557
查看次数

写xcode的官方方式

什么是写的正式方法:Xcode,XCode,xcode,...?我已经看到它写了很多方法,并希望确保我正确使用它.

xcode naming-conventions

-1
推荐指数
1
解决办法
158
查看次数

名字应该是英文好吗?

(这可能是提出问题的错误地方,请告诉我).

我应该说出我的方法isStaticallyImported还是isStaticlyImported?(我相信它们的发音方式大致相同)

java naming-conventions

-1
推荐指数
1
解决办法
100
查看次数

如何在Oracle数据库中小写对象?

有没有办法Oracle DB用小写字母命名我的表格,列?

我搜索了很多,一些建议说我应该在创建中使用双引号,如下所示:

CREATE TABLE "test" (a number); 
Run Code Online (Sandbox Code Playgroud)

这里的问题是:

它迫使我double quotes通过查询来装饰我的所有桌子!

如果我写:

SELECT * FROM test ;  
Run Code Online (Sandbox Code Playgroud)

我会得到语法错误.

我想将我的所有表,字段命名为小写,因为我将在我的模型中使用这个ORM(实体框架)使用(Pluralization and Singularization)功能,所以如果我有这样的表:

CITY 根据Oracle惯例.

等效的将是CITY实体和复数,因为导航属性将是CITies!!

sql oracle orm entity-framework naming-conventions

-1
推荐指数
1
解决办法
2553
查看次数

Java约定 - 命名局部变量与字段相同

编写一个程序来解释文本文件中的一行.
想知道我是否应该将方法'parseWordData'中的局部变量命名
scannedWord为oppposed word,因为word它已经是一个类字段.
只要我宣布一个新变量而不是重新分配旧变量,一切都应该没问题......对吗?

public class WordData {

private String word;
private int index;
private LinkedList<Integer> list;
private boolean pathFound;

public WordData(String word, int index, LinkedList<Integer> list, boolean pathFound) {
    this.word = word;
    this.index = index;
    this.list = list;
    this.pathFound = pathFound;
}

public WordData parseWordData(String line){
    Scanner scan = new Scanner(line);
    int index = scan.nextInt();
    String word = scan.next();
    //precond and subGoal
    LinkedList<Integer> list = new LinkedList<Integer>();
    while(scan.hasNextInt()){
        //add to LinkedList
    }
    return new …
Run Code Online (Sandbox Code Playgroud)

java naming-conventions local-variables

-1
推荐指数
1
解决办法
672
查看次数

isUHD 的 Kotlin 和 Java 命名约定

我想知道哪个更适合作为函数名称:

  1. 是超高清
  2. 是UHD
  3. (is4k)

java naming-conventions kotlin

-1
推荐指数
1
解决办法
1193
查看次数

我是否有命名约定问题或代码问题?

我一直用CN_作为常量的前缀,如下所示,但我现在正在编写接受标准的编码,我发现这个标准链接在这个网站上.标准说我应该删除CN_为我的常量.因此,通过下面的示例,如果我将CN_NetPrice更改为NetPrice,我将与同名的method属性发生冲突.显然我不能这样做所以我留下了一个问题.我是否有命名约定问题,或者我的代码一般有问题吗?

public class TicketInformation
{
    private const string CN_StartDate = "StartDate";
    private const string CN_EndDate = "EndDate";
    private const string CN_NetPrice = "NetPrice";
    private const string CN_NetTotalPrice = "NetTotalPrice";
    private const string CN_Tickets = "Tickets";

    public decimal NetPrice { get; set; }
    public decimal NetTotalPrice { get; set; }
    public decimal Tickets { get; set; }

    public static TicketInformation Create(DateTime startDate, DateTime endDate)
    {
        try
        {
            TicketInformation ti = new TicketInformation();
            using (DataTable dt = DAC.ExecuteDataTable(
                "GetAllTicketInformationSelect", 
                DAC.Parameter(CN_StartDate, startDate), 
                DAC.Parameter(CN_EndDate, …
Run Code Online (Sandbox Code Playgroud)

c# naming-conventions

-2
推荐指数
1
解决办法
144
查看次数

MySQL数据库名称可以是数字吗?

MySQL不会让我创建一个只有数字的数据库名称.它只在我添加字母时才有效.

如何在MySQL中创建仅使用数字的数据库名称?

CREATE DATABASE 2752054;

mysql database naming-conventions fully-qualified-naming

-3
推荐指数
1
解决办法
1615
查看次数

C#中"var"的命名约定

如何正确初始化var类型的类?我经常看到这个版本:

var converter = new Converter();
Run Code Online (Sandbox Code Playgroud)

类的实例应该用PascalCase编写,对吧?为什么它不同var

c# naming-conventions

-4
推荐指数
1
解决办法
317
查看次数