Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> So imagine a pipeline that takes in encrypted text and the first “filter” decrypts the text, the second takes the decrypted text and strips away the beginning and the end, the third takes its input and sends it in an email. From a programmers perspective, we might think of these inputs and outputs as the “same” because they are text, however, in meaning, they are very different.

I've only got this far and thought it was interesting. Firstly because I think it's partly wrong; a programmer definitely doesn't think of encrypted data binary blobs as the same as text, but secondly because I do wonder if a subclass of a string type that is "has leading and trailing whitespace removed" might be quite an interesting way to model your data. The object could do the strips on construct.



It's just a description of InputStream/OutputStream type classes. You can have an EncryptedStream as well.

There's something to be said for having objects that are just "a string (or number), but having had its prerequisites enforced and validated". Especially in unicode land.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: