home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / c / 18702 < prev    next >
Encoding:
Text File  |  1992-12-21  |  1.8 KB  |  48 lines

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