I was asked to provide some example code for a job interview and didn't have anything to offer, so I wrote the following function.
- It's something I recently needed, so it's not entirely contrived.
- It's simple enough to do in one function, so it can be reviewed easily.
- It's complex enough that a new programmer would make a mess of it.
- It's cutevisual. You can render the generated barcoderesult in a browser.
- It's useful, so I could make a little gist out of it.
The barcode is in the Interleaved 2 of 5 FormatInterleaved 2 of 5 Format. It's a simple format, and there's a Wikipedia article that explainscovers it well.