lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Oh, this sort of thing I code as:

local _ = coroutine
local cocreate, coresume, costatus
    = _.create, _.resume, _.status


2017-06-15 17:25 GMT+02:00 Soni L. <fakedme@gmail.com>:


On 2017-06-15 04:00 AM, Sean Conner wrote:
It was thus said that the Great Daurnimator once stated:
On 15 June 2017 at 15:36, Sean Conner <sean@conman.org> wrote:
   <raises hand> I do.

   https://github.com/spc476/lua-conmanorg/blob/master/lua/string.lua

   -spc (The only rational is that it looks nicer to me)
I used to, but I don't like that it causes diffs to include unrelated
changes (which are my main form of code review).

e.g. say your string.lua file needed the coroutine library: you'd have
make 3 non-functional line edits to keep alignment. consistent.
   Yes, and for me, that's fine.  Because otherwise the code becomes too
unreadble for *me* when it's not aligned.

   -spc



I don't align across unrelated variables.

local cocreate = coroutine.create
local coresume = coroutine.resume
local costatus = coroutine.status
local smatch = string.match
local sgsub  = string.gsub
local tsort = table.sort
local tmove = table.move
-- etc

Works fine for me. The different alignment might even be helpful.


--
Disclaimer: these emails may be made public at any given time, with or without reason. If you don't agree with this, DO NOT REPLY.