Path: csiph.com!usenet.pasdenom.info!news.albasani.net!.POSTED!not-for-mail From: BGB Newsgroups: comp.lang.java.programmer Subject: Re: multi-line Strings Date: Tue, 11 Dec 2012 15:02:30 -0600 Organization: albasani.net Lines: 36 Message-ID: References: <7f36342c-2331-4484-874b-4a0f8953f160@googlegroups.com> <50c74c8a$0$282$14726298@news.sunsite.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Trace: news.albasani.net DwqHzRhrVztXarDgvzJ3NcUoyVeB94ZkhnwZ5D3sszRY/TGm5U4Nf6D5FrgHBVD62rnkR8vaXHFOScUTqt+tcQ== NNTP-Posting-Date: Tue, 11 Dec 2012 21:05:32 +0000 (UTC) Injection-Info: news.albasani.net; logging-data="PSFpy4cpHNxIXavW6nrZVUrJS2k/gROU5lciktCPfVU24aurxB+equAVGPyYTlSJajpFAgRxe2DGSmo/dPAyzj9zQ32h2j7nYBLwGdNjDM0GVHgxCH8Y0mg0b5ZHNe83"; mail-complaints-to="abuse@albasani.net" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121026 Thunderbird/16.0.2 In-Reply-To: <50c74c8a$0$282$14726298@news.sunsite.dk> Cancel-Lock: sha1:cGWH5Pl17ewd+mAZWpp1yxGhYrs= Xref: csiph.com comp.lang.java.programmer:20257 On 12/11/2012 9:08 AM, Arne Vajhøj wrote: > On 12/11/2012 1:58 AM, William Bonawentura wrote: >> IMHO final code does not need to have any strings literals. Strings >> should be allways created via out-of-code resources. > > In general yes. > > There are probably some exceptions. I would not want Java keywords to > come from an external resource for a Java compiler. > > :-) > IMO, about the only things (strings-wise) which really make sense being moved into external resources are: default configuration options (debatable, if the config file will override them anyways); (potentially) messages intended for human readers or similar (say, to allow language-specific translations or similar). if the bulk of the string literals are things internal to the program (rather than intended for an end user), then it makes little sense to move them to external resources (IME, most string literals tend to be program internal anyways, with human-readable messages few and far between, and most of these in-turn being internal debugging messages). with user-readable strings, the program could still be developed under a policy like "if you need the messages in a language you can read, either learn English (or Japanese or Chinese or similar) or get a dictionary", so making them external may not make much sense in this case. even with language-specific strings, unless using magic numbers, a string may still be needed to refer to them.