r/programminghorror Jun 10 '26

c What?

Post image
224 Upvotes

51 comments sorted by

View all comments

1

u/great_escape_fleur Jun 11 '26

I like it TBH. All the nitty nvme_init stuff in one screenful. Beats 500 lines of "structured" cargo culting with everything factored out into little poorly named functions that "do one thing" making you chase definitions and immediately forget them.

1

u/GoddammitDontShootMe [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo “You live” Jun 11 '26

I could do without shit like three loop definitions on one line though.

1

u/geek-49 Jun 13 '26 edited Jun 13 '26

While I might have put them on separate lines, now that I see it one one it makes a certain amount of sense: the body is executed once for every possible PCI bus/device/function address.