Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Probably the same people who think that JS is a great language because it converts strings to numbers automatically. (Sometimes)
-
@ostream yeah I came across this a while back now. Can’t remember the exact context but I remember that it was a weird case where just casting the string wasn’t going to fix it and that it caused a bunch of other turmoil as well
-
@ostream by Murphy's law, this string will contain leading or trailing whitespace, unexpected characters for group separation or decimal points and other crap that will make a simple cast to a number fail.
You seriously see no problem in it? -
@Lensflare literally this! 😂
The client’s data swamp was truly something to behold. Took me and a few colleagues a few months to drain and clean it up enough so that they could answer basic questions with any accuracy like how many customers do we have? Is this customer still alive so that I don’t send ads to dead people by accident, like I did that one time… etc
Would have been even funnier if the ad was for life insurance -
@ostream yeah actually now that I think about it I think their data was riddled with free text issues.
Several times a week I would question whether or not the developer of the source system ever heard of validation checks, or about any other input type besides text fields.
Granted their 50 year old mainframe system that still runs on COBOL was way worse. They literally had a manual as thick as an encyclopaedia that remapped all the nonsensical short codes for their table names and column names to human readable names, along with data types, UML diagrams and rough explanations of how certain formats work since even their numeric columns didn’t follow any format you would see in modern databases.
Now that I think about that’s actually more documentation than most of the other tables I’ve ever worked with 😂
They even had one of the COBOL devs that worked on it in house to answer questions! -
@ostream of course you should check your input. That’s not the point here.
It‘s not about transmission but about storage.
You should also pick the correct data type to prevent or detect that kind of issues and make your life easier. That’s literally the reason why there are different data types and not everything is a text string. -
@atheist the stored value here is not currency but an exchange rate. Float would be fine.
And float for currency is a well known anti-pattern. Nothing new. There are many different solutions for that problem, depending on your use case. Picking string to store monetary values is one of the worst things that you can do. That also applies to anything that involves numbers. -
I know people who break the currency up into an array representing the significand
2.5 = 25 x 10^-1
integer array(25,10,-1)
The first time I saw it I didn't know what I was feeling, because there were so many (negative) feelings at once. -
@IntrusionCM the negative feelings come from the -1
Sorry, I had to 😂
But seriously, why using 3 numbers? The 10 is fixed and can be omitted. -
@Lensflare I dunno.
But imho that approach is so ... Bleep.... That I wouldn't wonder if a different base would be possible, too. -
Where I work we had to update a database. Would've been easy, except that for some reason they made a description field, the PK for a table....
-
@MrMcguffin better to have a manual thick enough to give someone head trauma and not need it, then NOT to have a manual thick enough to give someone head trauma when you DO need it.
-
@Wisecrack I love the double meaning in your message. Sometimes I do feel like I need head trauma 😂
-
@MrMcguffin the double meaning was completely unintentional, and at first I didn't know what you meant.
Must be all the head trauma.
Where'd I put that manual anyway?
Related Rants
WHO THE FUCK MAKES AN EXCHANGE RATE A STRING?!!!
rant
cloudera
sql