No post body was provided.
Ask HN: What's the worst piece of code you've ever seen?
1–4 of 4 posts
Re: Ask HN: What's the worst piece of code you've ever seen?
#2This gem from today is pretty icky
TEST_PACKET_T *xmt_buffer = (TEST_PACKET_T *) radio_drv_cntl->xmt_buffer;
...
...
uint8_t msg_len = xmt_buffer->len;
// Fill the payload with 'data'
for(uint8_t indx=offsetof(TEST_PACKET_T, data); indxdata[indx] = indx;Re: Ask HN: What's the worst piece of code you've ever seen?
#3Not code so it doesn't count but a command.
Dos: "attrib," Will strip all attributes from all files in a directory. Very easy to run accidentally.
Has a partner though "dir," Show all files even hidden. Very berry handy.
Re: Ask HN: What's the worst piece of code you've ever seen?
#4I found a couple of amusing subreddits that covers this yesterday:
https://www.reddit.com/r/badcode
https://www.reddit.com/r/programminghorror
One of the top posts, the so-called Bogosort, made me laugh pretty hard, even though it's probably intentionally bad: https://imgur.com/kUizTX1