You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Benedikt Ritter <be...@googlemail.com> on 2012/03/29 21:45:31 UTC

[csv] Rename methods on XXXLexer methods on CSVLexer

Hey,

how about renaming CSVLexer.simpleTokenLexer() and
CSVLexer.encapsulatedTokenLexer(), so that the method names express
what the methods do?
For example simpleTokenLexer() could be renamed to parseSimpleToken or
parseSimpleTokenContent.
Likewise encapsulatedTokenLexer() could be renamed to
parseEncapsulatedToken or parseEncapsulatedTokenContent.

Benedikt

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


Re: [csv] Rename methods on XXXLexer methods on CSVLexer

Posted by Benedikt Ritter <be...@googlemail.com>.
Am 29. März 2012 22:07 schrieb sebb <se...@gmail.com>:
> On 29 March 2012 20:45, Benedikt Ritter <be...@googlemail.com> wrote:
>> Hey,
>>
>> how about renaming CSVLexer.simpleTokenLexer() and
>> CSVLexer.encapsulatedTokenLexer(), so that the method names express
>> what the methods do?
>> For example simpleTokenLexer() could be renamed to parseSimpleToken or
>> parseSimpleTokenContent.
>> Likewise encapsulatedTokenLexer() could be renamed to
>> parseEncapsulatedToken or parseEncapsulatedTokenContent.
>
> They are private methods so the name is arbitrary.
> I also think the current names are OK.
>

I'm just saying, that method names usually are verbs (or contain
verbs). They describe something that gets done be a method.
Nouns are used for classes. It feels strange to have a method that is a lexer.

I don't think that private method names are arbitrary. They are far
less important than public methods. It's a matter of readability to
chose good names for private methods as well.

> I'm not sure I agree that the methods are parsers.
> They are closer to lexers.
>

If the methods don't "parse", how about "scan"?

>> Benedikt
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>> For additional commands, e-mail: dev-help@commons.apache.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>

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


Re: [csv] Rename methods on XXXLexer methods on CSVLexer

Posted by sebb <se...@gmail.com>.
On 29 March 2012 20:45, Benedikt Ritter <be...@googlemail.com> wrote:
> Hey,
>
> how about renaming CSVLexer.simpleTokenLexer() and
> CSVLexer.encapsulatedTokenLexer(), so that the method names express
> what the methods do?
> For example simpleTokenLexer() could be renamed to parseSimpleToken or
> parseSimpleTokenContent.
> Likewise encapsulatedTokenLexer() could be renamed to
> parseEncapsulatedToken or parseEncapsulatedTokenContent.

They are private methods so the name is arbitrary.
I also think the current names are OK.

I'm not sure I agree that the methods are parsers.
They are closer to lexers.

> Benedikt
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>

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