Difference between revisions of "User talk:Kira Komarov"

From Second Life Wiki
Jump to navigation Jump to search
m
 
(34 intermediate revisions by 5 users not shown)
Line 1: Line 1:
== A word from the shamed ==
== FloatCompare ==


I've been wandering through the Wizardry and Steamworks code. I think what you are doing is a good thing but I want to pass along a cautionary tale I swear to you is true, as it happened to me last week. For years I have scripted in LSL and until recently I was confident in my ability and skill at coding, to the point that I felt I wrote code without syntax errors and that if I spent enough time reviewing the logic I wouldn't ever need to run the code. So in 2008 I expanded the article [[Right Shift]] posting the optimal code for doing an unsigned right shift. Last week someone edited the article saying my code didn't work, I couldn't believe it, I had even included a test script in the article which predicted the correct answer in it's comments. I knew my logic to beyond reproach. I thought it was a bug, some breaking change, I posted a JIRA. A Linden responded asking for more details. Then I ran the test script. I had apparently never ran the test script before. I soon found the problem. It never worked.
Just wanted to say I've finished writing up my (rambling) response to you posts. In short FloatCompare is old, it predates Mono, its crashing because it doesn't support infinity (3.403E+38 is getting rounded up to infinity). Try bigger values for 'c', small values aren't very interesting. I have trouble imagining many situations where FloatCompare would be useful. Typically you just want to look at how close a set of numbers are to each other, not see if they match. It's better to use Float2Hex for this. Anyway I need to get to sleep was a long day. -- '''[[User:Strife_Onizuka|Strife]]''' <sup><small>([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])</small></sup> 23:25, 24 May 2012 (PDT)


What unnerved me so about this was that my logic was flawed. I code in logical building blocks and then I manipulate and optimize them. I love coding, I love the logic, it's one thing to overlook an edge case, it's another thing altogether to be wrong. I am now left questioning all the code I have written in the last 4 if not 5 years. A take it you are someone like me who takes pride their work. Do yourself the favor of testing every bit of code you post, save yourself from having 4 years of shame coming home to roost all at once. When it came to [[Right Shift]] there were only two options, I could either fix the article or revert it to before I had contributed. There was really only one option I had, I had to fix it, if I didn't I would be then denying there were other better ways to solve the problem but fixing it would be admitting I was wrong. If I had only been in the habit of running my code, I would have spotted the flaw, I would have avoided all of this. At any time during the first six months I could have run the code and it wouldn't have hurt so. The code I posted was supposed to help people.
::That's fine. Thanks. You [https://wiki.secondlife.com/wiki/User_talk:Strife_Onizuka/Float_Functions#P.S.|have my answer].
 
::Kira Komarov
Not all the examples on [[Wizardry_and_Steamworks/Full_Spectrum_Re-Channeling]] compile. Take my advice on this and you will never be shamed like I was, your pride will be unblemished. -- '''[[User:Strife_Onizuka|Strife]]''' <sup><small>([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])</small></sup> 16:44, 27 November 2011 (PST)
 
P.S. I'm enjoying reading [[Wizardry_and_Steamworks/Full_Spectrum_Re-Channeling]], the issue of having to parse events not intended for the script and discarding them resulting in event-queue backup and eventual dropping of events is a serious problem. I have seen it happen with link_messages, the solution to which is to put your scripts in different prims and then send the message to the specific prim instead of LINK_SET etc. If the simulator is busy it just makes the problem all that much worse.

Latest revision as of 15:56, 3 June 2012

FloatCompare

Just wanted to say I've finished writing up my (rambling) response to you posts. In short FloatCompare is old, it predates Mono, its crashing because it doesn't support infinity (3.403E+38 is getting rounded up to infinity). Try bigger values for 'c', small values aren't very interesting. I have trouble imagining many situations where FloatCompare would be useful. Typically you just want to look at how close a set of numbers are to each other, not see if they match. It's better to use Float2Hex for this. Anyway I need to get to sleep was a long day. -- Strife (talk|contribs) 23:25, 24 May 2012 (PDT)

That's fine. Thanks. You my answer.
Kira Komarov