News for hackers. Stuff that matters.
Re:New Grad vs. Senior Dev by kazinator on Saturday March 28, 2020 @07:51PM (#22715212)
I would use the standard ISO C strstr instead of writing the function they are calling find.

Yes, we had strstr in 1994; it was in the 1989 ANSI C standard.

On a very small system, strstr will probably just be naively coded, to save space. On a big system, it might use Knuth-Morrison-Pratt or Boyer-Moore. I don't have to care; by using strstr, that decision is taken care of.

Re:New Grad vs. Senior Dev by ericlippert on Saturday March 28, 2020 @08:44PM (#22715449)
As I noted in the text, the actual problem that we had to solve was complicated by a great many factors not the least of which was the fact that the library had to handle strings from different string encodings.