0
最受歡迎的代碼格式爲表人口表結構的代碼格式
mytable = {
key1 = value1,
key2 = element2,
key3 = GetValue3()
key4 = this_is_the_fourth,
key5 = and5,
}
但我相信下面的更好:
mytable =
{ key1 = value1
, key2 = element2
, key3 = GetValue3()
key4 = this_is_the_fourth
, key5 = and5
}
好處海事組織與前你很容易地發現缺少逗號。我明確地舉例說明了這一點。你發現了嗎?
有關於如何構建表的this guide,但沒有什麼像python的PEP。
構建這樣的表有什麼缺點嗎?
這是不尋常的,但很好,除了'key4'之前缺少一個逗號。 – lhf
@lhf有意圖,請參閱下面的代碼 –
以下的註釋相當多的人在SQL查詢中使用該樣式,所以它不會太過牽強。 –