Subject: A neutral question ( was RE: [hackers-il] Re: Cognition and Progr amming [was Re: Re: Applying TOC to the profession of programming?] )

From: Omer Musaev <[email-masked]>
Date: Thu, 7 Mar 2002 18:36:03 +0200

> -----Original Message-----
> From: Oleg Goldshmidt [mailto:[email-masked]]
> Sent: Thursday, March 07, 2002 5:55 PM
> To: [email-masked]
> Subject: Re: [hackers-il] Re: Cognition and Programming [was Re: Re:
> Applying TOC to the profession of programming?]
> 
> 
> Shlomi Fish <[email-masked]> writes:
> 
> > In any case, if you'll excuse me I think I'll skip the rest 
> of this Perl
> > 5 vs. C++ OO-wise holy war. I have better things to do than 
> argue with
> > you about it.
> 
> No, no, you won't get off the hook so easily! Before you switch to
> Rindolf development, please go over the archive and tell us who
> started the jihad in the first place. We have forgotten... ;-)

Hackers, please stop this thread. It had produced too little signal
out of too much noise. It had degraded to personal punches and 
I just do not see nothing fruitful coming out. Nothing. 

Instead, here is a C++ quiz:

Given 2 strings a and b, produce string c in fastest way. I have some
thoughts on the matter, however I would like to hear from more 
experienced people what their opinion is. 

For the matter of clarity, following assumptions are made:

1. We are talking about std::string, whatever its implementation is
2. Switching to different platform/compiler/STL is out of question
3. a and b are allocated on stack, so should c be
4. We can assume following piece of code:

using std::string ;
{
   	string a = "abcdef" ;
	string b = "12345" ;
  
      string c = a + b ;  // <----   c should be allocated in same way
                          //         but the way of construction should be
faster. 
}

Your turn.

> 
> -- 
> Oleg Goldshmidt | [email-masked] 
> [Lisp] is the only computer language that is beautiful. 
>                       - Neal Stephenson 
> 
> ------------------------ Yahoo! Groups Sponsor 
> ---------------------~-->
> Tiny Wireless Camera under $80!
> Order Now! FREE VCR Commander!
> Click Here - Only 1 Day Left!
> http://us.click.yahoo.com/nuyOHD/7.PDAA/yigFAA/saFolB/TM
> --------------------------------------------------------------
> -------~->
> 
> To unsubscribe from this group, send an email to:
> [email-masked]
> 
>  
> 
> Your use of Yahoo! Groups is subject to 
> http://docs.yahoo.com/info/terms/ 
> 
>

---

From: Oleg Goldshmidt <[email-masked]>
Date: 10 Mar 2002 08:03:36 -0500

Omer Musaev <[email-masked]> writes:

> Given 2 strings a and b, produce string c in fastest way. 

c being concatenation of a and b, as I assume from what followed.

> 2. Switching to different platform/compiler/STL is out of question

And how are we going to determine what is "faster"? That may well
depend on platform/compiler/STL implementation/std::string
implementation.

-- 
Oleg Goldshmidt | [email-masked] 
If it aint't broken it hasn't got enough features yet.