Hi, all

I found myself with some free time this weekend, so I'm trying to do some more 
hacking.  In particular, I'm again trying to get images in the "View in new 
window" window to be color-managed.  While doing some preliminary reading, it 
suddenly dawned on me that some of the lines in geeqie are _really long_.  I 
mean, unmanageably so.

Geeqie already has the beginnings of a set of coding standards, that being 
CODING in the root of the source tree, but I think we need to extend it some

I will refer to this screen-shot below:
[1] http://ocaml.xvm.mit.edu/~xsdg/stuff/geeqie/geeqie_typedefs.h.png

Here are some initial thoughts/suggestions:
#1) Limit line length to 100 characters
I think 100 characters is a nice balance between (not needing a huge editor to 
view the code) and (not forcing every other line of code to be split across 
multiple lines).  It's what we use at work and it seems to work very well.  For 
reference, the visible right margin in [1] is at 100 characters.

#2) We need to get rid of tabs as an acceptable form of whitespace
Yes, switching will be painful.  But ever since people started telling their 
editors to use 4-character or 2-character tabstops, tabs have become more pain 
than they're worth.  This is especially evident when people try to align code 
or 
comments written with one setting, and other people try to view them with an 
editor set to some different setting.  This is clearly visible in [1], and it's 
ugly and hard to read (see lines 369, 375, and 380 for one example; 383–387 for 
another).

As a replacement, I would suggest using 4 spaces per level of indentation.  I 
find that 4 spaces is wide enough that it's easy to visually track over long 
vertical distances (2 spaces is not), but is also not so wide so as to make it 
painful to write code 4-levels-deep (which is one problem with 8-space tabs).

#3) Set some guidelines for comment appearance
Should people use // or /*...*/ for single-line comments that appear on their 
own line or after a semicolon?  How much space should go between a comment and 
the semicolon?  Should comments on successive lines be aligned?

There are clearly tons of options here, and I think "use your judgment" will 
have to be a big part of it.  However, we still need some ground rules.  Look 
at 
[1] again.  The comments are _all over the place_.  Switching to spaces (see #2 
above) will make this much more readable, but having some sort of concrete 
suggestion would be a good thing.


As for how to accomplish these changes, my suggestion would be first, to decide 
on these, and possibly other, issues.  Once the decisions have been made, 
people 
writing new code should adhere to the guidelines.  At the same time, someone 
should go through and bring the old code into compliance (I might be up for 
this; we'll see).  GNU indent ([2]) will probably be useful for this process.

[2] http://indent.isidore-it.eu/beautify.html

--xsdg


------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://www.creativitycat.com 
_______________________________________________
Geeqie-devel mailing list
Geeqie-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geeqie-devel

Reply via email to