I want to do something that is a little unusual, but not obviously off-topic. As a result, I thought I'd post here first.
I got a pull request into a code base I (professionally) maintain. I'd like to post it here. I didn't write the code, but it is code that I maintain, so this is on-topic. That being said, there are reasons I feel it might be off-topic. Namely:
- I obviously looked over the code myself. By my standards the code is (to put it mildly) very poorly written, and will be rejected.
- As a result, I'm not really looking for suggestions on how to improve the code: I know what is wrong with it, and it will be completely rewritten.
- Rather what I'm interested in is how other (experienced) developers would view the code, and how they might approach the same problem. As a result I'm now realizing that, in a very real sense, I'm still looking for a code review.
- For various reasons, I'm also thinking about adding this code sample to my list of interview questions for candidates (we hire on a fairly regular basis). It has enough rookie mistakes in it that I feel like I should be able to present it to an experienced developer (with appropriate background context), ask "What is wrong with this code?", and get some coherent answers.
In short, I'm looking for a code review, but not for the usual reasons. While my reason for asking for a code review probably shouldn't matter (as long as it is on-topic), I feel like part of my motivations for asking for the code review is not in the spirit of this site (i.e. reason #4 above). As a result, I'd like some feedback on whether or not I might be on topic.