Lurker News
Back to discussion

Comment by noduerme

noduerme2 replies#
back in 1999 or so, I wrote an online shopping site this way, all the data stored as text files (one per category, with many items in my case ... I was 18 years old and had no idea about databases). The site ran smoothly for almost a year until the customer used "*" in the name of a product... which was the character by which all the product data in the text files data was split...
isoprophlex3 replies#
That's why you always delimit your data fields in a text file with a unicode snowman

Surely noone will ever use that character!

noduerme1 reply#
live and learn. It was the re-split when they saved the new products through my brilliant parser that royally fucked it all up. Genius that I was, I used "|" to separate attributes, but I also definitely used a double asterisk to mean something else. Nothing teaches you not to get clever better than screaming customers and abject failure. And having to find/replace a thousand asterisks to figure out which ones were making the file unreadable. Falling on my face made me the careful coder I am today.
jwoq91182 replies#
Early career chap over here. Awesome hearing stories like this. Those wild west days certainly have passed. We’ve got so much now to get us started as programmers that it almost robs us of learning experiences somehow.

Continue this thread — 2 replies

arein3#
You can also encode the special characters when writing to file and decoding after read.
lelanthran#
Weird. In the same year (1999), I did pretty much the same thing (because strtok really made it easy to split a string) also for client input fields.

Only, I used the ASCII FS character (the Field Separator character) and everything worked brilliantly.