3 ms·
This is certainly true for data types that the system knows how to serialize and deserialize, but (at least back when clippings were introduced) for others, the
by hamburglar 6y ago
This is certainly true for data types that the system knows how to serialize and deserialize, but (at least back when clippings were introduced) for others, the app that owns the clipboard data must provide the hook for the serialization and deserialization. Back in my first programming job, we were about to ship a shrink-wrapped software product that I will not name but you’ve almost certainly used, and we discovered that we “needed” to support clippings or else (I can’t remember if this was some Apple compatibility rule or some marketing person’s rule). We didn’t have much time, and we also didn’t have serialization code for this very complicated data structure that was on the clipboard, and my manager told me to just implement it by sticking THE POINTER in the clipping. I objected and was overruled. I did it, it shipped that way, and I will always be ashamed. You could only use a clipping in the same process that created it. I had to add code on the deserialize that checked to see if the pointer was valid. It still makes me sick to think about.
- marmaduke 6y agoThat’s the practical approach .. and you are lucky to have a manager who is technical enough to make suggestions like that
- hamburglar 6y agoThere is nothing practical about writing a pointer value to a file. This was a quick hack that made the feature appear to work rather than actually work. It's really bad engineering.
- marmaduke 6y agoI agree with you, before the external constraints enter the picture. But as you said, it had to be delivered with this feature on a shorter timeline than a better solution allowed for. The choice between delivering something and delivering nothing, how do you proceed there?
- hamburglar 6y agoSlip it or cut it. Doing it in a way that loses data for users is a bad call.