Difference between revisions of "Talk:LSL Style Guide"

From Second Life Wiki
Jump to navigation Jump to search
Line 19: Line 19:


: Good comment. Bracketing style is an old debate in programing (20 years at least). Both styles have their advantages as long as the scripter is consistent with the style they pick. The key in programing is consistency in style, not so much what the style is. -- [[User:Strife Onizuka|Strife Onizuka]] 12:11, 8 May 2007 (PDT)
: Good comment. Bracketing style is an old debate in programing (20 years at least). Both styles have their advantages as long as the scripter is consistent with the style they pick. The key in programing is consistency in style, not so much what the style is. -- [[User:Strife Onizuka|Strife Onizuka]] 12:11, 8 May 2007 (PDT)
:: I wonder if we should just show the two ways of bracketing and let the readers decide which to use, with out giving any description of which one is "Better", even though everyone knows the brackets go on the same line as the code. ;P [[User:Xaviar Czervik|Xaviar Czervik]]

Revision as of 17:03, 25 August 2007

Script Structure

Mandating event order seems a little retentive to me. I don't think any scripter who is going to post code onto the wiki is going to be keen on rewriting their code to fit the pattern. Being flexible to other scripters styles is a key to success (especially with regards to collaborative projects). They should be grouped in a fashion that makes sense to the script and scripter. Seeing as this section is going to be a hot topic, maybe it shouldn't be included or make it very short? Strife Onizuka 22:29, 14 February 2007 (PST)

I agree that mandating event order would be a pain in the ass.
I personally put events in the order they're first used throughout the process of a script's life cycle.
If a Resident is learning to script from a mentor or teacher, they're likely to be using snippets of code they're sent in-world. For them to see a different structure in LSL Library code would be confusing
SignpostMarv Martin 05:44, 15 February 2007 (PST)

Re: General Guidelines

Would suggest that the virtues of the second style shown be amended. Saving space is a pointless exercise if LSL code is truly compiled rather than interpreted. The overhead needed to compile a few extra carriage returns has to be trivial in all but the most monumentally huge scripts.

Second virtue of the "parallel brackets" style (the second type shown) is that the nesting of logical modules is far more clear, and is effectively a form of self-documentation that is often more effective than text comments, especially when code is likely to be rewritten, revised or adapted to another purpose by individuals other than the original author. It can even help the original author understand her own code better, faster, if she is returning to a bit of code written in the relatively dim past.

Would take a shot at saying this more concisely, but first want to see if there are other views that should also be reflected in any revision to the text.

This is my first contribution here. Please forgive any unintentional breeches of protocol and etiquette. --Azadine Umarov 17:49, 7 May 2007 (PDT)

Good comment. Bracketing style is an old debate in programing (20 years at least). Both styles have their advantages as long as the scripter is consistent with the style they pick. The key in programing is consistency in style, not so much what the style is. -- Strife Onizuka 12:11, 8 May 2007 (PDT)
I wonder if we should just show the two ways of bracketing and let the readers decide which to use, with out giving any description of which one is "Better", even though everyone knows the brackets go on the same line as the code. ;P Xaviar Czervik