You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-dev@hadoop.apache.org by Owen O'Malley <ow...@gmail.com> on 2022/07/11 17:34:36 UTC

style rules

I keep stubbing my toe on the unfortunate Hadoop style rule that says final
variables can't be all caps. :( Does this frustrate anyone else?

.. Owen

Re: style rules

Posted by Gyori Andras <ga...@cloudera.com.INVALID>.
Hi all!

I think this rule is all right. A real constant value (like PI) should be
declared as static final, which could be named in an all caps fashion
without violating the rule. In my opinion this rule is also a good safety
net: if you declare a constant without static, you might end up with a lot
of unnecessary value with each instance you have (and if you need multiple
instances of the value, then they are not true constants either eg. POJOs).

Regards:
Andras

On Mon, Jul 11, 2022 at 9:47 PM Wei-Chiu Chuang <we...@apache.org> wrote:

> I have seen violated that rule before and wondered if it's because final
> variables are essentially constants in other languages so all caps make
> sense?
>
> On Mon, Jul 11, 2022 at 10:35 AM Owen O'Malley <ow...@gmail.com>
> wrote:
>
> > I keep stubbing my toe on the unfortunate Hadoop style rule that says
> final
> > variables can't be all caps. :( Does this frustrate anyone else?
> >
> > .. Owen
> >
>

Re: style rules

Posted by Wei-Chiu Chuang <we...@apache.org>.
I have seen violated that rule before and wondered if it's because final
variables are essentially constants in other languages so all caps make
sense?

On Mon, Jul 11, 2022 at 10:35 AM Owen O'Malley <ow...@gmail.com>
wrote:

> I keep stubbing my toe on the unfortunate Hadoop style rule that says final
> variables can't be all caps. :( Does this frustrate anyone else?
>
> .. Owen
>