I have the following code:
This.is.a.supper.long.name = This.is.another.supper.long.name
Currently the only method I know is to escape the newline:
This.is.a.supper.long.name = \
This.is.another.supper.long.name
Is there any elegant solution to this?
There are several approaches.
common = This.is
common.a.supper.long.name = common.another.supper.long.name
If that doesn't help, you can
name = This.is.another.supper.long.name
This.is.a.supper.long.name = name
or
setName(This, getName(This))
where the methods allow to hide the long access path. This becomes even more readable when you can change This
:
This.setName(This.getName())
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With