Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 5 Apr 2002 10:04:27 -0800
From:      "David O'Brien" <obrien@FreeBSD.org>
To:        Mikhail Teterin <mi@aldan.algebra.com>
Cc:        mike@FreeBSD.org, cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/usr.bin/yacc main.c
Message-ID:  <20020405100427.A46969@dragon.nuxi.com>
In-Reply-To: <200204051656.g35GuUnF010963@aldan.algebra.com>; from mi@aldan.algebra.com on Fri, Apr 05, 2002 at 11:56:30AM -0500
References:  <20020405003033.F93859@espresso.q9media.com> <200204051656.g35GuUnF010963@aldan.algebra.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Apr 05, 2002 at 11:56:30AM -0500, Mikhail Teterin wrote:
> On  5 Apr, Mike Barcroft wrote:
> > David O'Brien <obrien@FreeBSD.org> writes:
> >> On Thu, Apr 04, 2002 at 07:17:57PM -0500, Mikhail Teterin wrote:
> >> > I'm scared of the vision of countless thousands of computers
> >> > calling strlen(temp_form) and constantly coming up with the same
> >> > number -- 16. Are you not?
> >>
> >> You are shitting me aren't you? I could find _thousands_ of such
> >> constant results in /usr/src.
> >
> > Indeed. Code readability always beats unmeasureable performance losses
> > hands-down.
> 
> Common, how is sizeof(foo) less (or more) readable than strlen(foo)?

DROP IT.  OpenBSD and NetBSD uses ``char *foo = "bar";''
We use ``char foo[] = bar";'' due to Mark's pickier lint.  I am not going
to change that line of our code.  BUT the other BSD's cannot use `sizeof'
because that will be 4 or 8, which is much less than the ?17? that
`sizeof' would be for us.  Thus have to use strlen(), and thus we WILL
use strlen().

Go buy yourself a gigahertz Athlon (Duron if you're cheap) and find
something REAL to worry about.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020405100427.A46969>