Why there is no "version" field in widget:GetInfo()
Moderator: Moderators
Why there is no "version" field in widget:GetInfo()
Why there is no "version" field in widget:GetInfo()? I think it is worth to make it standard. Scripters put it everywhere as they can imagine: name, description, comment. Currently you can reliably track widget version by date only.
Re: Why there is no "version" field in widget:GetInfo()
Because the first widgets did not have this field, and everybody start coding widgets by copying old widgets.
Some widgets feature a version field, but now it's too late to add a version field to every widget out there.
I'd say new widgets should include this version field, and that any code reading the version field of a widget should handle version being undefined.
Btw, I noticed it's best to use a string and not a number, as decimal number don't show up too well: for exemple 1.3 gets printed as 1.2999999523163, while "1.3" stays 1.3.
Some widgets feature a version field, but now it's too late to add a version field to every widget out there.
I'd say new widgets should include this version field, and that any code reading the version field of a widget should handle version being undefined.
Btw, I noticed it's best to use a string and not a number, as decimal number don't show up too well: for exemple 1.3 gets printed as 1.2999999523163, while "1.3" stays 1.3.
Re: Why there is no "version" field in widget:GetInfo()
Only thing with using a string is you lose alphanumeric sorting unless you include leading zeros. Versions are actually annoying to do properly, since you have to make sure that 1.10.123b is bigger than 1.9.444 - alpha sort will fail there, and numeric sort will crash because of the little 'b'. Does Lua have a "decimal" datatype?
Re: Why there is no "version" field in widget:GetInfo()
Nope.Pxtl wrote:Does Lua have a "decimal" datatype?
Code: Select all
The possible results of this type() function are "nil" (a string, not the value nil), "number", "string", "boolean", "table", "function", "thread", and "userdata". 