Paul Herring wrote:
>
>
> On Tue, Apr 21, 2009 at 1:01 AM, Christopher Coale
> <[email protected] <mailto:chris95219%40gmail.com>> wrote:
> > God gave us pointers (and C++ gave us "new" and
> > "delete") for a reason - let's use them. :)
>
> And the compiler developers gave us profiling tools - perhaps we
> should be using them first rather than resorting to premature
> optimisation and guestimating?
>
> And, incidentally, if you're considering using pointers, I do hope
> you're planning on using the pointer wrappers, not the raw pointers
> themselves, and not abandoning them in favour of more premature
> optimisation.
>
> --
> PJH
>
> http://shabbleland.myminicity.com/ind
> <http://shabbleland.myminicity.com/ind>
> http://www.chavgangs.com/register.php?referer=9375
> <http://www.chavgangs.com/register.php?referer=9375>
>
>
Its more of a common-sense thing than premature optimization. In fact,
it isn't even exactly an optimization, its more of doing what should be
done in the first place. And common sense should tell you that 64 cycles
is slower than 1 cycle - where is the need for profiling tools? Sending
a pointer down the bus (whether it is a 32 or 64-bit bus) is much faster
(only takes 1 cycle) than sending 256 bytes of data down the bus. So,
where exactly is this "guestimate" you are talking about? You are acting
like pointers are the spawn of Satan, that should only be used in case
of an emergency. I understand they are a tad more difficult to work with
(because of management), but that is just absolute nonsense.