Talk:String case

From Rosetta Code
Revision as of 13:25, 8 May 2011 by 89.168.187.117 (talk)

I think the task must explicitly refer to an encoding to use. I guess it is should be ASCII or else 8-bit Latin-1. If not, as in the case of a more or less full Unicode, changing the case would require some further definitions, see Unicode case mappings. --Dmitry-kazakov 10:18, 11 June 2009 (UTC)

I think the idea was to use the default encoding for a string variable. The hope was probably to show string functions built in to languages. Maybe we could specify to use the encoding of a string literal? --Mwn3d 12:03, 11 June 2009 (UTC)
That sounds reasonable. However I think that the task reader would rather expect something else, e.g. an advise how to capitalize a string, which is another and quite non-trivial task. --Dmitry-kazakov 12:21, 11 June 2009 (UTC)
This task gets hard once you're dealing with non-ASCII, so I'd accept solutions that only handle ASCII and leave everything else alone. If a language supports more (e.g., through locale control) it should be highlighted. —Donal Fellows 12:52, 11 June 2009 (UTC)
Different encodings do indeed present additional problems, but that's why most platforms provide facilities to handle them. Thus, you'll get at least three types of examples: Those which only handle ASCII, those which only handle Unicode, and those which handle both. Regardless of the scenario, I'm typically strongly against limiting coverage to only handle the simplest and/or most common cases. If a language or library has a difficult time coping with a scenario, and that difficulty can be illustrated by comparison with something that can handle that scenario more easily, then that scenario is a valid point of comparison. The biggest problem arises when a single task ends up covering multiple fairly categorical scenarios, causing the task page to balloon to difficult-to-manage sizes. At that point, it usually needs to be divided into multiple pages, usually one per scenario, as in String Length. The converse is when the language presents one scenario, but few or no languages can provide an idiomatic implementation within a screenfull of lines*; In that case, a per-language division such as in RCBF or RCSNUSP becomes warranted. (*) The calculation of what constitutes a "screenfull of lines" could involve taking the minimum vertical resolution that covers 90% of the visitors, assuming a 72 dpi and a font size of 12-14 points—or it could be entirely subjective. --Short Circuit 15:59, 11 June 2009 (UTC)

The C++ version is *not* using STL. It is using a class template from standard C++, which was adopted from STL.