记得有文章说, 取名字是最难的事之一, 大家有什么经验分享吗

253 天前
 iorilu

有时候写一个函数

函数逻辑都想好了

但名字还没想出来

手放在键盘上, 无从下手, 有点急躁

毕竟知道, 名字也不能瞎凑合, 虽然现在 ide 改名字也不是什么难事

难经常还是要为想名字耽误下

我现在简单遵循几个原则

  1. 风格统一, 都用英文(或拼音也行, 但不能混用)
  2. 常用得名字, 都用约定俗称得, 不折腾(比如 username , 有可能有人用 user_name , 但自己应该所有项目统一)
  3. 不追求完美名字, 毕竟英文词汇有限, 用几个单词也行, 但不超过 3 个单词
  4. 统一用单数名词, 要不然有时候到底加 s 还是什么其他得变形又得想

暂时先想到这么多, 大家可以讨论补充下

5522 次点击
所在节点    程序员
57 条回复
followNew
252 天前
以函数的结果为导向,命名一个动宾短语。
doSomething
kneo
252 天前
取名=>命名
vhwwls
252 天前
@xiaoz #2 要注册 ,劝退
veike
252 天前
@MFWT get set 加 query(从数据库查询)[狗头]
AkiraZhao
252 天前
正好你可以看看 Stripe 的前 CEO 是如何起 Stripe 这个名字的: https://www.quora.com/How-did-Stripe-come-up-with-its-name/answer/Greg-Brockman
leimao
252 天前
老外就没这烦恼,直接圣经里找
xiamy1314
252 天前
各聊各的。
xiaoz
252 天前
@vhwwls #23 ,是的,需要注册才能使用。我只是提供一个思路,其实可以自己用 AI 的 API 自己写个工具就行了。
yxzblue
252 天前
取名字是最难的事,那干脆别写逻辑了。光想怎么取名吧
Befehishaber
252 天前
女诗经 男楚辞
corcre
252 天前
我也碰到过, 我们乱七八糟的数据每个系统都存一份, 不说明系统的话还要翻代码看看数据从哪里过来的, 然后不加上点条件还容易重复, 最后取数的时候就有可能变成一长串(getXXXDataFromERPBySOAndPartNo)之类的...
encro
252 天前
@MFWT

isadmin 是方法 admin_id 是字段

isUserLogined 是方法 last_login_at 是字段


@iorilu

如果遵循一个函数只干一件事情,那么名字就是反应这个事情的本质和需求。

先写注释,让 copilot 帮你取名
encro
252 天前
这东西,最快的方法就是学习国外同类项目优秀的源码和数据库设计。
v23xowen
252 天前
跨服聊天是吧
Tengdw
252 天前
看看有多少人是看到帖子标题点进来不看正文直接回复的
dif
252 天前
随便区,有个关键字知道是干啥的都行,你敢信我都见过 name 也要缩写为 nme 。
ruoxie
252 天前
chatgpt 啊

{
"filters": [
{
"component": "input",
"key": "决算单状态",
"label": "决算单状态",
"placeholder": "请选择"
},
{
"component": "input",
"key": "主合同编号",
"label": "主合同编号",
"placeholder": "请输入"
},
{
"component": "input",
"key": "客户名称",
"label": "客户名称",
"placeholder": "请输入"
},
{
"component": "input",
"key": "客户手机号",
"label": "客户手机号",
"placeholder": "请输入"
},
{
"component": "input",
"key": "工程管理",
"label": "工程管理",
"placeholder": "请输入"
}
],
"columns": [
{
"slot": false,
"title": "决算单状态",
"dataIndex": "决算单状态",
"key": "决算单状态"
},
{
"slot": false,
"title": "主合同编号",
"dataIndex": "主合同编号",
"key": "主合同编号"
},
{
"slot": false,
"title": "客户名称",
"dataIndex": "客户名称",
"key": "客户名称"
},
{
"slot": false,
"title": "客户手机号",
"dataIndex": "客户手机号",
"key": "客户手机号"
},
{
"slot": false,
"title": "房屋地址",
"dataIndex": "房屋地址",
"key": "房屋地址"
},
{
"slot": false,
"title": "工程管理",
"dataIndex": "工程管理",
"key": "工程管理"
}
],
"pagination": {
"show": true,
"page": "page",
"size": "size",
"total": "result.total"
},
"includeModifyModal": false,
"fetchName": "fetchTableList",
"result": "[\"result\"][\"records\"]",
"serviceName": "getTableList"
}
ruoxie
252 天前
处理后

{
"filters": [
{
"component": "input",
"key": "finalStatementStatus",
"label": "决算单状态",
"placeholder": "请选择"
},
{
"component": "input",
"key": "mainContractNo",
"label": "主合同编号",
"placeholder": "请输入"
},
{
"component": "input",
"key": "customerName",
"label": "客户名称",
"placeholder": "请输入"
},
{
"component": "input",
"key": "customerMobile",
"label": "客户手机号",
"placeholder": "请输入"
},
{
"component": "input",
"key": "projectManagement",
"label": "工程管理",
"placeholder": "请输入"
}
],
"columns": [
{
"slot": false,
"title": "决算单状态",
"dataIndex": "finalStatementStatus",
"key": "finalStatementStatus"
},
{
"slot": false,
"title": "主合同编号",
"dataIndex": "mainContractNo",
"key": "mainContractNo"
},
{
"slot": false,
"title": "客户名称",
"dataIndex": "customerName",
"key": "customerName"
},
{
"slot": false,
"title": "客户手机号",
"dataIndex": "customerMobile",
"key": "customerMobile"
},
{
"slot": false,
"title": "房屋地址",
"dataIndex": "houseAddress",
"key": "houseAddress"
},
{
"slot": false,
"title": "工程管理",
"dataIndex": "projectManagement",
"key": "projectManagement"
}
],
"pagination": {
"show": true,
"page": "page",
"size": "size",
"total": "result.total"
},
"includeModifyModal": false,
"fetchName": "fetchTableList",
"result": "[\"result\"][\"records\"]",
"serviceName": "getTableList"
}
dynastysea
252 天前
好听,易记,好写就行了。。有些家长装 13 ,给孩子取了巨复杂的名字,又是生僻字,又是复杂笔画,百害而无一利
imsoso
252 天前
哈哈,我就看看 v2 有多少是有娃的

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/972474

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX