On 5/17/07, Otis Gospodnetic <[EMAIL PROTECTED]> wrote:
Touchy topic: code style

Uh, oh... something everyone will have an opinion about ;-)

Should Solr be following the Lucene code formatting/style?  Lucene follows 
Sun's recommendation except for the 2-space indent, I believe.

Well, that's the general guidelines... there is a ton of lucene code
that doesn't follow that though.  One "violation" repeated everywhere
is

if (foo)
  bar();

Those don't bother me personally, I'm just pointing it out.

I'm asking because Solr is full of variable and method names that look like 
abbrevs ;)
- e.g. getDocListC - "C"?

Heh... I never realized abbreviations were off-limits.
In this particular case, I needed to refactor getDocList into a
caching version and a non caching version (C) and (NC).

, and on top of that the code is rather dense,without,many,spaces, so
it's hard to read, at least for me.

Spaces between lines, or spaces in a single line?

I tend to compress code where the logic is easy to understand...
sometimes spreading simple things out make it harder to see everything
in context.

How do the rest of you feel?  I volunteer to tidy up the code, if others agree 
with following Lucene's formating.  I believe Nutch and Hadoop already follow 
it.

Solr already has a policy that is the same as Lucene.
I'm fine with cleanups... just try to avoid breaking patches in JIRA.

-Yonik

Reply via email to