Re: pattern equality test?

From: Michael Mendelsohn (keine.Werbung.1300_at_michael.mendelsohn.de)
Date: 03/19/04


Date: Fri, 19 Mar 2004 09:40:54 +0100


"Arthur J. O'Dwyer" schrieb:
> > after all it's supposed to be neither language nor OS-specific, and some
> > C code that gets posted is pretty language specific (using array index
> > -1, for example)...
>
> That's not specific to C -- it's not even part of C! :)

Compiles & works, though.

> If I'd just dumped two pages of C code on the newsgroup, instead of
> my algorithm in English, you wouldn't have needed me to clarify what I
> meant by two prefixes' "matching," for example.

Yes, either I'd have taken the extra time to read the code, or I
wouldn't have cared.

I would have consulted a C manual to clarify e.g. this:

int prefixMatch(char* patt1, char* patt2)
{
  while ( *patt1 == *patt2 && *patt1++ ) patt2++;
  return ( *patt1=='*' || *patt2=='*' || !*patt1 || !*patt2 );
}

Oh, and if I write a comment to show what it does, then I can as well
write the comment without the code and not need to clarify. :)

I'm sure you wouldn't write code like this.
Michael

-- 
Feel the stare of my burning hamster and stop smoking!


Relevant Pages

  • Re: Not Clinical-Grade Definitions (was: Definition Challenge)
    ... scientific process because continuous concepts are very difficult to ... To clarify, being difficult to represent in English is NOT the same ...
    (talk.origins)
  • Re: good downloadable english dictionary
    ... On Wed, 26 Mar 2008 23:36:39 GMT, Dan S. posted: ... to clarify, I'm looking not presenting. ... I'm taking a furrin language with a lot of English ...
    (alt.usage.english)
  • Re: Die Beste F1 Fahrer?
    ... click on publications and then on the link for the actual ... To clarify - the 100p document is a Masters Thesis written ... (in English) ... My German isn't good enough to decipher ...
    (rec.autos.sport.f1)
  • Re: UML notation question...
    ... >>This is why we don't code in English. ... that would certainly clarify things. ... Suppose a company has Employees, which include union members, ... must be either Union Members or Confirmed Employees (of course they ...
    (comp.object)
  • Re: [OT] Indian C programmers and "u"
    ... >perhaps because in other languages, ... In English they are not, ... >I certainly don't want anyone to clarify why not for me, ... >There still remains however a tiny, infinitesimal chance that they ...
    (comp.lang.c)