Open sl-service-account opened 1 year ago
Peter Stindberg commented at 2023-07-18T16:36:39Z
Doesn't increase readibility for me, but my formal training happened in the Eighties and we didn't had anything fancy back then.
Assuming LSL is a language a lot of programming-laypersons learn, the classic way to write it is way more readable, than the shortened version you suggest.
It shouldn't decrease the bytecode if the compiler is any good. Both versions should compile to the exact same bytecode. Should.
JIRAUSER341305 commented at 2023-07-19T06:00:44Z
Talking about readability then… The question becomes, how it compares to how many of us actually write that;
llOwnerSay( "someInteger is " + llList2String(["True", "False"], !someInteger) );
Compared to that, the ternary operator is probably the better choice.
Spidey Linden commented at 2023-07-19T17:41:39Z
Issue accepted. We have no estimate when it may be implemented. Please see future release notes for this fix.
How would you like the feature to work?
Instead of:
We could simply do:
Why is this feature important to you? How would it benefit the community?
This can increase code readability and (possibly) decrease LSL bytecode? This would be amazing to have. These are in almost every language used today. C-Sharp, Javascript, C, C++, etc ...
Original Jira Fields
| Field | Value | | ------------- | ------------- | | Issue | BUG-234143 | | Summary | Conditional Operator Expressions In LSL | | Type | New Feature Request | | Priority | Unset | | Status | Accepted | | Resolution | Accepted | | Created at | 2023-07-18T07:44:33Z | | Updated at | 2023-07-19T17:41:43Z | ``` { 'Build Id': 'unset', 'Business Unit': ['Platform'], 'Date of First Response': '2023-07-18T11:36:39.229-0500', 'How would you like the feature to work?': 'Instead of:\r\n{code:lsl}\r\nstring bool = "False";\r\n\r\nif( someInteger == TRUE )\r\n{\r\n bool = "True";\r\n}\r\n\r\nllOwnerSay( "someInteger is " + bool );\r\n{code}\r\n\r\nWe could simply do:\r\n{code:lsl}\r\nllOwnerSay( "someInteger is " + ( someInteger == TRUE ? "True" : "False" ) );\r\n{code}', 'ReOpened Count': 0.0, 'Severity': 'Unset', 'Target Viewer Version': 'viewer-development', 'Why is this feature important to you? How would it benefit the community?': 'This can increase code readability and (possibly) decrease LSL bytecode? This would be amazing to have. These are in almost every language used today. C-Sharp, Javascript, C, C++, etc ...', } ```