Hacker Newsnew | past | comments | ask | show | jobs | submit | sapeint's commentslogin

Literally has been used in that way for literally hundreds of years. From Charles Dickens ("He had literally feasted his eyes on the culprit.") and Charlotte Bronte ("Literally I was the apple of his eye"), to Mark Twain (in Adventures of Tom Sawyer) and F. Scott Fitzgerald (in The Great Gatsby) -- among others.

This "Literally shouldn't be used figuratively" is a rather modern construct that was artificially created.


BTW, the use of a size 1 array in the struct is a common 'hack', which has some form of dynamic arrays in structs. When the object is allocated through malloc, the size of the struct is actually smaller than the size you want for the array, so you allocate the size you want for the struct and add it to the size you want for the array. You can then access this memory after the structure, since it's technically allocated a part of it. As to why it is size 1, and not size 0, some compilers don't accept a size 0 array, so it's probably size 1 to ensure compatibility with those compilers. This is commonly referred to as the 'C Struct Hack'.


Reminds me of a few years back when I was still new to Linux (and anything non-Windows in general tbqh), and I accidentally nuked /bin. That was a fun time. I happened to have Firefox and an IRC Client opened. I tried a few different things (on the advice of others in an IRC channel I happened to be in), but eventually a friend created a VM of the same Linux Distro and then compressed his /bin and sent it to me -- along with a few required programs to uncompress it just in case. That was a fun day or two. Taught me a few important things though!


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

Search: