Forum: CFEngine Help
Subject: Re: rpm_version package provider
Author: mikesphar
Link to topic: https://cfengine.com/forum/read.php?3,27409,27435#msg-27435

neilhwatson Wrote:
-------------------------------------------------------
> And that's when you kicked him?

His point was valid though, that the actual data structures this version 
information is virtually always stored in, is not as INTs or floats but as 
strings, so projecting numeric assumptions onto a string datatype just because 
the contents usually look like numbers is a programming error lurking in the 
grass.

It's like how people sometimes used to use INTs for the database fields for zip 
codes in the US. Then one day they needed to enter an address outside the US 
and discovered an unexpected complication. Basically the advice was "unless you 
are going to perform mathematical operations on it, consider it a string. And 
sorting--even numerical sorting--is not a mathematical operation." It's 
actually served me relatively well when I remember it, and saved me a couple 
times when I might have been bitten by an assumption about things like employee 
IDs or part "numbers" or such.

But none of that changes how frustrating and inconsistent version labeling can 
be, of course.

_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to