4 ms·
See also https://wiki.c2.com/?StringlyTyped https://wiki.c2.com/?StringlyTyped
by cratermoon 5y ago
See also https://wiki.c2.com/?StringlyTyped https://wiki.c2.com/?StringlyTyped
- imoverclocked 5y agoSo much this. Strings can contain anything… json, JavaScript, invalid utf8, you name it! I’ve seen type systems (poorly) re-implemented in already typed languages around string usage.
- cratermoon 5y agoFull disclosure: as a young programmer I contributed to and was co-responsible for promoting an in-house Java library which misused strings in exactly this way. I didn't know any better, I was working with some people who only knew SQL and in the relational schema every column was type char or varchar.
- imoverclocked 5y agoI too have gone back and looked at code only to think, “what idiot wrote this?!” … when I slowly realize that I’m the only author. Experience can’t be taught. :)
- michaelfeathers 5y ago“The string is a stark data structure and everywhere it is passed there is much duplication of process. It is a perfect vehicle for hiding information.” - Alan J. Perlis
- cratermoon 5y agoAt least today we have string types which know their own length and character set. Two strings walk into a bar and sit down. The bartender says, "So what'll it be?" The first string says, "I think I'll have a beer quag fulk boorg jdk^CjfdLk jk3s d#f67howe%^U r89nvy~~owmc63^Dz x.xvcu" "Please excuse my friend," the second string says, "He isn't null-terminated."