Subj : Re: Software Job Market Myths To : comp.programming,comp.software-eng From : Chris Sonnack Date : Tue Aug 16 2005 10:41 pm Richard Heathfield writes: >> It's a little bit like asking a supposed C programmer about this: >> >> char* strconcat(char* s1, char* s2) > > This appears to be an attempt to build a new string by concatenating > two old ones. It has some problems. [BWG] Ya think? >> { >> char buf[256]; >> >> strcpy(buf, s1); >> strcat(buf, s2); >> >> return buf; >> } > > Firstly, the name is wrong. (Why?) Yep. (Conflicts with authority.) > Secondly, some qualifiers are missing from the input parameters. (Which?) Yep. (I'm constantly wondering about stuff like that.) > Thirdly, there's a scope problem. (What?) Yep. (When you're out, you've stacked the odds against you.) > Fourthly, there's a robustness problem, which occurs twice. (What?) Yep. (Life often overflows our expectations, doesn't it.) > Fifthly, there's an efficiency problem. (Which stdio.h routine is an > appropriate fix?) Five for five! (I'd have sprinted for my own solution, but I imagine theirs others.) But I'd be floored if you didn't have even more to say... > I would almost certainly have other things to say,... Ha! I knew it. (No, of course I hadn't read this bit, yet :-) > ...depending on the interviewer's answers to the above questions. Never > forget that an interview is a two-way process! :-) > >> If they don't have *something* meaningful to say immediately, they >> probably aren't the sort of C programmer we'd want. :-| > > And if the interviewer doesn't have some handy answers to /my/ questions, > they probably aren't the sort of client I'd want. I will admit, your (I assume carefully chosen) phrasing did cause me to have to think about which (what?) problem you meant. (& I have a feeling your answer to five might differ from mine. If you don't mean the most obvious choice (or mine, if different), I'm not sure which you mean.) > At interviews, whenever I remember (which isn't always) I try to ask the > techie member of the interview team a simple question about the technology > about which he is interviewing me. For example, for a C interview, "what > type of value does main return?" If the techie gets it wrong, that's a good > sign that I probably want to be elsewhere. "Main returns a value???" ;-| p.s. I considered spelling 'buf' two different ways, but figured the "out" might be that 'buff' refered to something global or in file scope. [shrug] p.p.s. No, you're right, no sane programmer would name a non-local, 'buff'..... -- |_ CJSonnack _____________| How's my programming? | |_ http://www.Sonnack.com/ ___________________| Call: 1-800-DEV-NULL | |_____________________________________________|_______________________| .