C Pointer Alignment Chart
p[0] = x; p += 1; LAWFUL GOOD *p = x; p++; NEUTRAL GOOD p++; p[-1] = x; CHAOTIC GOOD (p++)[0] = x; LAWFUL NEUTRAL *p++ = x; TRUE NEUTRAL p++[0] = x; CHAOTIC NEUTRAL 0[p++] = x; LAWFUL EVIL *((p += 1) - 1) = x; NEUTRAL EVIL (~0)[p=~(size_t p)] = x; CHAOTIC EVIL
A nine-panel alignment chart categorizes equivalent-looking C pointer expressions as lawful, neutral, or chaotic. The joke is that increasingly obscure pointer arithmetic and operator precedence are treated like moral alignments, with the final expression becoming deliberately unreadable. It is typically shared by programmers as a reaction to cursed, clever, or needlessly complicated C code.
code snippets / фрагменты кодаalignment chart / таблица мировоззренийcomputer programming / компьютерное программированиеpointer variable / указательarray indexing / индексация массиваincrement operator / оператор инкрементаassignment operator / оператор присваиванияcolored text / цветной текстdark background / тёмный фонnine-panel grid / сетка из девяти панелей
- @profunctor_io / 7873 2022-04-10
- @ithueti / 5989 2022-04-10
- @right_wing_dev_squads / 8380 2023-12-25
- Template
- Alignment Chart
- Type
- image
- Size
- 800×640 · 65.6 KiB
- Mood
- absurd, nerdy
- Language
- en
- Added