You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Ivan.S (JIRA)" <ji...@apache.org> on 2008/11/14 10:10:44 UTC

[jira] Issue Comment Edited: (LUCENE-1439) Inconsistent API

    [ https://issues.apache.org/jira/browse/LUCENE-1439?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12647548#action_12647548 ] 

ivan.s edited comment on LUCENE-1439 at 11/14/08 1:09 AM:
----------------------------------------------------------

Can anyone open an umbrella bug for this?
I think we should first collect all inconsistencies, then someone (including me) start to make patches.

BTW one more thing I've noticed: some methods even start with uppercase.
Common, there are books written about Lucene, such things are just painful ;)
It needs a clear API.

I'm now using Lucene in a project, it helps, I like it. So I would like to contribute (my time and) patches after
we've sorted out, what the inconsistencies are, sort them by priority, and collect their locations.

Umbrella bug or not?

      was (Author: ivan.s):
    Can anyone open an umbrella bug for this?
I think we should first collect all inconsistencies, then someone (including me) start to make patches.

BTW one more think I've noticed: some methods even start with uppercase.
Common, there are books written about Lucene, such things are just painful ;)
It needs a clear API.

I'm now using Lucene in a project, it helps, I like it. So I would like to contribute (my time and) patches after
we've sorted out, what the inconsistencies are, sort them by priority, and collect their locations.

Umbrella bug or not?
  
> Inconsistent API 
> -----------------
>
>                 Key: LUCENE-1439
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1439
>             Project: Lucene - Java
>          Issue Type: Bug
>    Affects Versions: 3.0
>         Environment: any
>            Reporter: Ivan.S
>            Priority: Minor
>
> The API of Lucene is totally inconsistent:
> 1)
> There are a lot of containers which don't implement an interface which indicates this fact
> (for pre-java-1.5 Lucene it could be Collection, for post-ajva-1.5 Lucene it could be more general Iterable)
> Example:
>  IndexSearcher: "int maxDoc()" and "doc(int i)"
> 2)
> There are a lot of classes having non-final public accessible fields.
> 3)
> Some methods which return values are named something() others are named getSomething()
> Best one is: Fieldable:
> without get: String stringValue(), Reader readerValue(), byte[] binaryValue(), ...
> with get: byte[] getBinaryValue(), int getBinaryLength(), ...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


Re: [jira] Issue Comment Edited: (LUCENE-1439) Inconsistent API

Posted by Chris Hostetter <ho...@fucit.org>.
: Can anyone open an umbrella bug for this?
: I think we should first collect all inconsistencies, then someone (including me) start to make patches.

Don't worry about it.
if you open a bunch of bugs, someone can/will group them.

: BTW one more thing I've noticed: some methods even start with uppercase.
: Common, there are books written about Lucene, such things are just painful ;)

legacy code is legacy code ... static methods with capitalized case names 
were added long ago as constructor-esque factories, probably because it 
was in voue at the time.  They may make the APIs 
inconsistent, but for all the people out there using them leaving them 
aloe has been one less thing to worry about when upgrading.

deprecating/removing methods because there signatures are confusing or 
missleading is one thing, generally a very good thing -- getting rid of 
them for aesthetics and consistency is another (less obviously good) 
thing.


-Hoss


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org