string is rarely useful as a function argument

Timon Gehr timon.gehr at gmx.ch
Wed Jan 4 14:31:57 PST 2012


On 01/04/2012 07:08 PM, deadalnix wrote:
> Le 01/01/2012 23:46, Timon Gehr a écrit :
>> On 01/01/2012 11:36 PM, deadalnix wrote:
>>> Le 31/12/2011 19:13, Timon Gehr a écrit :
>>>> On 12/31/2011 06:32 PM, Chad J wrote:
>>>>> On 12/30/2011 05:27 PM, Timon Gehr wrote:
>>>>>> On 12/30/2011 10:36 PM, deadalnix wrote:
>>>>>>>
>>>>>>> The #1 quality of a programmer is to act like he/she is a morron.
>>>>>>> Because sometime we all are morrons.
>>>>>>
>>>>>> The #1 quality of a programmer is to write correct code. If he/she
>>>>>> acts
>>>>>> as if he/she is a moron, he/she will write code that acts like a
>>>>>> moron.
>>>>>> Simple as that.
>>>>>
>>>>> Programs worth writing are complex enough that there is no way any
>>>>> of us
>>>>> can write them perfectly correct code on first draft. There is always
>>>>> going to be some polishing, and maybe even /a lot/ of polishing, and
>>>>> perhaps some complete tear downs and rebuilds from time to time.
>>>>> "Build
>>>>> one to throw away; you will anyways." If you tell me that you can
>>>>> always write correct code the first time and you never need to go back
>>>>> and fix anything when you do testing (you do test right?) then I will
>>>>> have a hard time taking you seriously.
>>>>
>>>> Testing is the main part of my development. Furthermore, I use
>>>> assertions all over the place.
>>>>
>>>
>>> Well, if you write correct code, you don't need assertion. They will
>>> always be true because your code is correct. Stop wasting your time with
>>> that. Remeber the #1 quality of a programmer : write correct code.
>>>
>>> See how stupid this becomes ?
>>
>> You miss the point. Testing and assertions are part of how I write
>> correct code.
>
> So, to write correct code, you need to asume you'll write incorrect
> code. Writing correct code is your goal. Asuming you'll do stupid stuff
> is a quality required to advance toward this goal.

You are free to believe whatever you want, but I think that strategy you 
are describing is a recipe for writing buggy code.

> And, saying that you test and assert a lot,

Code for which no tests exist is neither correct nor incorrect. 
Assertions are a neat way to detect parts of the application whose 
implementation is incomplete.

> you confirm that point.

No.


More information about the Digitalmars-d mailing list