When Code Is Impossible to Read
fn load_maj_min(block: [u8; 4 * 15]) -> (u16, u32) { if 0 != block[0] || 0 != block[1] { (block[1] as u16, block[0] as u32) } else { // if you think reading this is bad, I had to write it (block[5] as u16 | (((block[6] & 0b0000_1111) as u16) << 8), block[4] as u32 | (((block[7] as u32) << 12) | (((block[6] & 0b1111_0000) as u32) >> 4) << 8) } }
A screenshot shows dense, confusing Rust code with a highlighted comment saying that writing it was even worse than reading it. The joke is a relatable programmer reaction to incomprehensible code and the suffering behind its creation.
computer code / компьютерный кодcode editor screenshot / скриншот редактора кодаRust programming language / язык программирования Rusthighlighted comment / выделенный комментарийmonospaced font / моноширинный шрифтcurly braces / фигурные скобкиparentheses / круглые скобкиbinary numbers / двоичные числа
- @dev_meme / 3683 2021-09-12
- Type
- image
- Size
- 640×264 · 31.4 KiB
- Mood
- sarcastic, relatable
- Language
- en
- Added