Global Feed Post Login
Replying to Avatar unclebobmartin

From: (ThyLobster) at 01/05 11:39

>

> The questions are:

> 1. Is there a code smell here?

Yes, but it's not a big one. Personally, in the case you presented, I would keep the duplicated string for two reasons. First, it reads better. Second, I do not trust that the two strings will remain duplicated. Some marketting or UI Designer will likely want to rephrase them and could easily make them different.

> 2. Do we really need to make variables out of duplicated strings under ALL circumstances?

No. I would take it case by case.

CC: #[3]

CC: #[4]

Avatar
ThyLobster 2y ago

Thank you!

In the example I added, the string repeats twice, but in the real case, it repeats 25 times. But other lines also duplicate 2 or 3 times.

I just don't think we should make it ugly, less readable, more complex... So I guess we agree.

Thanks again.

Reply to this note

Please Login to reply.

Discussion

No replies yet.