[Info-vax] OpenVMS system programming language
Arne Vajhøj
arne at vajhoej.dk
Mon Feb 24 20:33:07 EST 2025
On 2/24/2025 8:05 PM, Lawrence D'Oliveiro wrote:
> On Mon, 24 Feb 2025 16:55:31 -0500, Arne Vajhøj wrote:
>> Type declarations are part of the Pascal way.
>>
>> But I don't think it is the same in OO languages.
>>
>> I have never heard a Java developer ask for it.
>
> Never written things like this?
>
> private final HashMap<Integer, ArrowLabel>
> SatLabels = new HashMap<Integer, ArrowLabel>();
I would write:
private final Map<Integer, ArrowLabel> satLabels = new HashMap<Integer,
ArrowLabel>();
to follow OO best practice and Java coding convention.
But I think it is good code.
It is very clear what it is. All Java developers know what Map
and HashMap are.
Introducing application specific aliases for Map<Integer, ArrowLabel>
and HashMap<Integer, ArrowLabel> would make the code less readable.
> Or this?
>
> return
> new Iterable<Map<String, String>>()
> {
> public Iterator<Map<String, String>> iterator()
> {
> return
> new ResultMapIterator
> (
> Resolver.query
> (
> /*uri =*/ ProviderUri,
> /*projection =*/ FieldNames,
> /*selection =*/ Selection,
> /*selectionArgs =*/ SelectionArgs,
> /*sortOrder =*/ SortOrder
> ),
> FieldNames
> );
> } /*iterator*/
> } /*Iterable*/;
I see lots of problems in that code.
I don't consider lack of type aliases as one of them.
Arne
More information about the Info-vax
mailing list