home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: sparky!uunet!mcsun!fuug!ksvltd!jarmo
- From: jarmo@ksvltd.fi (Jarmo Raiha)
- Subject: Re: How to test a programmer
- Organization: KSV Instruments ltd. Helsinki,Finland
- Date: Sun, 20 Dec 1992 11:59:17 GMT
- Message-ID: <1992Dec20.115917.1577@ksvltd.fi>
- References: <1992Dec15.180712.845@ksvltd.fi> <3891@isgtec.isgtec.com>
- Lines: 37
-
- robert@isgtec.com (Robert Osborne) writes:
-
- >Jarmo Raiha (jarmo@ksvltd.fi) wrote:
-
- >: I'm also beginning to think that especially programmers with a knowledge of
- >: compiler techniques will be lousy programmers. They tend to use
- >: too much shortcuts.
-
- >You should watch your generalizations.
-
- Yes , I must keep that in mind. I screwed up.
- My comment about programmers with compiler expertise
- really wasn't meant to be so rude and general (and insultive, perhaps)
- Sorry about that. I don't have enough experience to say such generalizations,
- and definitely - I was wrong.
-
- What I was meaning:
-
- I have seen some novice programmers (And I was one of them) whose
- coding style was guided by thinking 'what kind of code would the compiler
- emit in this case'. Just to optimize the C code.
-
- One of the worst examples:
- Use some time to expolore compiler's way to implement case statement.
- You know that it propably sometimes uses a set of branches and sometimes
- a jump table. And that a jump table is used when all case values
- are sequential. If you just could twist the case values to suitable ones ...
- And throw away the natural ones. This means that you spend
- some (quite much indeed) time to calculate the cpu cycles taken.
- Hoping that you can do that better than the optimizer ?
-
- At this moment you may wonder, if I was that poor programmer.
- Unfortunately the answer is yes. Maybe that is why I have a habit
- to look for this kind of a bad (IMHO) style.
-
- Jarmo Raiha
-
-