I have code written very mysteriously. This will surely be a nightmare for those who do not understand me.
These are the fuzziness of string concatenation, the ternary operator, and the concatenation using the +
operator.
So my question is how to make this statement readable?
tb.setTally_narration( tb.getTally_mode().equals("Ca") ? "Receipt No. " .concat(tb.getTally_receipt_no()) .concat(", "+tb.getTally_mode()) : "Receipt No. " .concat(tb.getTally_receipt_no()+", "+tb.getTally_mode()) .concat(", "+tb.getTally_instrument_no()+", "+tb.getTally_instrument_date()+", "+tb.getTally_instrument_bank()) );
Edit: I understand this question is subjective. And I believe that it belongs to the codexview stackexchange site. Can it be moved there?
source share