Obvously, 'bad code' is on-topic for many definitions of 'bad code'. The particular class of badness I'm asking about is code that:
is unclear without an in-depth knowledge of code standards or requires lookup of such standards.
could be easily rewritten to make the functionality obvious
could be easily rewritten to avoid mental breakdowns to debugging/maintenance/enhancement engineers
would cause the originating programmer to get fired if in an industry setting
is an extremely bad contribution to a 'repository of knowledge' and a poor example for the more inexperienced developers who use this site
This question was prompted by this exchange:
++*p++ does'nt work on second element in array?
Such practices are rarely seen outside homework questions because industry developers who wrote such code are now slinging burgers. I do a lot of maintenance/enhancement work and so have an intense dislike of such questions/code. I suspect most of them are assignment dumps and would like to see such code gone from SO.
I searched for 'Is bad code on-topic' here first:)