So, to get an idea, which of these three code samples is the best in both efficiency and readability?
1. Standard
local function menuBar()
term.setCursorPos(1,1)
term.clearLine()
term.setBackgroundColor(deskColors["menuColor"])
term.setTextColor(deskColors["menuTextColor"])
term.setCursorPos(2,1)
if s==0 or s==nil then
term.write("1|Start 2|Options 3|NhUI")
else
term.write("-|Start -|Options -|NhUI")
end
end
2. Semi-condensed
local function menuBar()
term.setCursorPos(1,1)
term.clearLine()
term.setBackgroundColor(deskColors["menuColor"])
term.setTextColor(deskColors["menuTextColor"])
term.setCursorPos(2,1)
if s==0 or s==nil then term.write("1|Start 2|Options 3|NhUI") else term.write("-|Start -|Options -|NhUI") end
end
3. What I'm calling "Relation Grouping"
local function menuBar()
term.setCursorPos(1,1) term.clearLine()
term.setBackgroundColor(deskColors["menuColor"]) term.setTextColor(deskColors["menuTextColor"])
term.setCursorPos(2,1) if s==0 or s==nil then term.write("1|Start 2|Options 3|NhUI") else term.write("-|Start -|Options -|NhUI") end
end
Feel free to leave your choice and own personal opinions/suggestions in the comments. I'd love to hear em.
Alternatively: http://strawpoll.me/6889818
Thanks in advance for the feedback!