S
Stefan Ram
In Java, I am used to write code like:
void f( final int i ){ final int j = g( i ); ... }
. But neither »const« nor »readonly« in C# seem
to be apppropriate for this purpose.
The intention is to enhance readability of source
code by conveying the intention that
- the parameter i will not be changed within
the body and that
- the variable j will not be changed after its
initialization.
Something similar is possible with »const« in C
and C++.
void f( final int i ){ final int j = g( i ); ... }
. But neither »const« nor »readonly« in C# seem
to be apppropriate for this purpose.
The intention is to enhance readability of source
code by conveying the intention that
- the parameter i will not be changed within
the body and that
- the variable j will not be changed after its
initialization.
Something similar is possible with »const« in C
and C++.