Re: How to create string of repeated characters?

From: Alex Hunsley (lard_at_tardis.ed.ac.molar.uk)
Date: 06/21/04


Date: Mon, 21 Jun 2004 00:25:09 GMT

Boudewijn Dijkstra wrote:
> "Alex Hunsley" <lard@tardis.ed.ac.molar.uk> schreef in bericht
> news:10d0ecbd3vu3v5d@corp.supernews.com...
>
>>Boudewijn Dijkstra wrote:
>>
>>>"Alex Hunsley" <lard@tardis.ed.ac.molar.uk> schreef in bericht
>>>news:10cjeo4hd4poofe@corp.supernews.com...
>>>
>>>
>>>>I've had to do work on at a client site where all I had was a 80char
>
> dumb
>
>>>>terminal. No column markers there and no option to have a wider screen.
>>>>Well written code will be just as editable in this sort of environment.
>>>
>>>All things have their extremes. I assume that your example is one of
>>>those. If these working conditions can be expected, then yes it is
>
> (IMHO)
>
>>>wise to restrict your line-breaking habits. Otherwise it would be
>>>pointless and counter-productive.
>>
>>I can't see how it would be counter-productive to do things properly in
>
> the
>
>>first place and not rely on column markers! The 'proper way' being
>>propgrammatically making a string of the right length.
>
>
> Different people have different views on the 'proper way'. How do you
> define 'properly'? Do you have your entire code-editing ethics formulated?

I define 'proper' as the way which will

a) not depend on environment/editor factors (like column markings or
      wide format displays)

b) be extensible with little hassle

  (for example, if you want to generate 4,096 characters in a string,
there will be lots of cut'n'paste and more bloated code if you enter
those chars verbatim, and it is also prone to counting errors.)

  If you did it programmatically then you remove scope for counting
errors at future edits, and the code doesn't get massively bloated for
large number of chars.
I see no benefits and only problems in doing it the 'verbatim string'
way... sure, if it was ten chars or something similar and you had little
reason to think it would ever change, then that wouldn't be bad. Any
more chars, or a string prone to change, and I'd say do it programmatically.



Relevant Pages

  • Re: Writing to file in ASCII format + one more question
    ... Use a StreamWriter constructed with the proper System.Text.Encoding instance ... I have a string that i want to write into a file. ... I need my string will be 120 char length, and incase the string is less ... then 120 chars, i need to fill it with spaces till it will be 120 chars ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: [Emacs] Kommentieren
    ... ;; completely up to the user to decide, what the string ... "Chars preserved of STRING. ... `CHARS-PRESERVE' must be a parentized expression, ...
    (de.comp.editoren)
  • Re: Is it really true that native English speakers cannot tell skill and sgill apart?
    ... nonsensical proper name. ... the hearer wouldn't come up with a string that didn't conform). ... It isn't that I'm hearing a string of syllables that I'm perceiving to be meaningless, and then, for the sake of being able to call the thing a mondegreen, claiming it to be a proper name. ... language, and a passage is a bit difficult, I notice how something is ...
    (sci.lang)
  • Re: FASTEST way to try all strings (a until ZZZZZZZZZZZZZZZZZZZZZZZZ)
    ... > It will be a very huge table so I in my opinion. ... > When it would be used, than it should be converted to a string, however ... >> How would an array of Byte be any faster then an array of Char? ... >> array of Byte is needed, however the OP suggested Chars (A to Z, a to z ...
    (microsoft.public.dotnet.languages.vb)
  • Re: FASTEST way to try all strings (a until ZZZZZZZZZZZZZZZZZZZZZZZZ)
    ... > It will be a very huge table so I in my opinion. ... > When it would be used, than it should be converted to a string, however ... >> How would an array of Byte be any faster then an array of Char? ... >> array of Byte is needed, however the OP suggested Chars (A to Z, a to z ...
    (microsoft.public.dotnet.general)

Loading