docs icon indicating copy to clipboard operation
docs copied to clipboard

Closes #147: provide reason why string templates shouldn’t be used

Open aral opened this issue 4 years ago • 8 comments

Specifically, because they cannot be localised.

aral avatar Nov 05 '21 13:11 aral

Is there a more specific subsection that could be linked to here? It's not immediately obvious that this page contains information to back this up

danirabbit avatar Nov 09 '21 17:11 danirabbit

@danrabbit Shall I remove the link? I’ve first-hand confirmed that template strings are not localisable (unless there is some configuration setting that’s not included in the developer guide for making them so) so the link is not necessary (I thought it would provide some interesting/related background).

For non-localised strings, I don’t know of any reason why template strings should not be used. Perhaps we should mention that also.

aral avatar Nov 09 '21 20:11 aral

I'm not doubting you, I'm just wondering if there's a more specific section of this guide that mentions this. Otherwise yeah, it might not be worth linking here. It might be worth opening another branch with a little hint pullout in the localization section for this guide though

I don't think we really necessarily need a reason other than this is the code style we use. A lot of things here—like cuddled else—are just convention

danirabbit avatar Nov 09 '21 20:11 danirabbit

Haha, didn’t think you were doubting me :) (Although, please do, I’m very new to these platforms.)

Regarding stating the reason: I feel it’s important as you don’t want these things to become religious in nature (ditto for design decisions). Some conventions, of course, are just that. But, in this case, template strings provide a major usability advantage to format strings in that you don’t have to remember a bunch of type placeholders and there is a compelling reason why they can’t be used so I feel it would be useful.

I’m happy if we do so without the link if you feel the link would add more confusion than clarity :)

aral avatar Nov 10 '21 06:11 aral

@aral yeah if you don't have a more specific link handy, I would just omit the link

danirabbit avatar Nov 16 '21 19:11 danirabbit

@aral Are you in a position to progress this?

jeremypw avatar Dec 10 '21 17:12 jeremypw

@aral Are you in a position to progress this?

Will do.

aral avatar Dec 11 '21 11:12 aral

Thanks - don't forget to resolve the conflicts with master.

jeremypw avatar Dec 11 '21 17:12 jeremypw