From: <mj...@ga...> - 2005-05-13 07:36:01
|
Thomas J. Duck writes: > Per has provided us with a nice bit of code that allows us to avoid > libunicode altogether. I have made a few adjustments to it, and have > removed the unnecessary section invoking libunicode from plcore.c. Look > for the block beginning with the words "Per Persson". Note that I > changed the indentation for all of plP_text because I just couldn't deal > with it anymore. ;^) As far as whitespace/indentation is concerned, there is of course no one way that works for everyone, so in general it's best to stick to the plplot "standard" of 4 spaces per indentation level. Since everyone has their own development style I'm not particularly anal about this, but if I find myself wanting to work on a section of code that isn't indented in accordance with the rest of the code base, I will reformat it. It just gets too confusing otherwise, what with different choices used in different places. Consistency is a good thing. I recognize the standard argument against 4 spaces is that it handles many levels of nesting poorly, and my counter is that if you're at the 5th or 6th indentation level (or worse), it's already become too unwieldy as purely inline code and it's time start splitting logic off into helper functions. Typically static to avoid pollution of the namespace. Also instead of constructions like for (stuff) if (foo) { ... } you can do for (stuff) { if (!foo) continue; ... } (or "return" as applicable) and shave off an indentation level. Finally, mixing code changes with format changes is iffy, as has been pointed out on the list (note I've been as guilty of this as anyone). The preferable way to do this is to reformat first, commit, then bug fix, or vice versa. That way the commit that just changes whitespace can be safely ignored. -- Maurice LeBrun mj...@ga... |