TDPL notes, part 1
Lars T. Kyllingstad
public at kyllingen.NOSPAMnet
Thu Jul 15 06:52:48 PDT 2010
On Thu, 15 Jul 2010 12:13:27 +0200, Tim Verweij wrote:
> On 14 July 2010 14:28, bearophile <bearophileHUGS at lycos.com> wrote:
>
>> (...)
>> P 10:
>> In this line of code:
>> while (!input.empty) {
>> There is not so much need of using an external function plus a
>> negation: while (input.length) {
>> (...)
>>
>>
> I like writing:
> while (!input.empty) {
> To me, it better shows the meaning of the condition.
I completely agree. I have started using the range interface for arrays
whenever possible. It makes code a lot more self-explanatory, easier to
read, and easier to reason about.
-Lars
More information about the Digitalmars-d
mailing list