Live data from Hacker News

Edge cases to keep in mind when working with text

thedroidsonroids.com

1–10 of 31 posts

Re: Edge cases to keep in mind when working with text

#2
Text (aka strings) exists in virtually all software projects

For me, distinguishing between text as something that is intended to be read by humans and strings as serial sequences of characters that may or may not be human readable but will be processed by one or more computing automata is useful. For example in C, the string "Hello World" is terminated by a null character. The null character is not part of the text the string encodes.

Or to put it another way, I find that treating strings as text as two different layers of abstraction clarifies my intent. Code that manipulates text is built on code that manipulates strings and in between there's parsing that has to occur.

Re: Edge cases to keep in mind when working with text

#3
post #2

Text (aka strings) exists in virtually all software projects For me, distinguishing between text as something that is intended to be read by humans and strings as serial sequences of characters that may or may not be human readable but will be processed by one or more computing automata is useful. For example in C, the string "Hello World" is terminated by a null character. The null character is not part of the text…

Wouldn't you want to call that "string" versus "bytes" (instead of "text" versus "string")? (That's the Python parlance, if I'm not mistaken, and it seems good to me.)

Re: Edge cases to keep in mind when working with text

#4
I wish more software developers kept these things in mind. At one of my customers I worked on interfacing their online store with several other software components. The store was the only piece able to handle the names of customers (from different parts of the world) correctly. All the rest failed at some point. There are so many additional aspects you discover only when you actually work on these things.

Re: Edge cases to keep in mind when working with text

#5
The Turkish situation referenced (http://gizmodo.com/382026/a-cellphones-missing-dot-kills-two...) is not an indictment of bad tech, but of a fucked up honor-based patriarchal culture.

"Ramazan went to the family's home to apologize, only to be greeted by the father, Emine, two sisters and a lot of very sharp knives."

There's no technological way to fix people that would try to kill someone over a text misunderstanding without figuring out the truth first. People like this are garbage-people murderers, let's not blame tech mistakes for the fact that some people are scum. Everyone involved knew damn well that a couple characters would make the difference between a benign text and an offensive one, and frankly, even if the text was offensive, murder was not justified. Scum.

Re: Edge cases to keep in mind when working with text

#6
post #3
post #2

Text (aka strings) exists in virtually all software projects For me, distinguishing between text as something that is intended to be read by humans and strings as serial sequences of characters that may or may not be human readable but will be processed by one or more computing automata is useful. For example in C, the string "Hello World" is terminated by a null character. The null character is not part of the text…

Wouldn't you want to call that "string" versus "bytes" (instead of "text" versus "string")? (That's the Python parlance, if I'm not mistaken, and it seems good to me.)

In that case, which is HTML? Because it's meant for machines to read, so should be treated more carefully that pure 'text'. However, HTML shouldn't be processed like bytes either.

I suppose with HTML the real issue is that there is human readable text in there.

Re: Edge cases to keep in mind when working with text

#7
post #6
post #3

Earlier quoted context omitted.

Wouldn't you want to call that "string" versus "bytes" (instead of "text" versus "string")? (That's the Python parlance, if I'm not mistaken, and it seems good to me.)

In that case, which is HTML? Because it's meant for machines to read, so should be treated more carefully that pure 'text'. However, HTML shouldn't be processed like bytes either. I suppose with HTML the real issue is that there is human readable text in there.

HTML is serialisation of a DOM. It's not a sequence of text, but a semantic tree of it. Both encoded as sequential bytes, but different concepts when decoded.

Re: Edge cases to keep in mind when working with text

#8
post #5

The Turkish situation referenced ( http://gizmodo.com/382026/a-cellphones-missing-dot-kills-two... ) is not an indictment of bad tech, but of a fucked up honor-based patriarchal culture. "Ramazan went to the family's home to apologize, only to be greeted by the father, Emine, two sisters and a lot of very sharp knives." There's no technological way to fix people that would try to kill someone over a text misunderstan…

> is not an indictment of bad tech, but of a fucked up honor-based patriarchal culture.

Bad tech played a crucial role in the escalation, though. What is justified in one society or even demanded is not necessarily justified in another. And a text message that you consider just offensive might be a strong insult in another culture with implications you cannot even grasp.

Calling people for their culture "scum" is the least effective way of "positively" influencing them (on the premise that Western culture is "positive").

Re: Edge cases to keep in mind when working with text

#9
post #8
post #5

The Turkish situation referenced ( http://gizmodo.com/382026/a-cellphones-missing-dot-kills-two... ) is not an indictment of bad tech, but of a fucked up honor-based patriarchal culture. "Ramazan went to the family's home to apologize, only to be greeted by the father, Emine, two sisters and a lot of very sharp knives." There's no technological way to fix people that would try to kill someone over a text misunderstan…

> is not an indictment of bad tech, but of a fucked up honor-based patriarchal culture. Bad tech played a crucial role in the escalation, though. What is justified in one society or even demanded is not necessarily justified in another. And a text message that you consider just offensive might be a strong insult in another culture with implications you cannot even grasp. Calling people for their culture "scum" is the…

> Calling people for their culture "scum" is the least effective way of "positively" influencing them

If their culture is objectively so primitive and backwards that it causes behaviour you'd expect of savages a couple thousand years ago, I think that word is entirely appropriate.

Re: Edge cases to keep in mind when working with text

#10
post #9
post #8

Earlier quoted context omitted.

> is not an indictment of bad tech, but of a fucked up honor-based patriarchal culture. Bad tech played a crucial role in the escalation, though. What is justified in one society or even demanded is not necessarily justified in another. And a text message that you consider just offensive might be a strong insult in another culture with implications you cannot even grasp. Calling people for their culture "scum" is the…

> Calling people for their culture "scum" is the least effective way of "positively" influencing them If their culture is objectively so primitive and backwards that it causes behaviour you'd expect of savages a couple thousand years ago, I think that word is entirely appropriate.

I'm not sure I understand. Are you saying that, because a misunderstanding over text led to one person murdering another, that the culture in which these events occurred was primitive, backwards, and deserving of the epithet "scum"?
Post reply on HN