V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  Ainokiseki  ›  全部回复第 2 页 / 共 2 页
回复总数  21
1  2  
2023-11-23 11:11:48 +08:00
回复了 Ainokiseki 创建的主题 程序员 和 mentor 代码习惯不一样,好头痛
@idealhs 我举个例子:某段代码要对数组中最后一个元素做特殊处理,我写的是:
```
for i:=range array{
if i==len(array)-1{
// do sth special
}
}
```
mentor 要我改成:
```
for i:=0;i<len(array-1);i++{
// do sth normal
}
// do sth special for array[len(array)-1]

```
1  2  
关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   Solana   ·   3234 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 10ms · UTC 11:15 · PVG 19:15 · LAX 03:15 · JFK 06:15
♥ Do have faith in what you're doing.