string is rarely useful as a function argument

Chad J chadjoan at __spam.is.bad__gmail.com
Sat Dec 31 10:48:02 PST 2011


On 12/31/2011 01:13 PM, Timon Gehr wrote:
> 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.
>>
>> Tsk tsk.  Missing the point.
> 
> Not at all. And I don't take anyone seriously who feels the need to 'Tsk
> tsk' btw.
> 

Well, you've certainly a right to it.

I just take it a little rough when it seems like someone's words are
being intentionally misread.

>>
>> I believe what deadalnix is trying to say is this:
>> Programmers should try to write correct code, but should never trust
>> themselves to write correct code.
>>
> 
> No, programmers should write correct code and then test it thoroughly.
> 'Trying to' is the wrong way to go about anything. And there is no need
> to distrust oneself.
> 

There's a perfect reason to distrust oneself: oneself is a squishy
meatbag that makes mistakes.

Repeated "trying" with rigor applied will lead to success.

> Anyway, I have a _very hard time_ translating 'acting like a moron' to
> 'writing correct code'.
> 

I'm pretty sure it's suggestive.  If an intelligent or careful person
acts like a moron, then they will be forced to assume that they will
make mistakes, and therefore take measures to ensure that the ALL
mistakes are caught and fixed or mitigated.  That is how you get from
'acting like a moron' to 'writing correct code'.

>> ...
>>
>> 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.
> 
>>
>> That said, it is extremely pleasant to have a language that catches you
>> when you inevitably fall.
> 
> That is why I also like Haskell.

I hear ya.  I feel Haskell is an important language to understand, if
not know how to use effectively.  I wish I knew how to use it better
than I do, but I haven't had too many projects that are amenable to it.


More information about the Digitalmars-d mailing list