Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #36413 > unrolled thread

Re: Pascal case of the field "BidiElementName"

Started by"Tristan B. Kildaire" <deavmi@disroot.org>
First post2017-03-22 19:22 +0200
Last post2017-03-23 15:52 -0700
Articles 4 — 3 participants

Back to article view | Back to comp.lang.java.programmer

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Pascal case of the field "BidiElementName" "Tristan B. Kildaire" <deavmi@disroot.org> - 2017-03-22 19:22 +0200
    Re: Pascal case of the field "BidiElementName" Arne Vajhøj <arne@vajhoej.dk> - 2017-03-22 19:45 -0400
      Re: Pascal case of the field "BidiElementName" "Tristan B. Kildaire" <deavmi@disroot.org> - 2017-03-23 15:47 +0200
      Re: Pascal case of the field "BidiElementName" lewbloch@gmail.com - 2017-03-23 15:52 -0700

#36413 — Re: Pascal case of the field "BidiElementName"

From"Tristan B. Kildaire" <deavmi@disroot.org>
Date2017-03-22 19:22 +0200
SubjectRe: Pascal case of the field "BidiElementName"
Message-ID<oaubt1$bst$1@gioia.aioe.org>
On 2017-03-01 04:08 AM, Stefan Ram wrote:
>   Why are most of the field names of the type
>
> javax.swing.text.AbstractDocument
>
>   written in Pascal case?
>
>   »BidiElementName«, »ContentElementName« ,
>   »ElementNameAttribute«, ...
>
Camel case?

[toc] | [next] | [standalone]


#36418

FromArne Vajhøj <arne@vajhoej.dk>
Date2017-03-22 19:45 -0400
Message-ID<oav2b2$1reo$1@gioia.aioe.org>
In reply to#36413
On 3/22/2017 1:22 PM, Tristan B. Kildaire wrote:
> On 2017-03-01 04:08 AM, Stefan Ram wrote:
>>   Why are most of the field names of the type
>>
>> javax.swing.text.AbstractDocument
>>
>>   written in Pascal case?
>>
>>   »BidiElementName«, »ContentElementName« ,
>>   »ElementNameAttribute«, ...
>>
> Camel case?

Pascal case is XxxxXxxxXxxx.

Camel case at least when compared to pascal case is xxxxXxxxXxxx.

Java convention is pascal case for type names and camel case
for member names.

Which is probably why Stefan asked.

But some of those were static final also known as const
so they should really have been all uppercase with underscore
aka XXXX_XXXX_XXXX.

https://en.wikipedia.org/wiki/PascalCase

Arne

[toc] | [prev] | [next] | [standalone]


#36420

From"Tristan B. Kildaire" <deavmi@disroot.org>
Date2017-03-23 15:47 +0200
Message-ID<ob0jl2$kcv$2@gioia.aioe.org>
In reply to#36418
> Pascal case is XxxxXxxxXxxx.
>
> Camel case at least when compared to pascal case is xxxxXxxxXxxx.
>
> Java convention is pascal case for type names and camel case
> for member names.
>
> Which is probably why Stefan asked.
>
> But some of those were static final also known as const
> so they should really have been all uppercase with underscore
> aka XXXX_XXXX_XXXX.
>
> https://en.wikipedia.org/wiki/PascalCase
>
> Arne
>
Oh I meant camel case with the first letter capitalised then. :)

[toc] | [prev] | [next] | [standalone]


#36422

Fromlewbloch@gmail.com
Date2017-03-23 15:52 -0700
Message-ID<5dcee78c-4864-4141-a8dc-47a919463373@googlegroups.com>
In reply to#36418
`static final` is not a synonym for "constant" in Java. `final` is necessary but not sufficient to declare a constant variable. `static` is neither necessary nor sufficient to declare a constant variable. While the core Java naming conventions do call for constant variables as defined in the JLS to have all upper-case names with underscores, it is an acceptable extension to so name `final` variables that point to immutable instances. Those aren't always constants per the JLS, but they're constant enough.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.java.programmer


csiph-web