[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua Style Guide ?
- From: Russell Haley <russ.haley@...>
- Date: Wed, 07 Jun 2017 09:00:36 -0700
Sorry for the top post.
Often when I think I'm being clever in code I put extra comments around it because the likelihood of a difficult bug will be particularly high in that area. Perhaps these areas in my code require more comments. Or better yet, more linefeeds. :-/
But I found an example in code last night that I think works. I had to check all three variables in a function for type. One line if-then-else's were very effective for reducing the lines and creating a block of code that I can recognize without having to read.
As I said, I think the problem dictates the style. I also think my Lua code is very clever. XD
Sent from my BlackBerry 10 smartphone on the Virgin Mobile network.
Original Message
From: Roberto Ierusalimschy
Sent: Wednesday, June 7, 2017 5:32 AM
To: Lua mailing list
Reply To: Lua mailing list
Subject: Re: Lua Style Guide ?
> [...] One of my
> current favorites in Lua is if/then/else on one line, which will
> rarely fit in 80 characters:
>
> if table.value == "another value" then number1 = number1 + 6 else
> number1 = 0 end
That explains a lot :-)
-- Roberto
- References:
- Re: Lua Style Guide ?, Edu Araújo
- Re: Lua Style Guide ?, steve donovan
- Re: Lua Style Guide ?, Soni L.
- Re: Lua Style Guide ?, Francisco Olarte
- Re: Lua Style Guide ?, Marc Balmer
- Re: Lua Style Guide ?, Dirk Laurie
- Re: Lua Style Guide ?, Russell Haley
- Re: Lua Style Guide ?, Sean Conner
- Re: Lua Style Guide ?, Russell Haley
- Re: Lua Style Guide ?, Roberto Ierusalimschy