Re: strong/weak typing and pointers

From: Michael Hobbs (mike_at_hobbshouse.org)
Date: 11/02/04


Date: Tue, 02 Nov 2004 15:31:36 -0000

Andrea Griffini <agriff@tin.it> wrote:
> You didn't mention C++. Try this ...
>
> std::string s = "Wow";
> s += 3.141592654; // Perfectly valid
> s = 3.141592654; // Also valid

Those automatic coercions are always handy when writing code, but a
pain in the @$$ when reading it. I can't count the number of times
that I stepped through C++ code, saying "what the ...?", only to
realize that there was some perlish 'operator +=(const **' statement
tucked away in a header file somewhere. Good riddance, I say. (My
code only overrides the __or__ operator. ;-)

-- Mike



Relevant Pages

  • Re: Changing VBE WS-component name in code craches excel 97
    ... Thanks for your further detailed replies with broad outlook. ... writing code for future releases will come in handy, as I no doubt will find ...
    (microsoft.public.excel.programming)
  • Re: RfD: Memory Access Words
    ... Universidad de Cantabria ... So I've been reading this proposal and I'm finding that I can't digest ... I could see writing code using either ...
    (comp.lang.forth)
  • Re: reduce()--what is it good for? (was: Re: reduce() anomaly?)
    ... | minimal set of controls the same applies to writing code as well. ...
    (comp.lang.python)
  • Re: python interview quuestions
    ... Writing code is easy. ... Testing code is harder. ... Perhaps I'm reading more into your choice of words than you intended, ... documentation and tests? ...
    (comp.lang.python)
  • Re: question about macro?
    ... On 03/12/10 01:40 PM, Phil Carmody wrote: ... "you are always writing code to be read by someone else - yourself in the ... My tests certainly save me a lot of time and pain when going back to update my old code. ... Ian Collins ...
    (comp.lang.c)