4 ms·
A much clearer solution, I would also add a comment reminding people how zip works.
by hartror 13y ago
A much clearer solution, I would also add a comment reminding people how zip works.
- artursapek 13y agoReally? What's the point in explaining a standard language function that they should know, and can just Google if they don't remember?
- ekimekim 13y agoIt's using a somewhat-obscure guarantee that doesn't come up in normal usage of the function - namely, that it will always get the iterator values in left-right order.
- andrewcooke 13y agoit depends on the kind of code you write. i guess if you're writing web server stuff, documenting this makes sense. but in maths-related code, it's pretty standard. you use something very similar to transpose matrices, for example. (and the original article is dealing with coords in graphics, which is "maths-related code" in my book, but perhaps not in everyone's)
- loarake 13y agoThe original source is taken from a medical image DICOM viewer. In my limited experience as a medical physics student, the people working with these tools would really benefit from a comment explaining the code. They are most definitely not coders, most of them having barely done anything more than write a few matlab scripts.
- duaneb 13y agoThis is hardly a typical environment. All code would be challenging, even commented code. Excessive commenting would be necessary: write the program again in English.