OT: CS education gone wrong (Was: Re: TDD is BS?)

H. S. Teoh hsteoh at quickfur.ath.cx
Fri Jun 21 16:58:15 PDT 2013


On Fri, Jun 21, 2013 at 04:02:20PM -0700, Walter Bright wrote:
[...]
> /****************************************************************************
> See "Algorithms" Second Edition by Robert Sedgewick.  Boyer-Moore string
> search routine.
> ****************************************************************************/
> char *strstr(const char *text, const char * pattern)
> {
[...]
> }

Very nice!

Does it help at all to cast to uint[] and search that instead of just
char[]? Or do the complications caused by non-alignment outweigh the
benefits?

And where's the unittest block? ;-)  (OK OK, I know this wasn't written
in D. But I had to ask. :-P)

Also, this is a prime example of code you'll *never* arrive at just by
blind application of TDD. (And there's my feeble attempt to bring this
back on topic. :-P)


T

-- 
This sentence is false.


More information about the Digitalmars-d mailing list