Evil C Contests 
Author Message
 Evil C Contests

 Gotta say, amusing as the first-year-student-programming-style contest is,
I (for one) don't think this is a particularly appropriate place for it. I
mean, c'mon, this is in _theory_ a forum for exercising our collective
knowledge of the C language. While this contest, as well as the IOCCC do
that, they also provide a wealth of truly bad examples for the beginner.

 <Shrug> Just a couple of bits.



Sun, 02 Aug 1998 03:00:00 GMT  
 Evil C Contests

Quote:

>  Gotta say, amusing as the first-year-student-programming-style
> contest is, I (for one) don't think this is a particularly
> appropriate place for it.

Where else would you put it?

Quote:
> I mean, c'mon, this is in _theory_ a
> forum for exercising our collective knowledge of the C
> language. While this contest, as well as the IOCCC do that, they
> also provide a wealth of truly bad examples for the beginner.
>  <Shrug> Just a couple of bits.

I think the bad examples are good for pointing out mistakes that
beginners make.  They are clearly labeled as bad, so I don't see the
problem.

-Jeff



Sun, 02 Aug 1998 03:00:00 GMT  
 Evil C Contests

Quote:

> Gotta say, amusing as the first-year-student-programming-style contest is,
>I (for one) don't think this is a particularly appropriate place for it. I

     Gasp!  You question the divine authority of His Holiness the
Moderator?  It's His contest.

Quote:
>mean, c'mon, this is in _theory_ a forum for exercising our collective
>knowledge of the C language. While this contest, as well as the IOCCC do

     Plenty of examples of this in the contest.

Quote:
>that, they also provide a wealth of truly bad examples for the beginner.

     True, but they're not nearly as subtle from what I've seen.
     Hail Eris!

Quote:
> <Shrug> Just a couple of bits.

     I think you should plot the downfall of civilization by coming up
with your own evil C contest.

Sincerely,

Gene Wirchenko

C Pronunciation Guide:
     y=x++;     "wye equals ex plus plus semicolon"
     x=x++;     "ex equals ex doublecross semicolon"



Sun, 02 Aug 1998 03:00:00 GMT  
 Evil C Contests

|>
|> >  Gotta say, amusing as the first-year-student-programming-style
|> > contest is, I (for one) don't think this is a particularly
|> > appropriate place for it.
|>
|> Where else would you put it?
|>
|> I think the bad examples are good for pointing out mistakes that
|> beginners make.  They are clearly labeled as bad, so I don't see the
|> problem.

I think that this IS a reasonable place, but I should prefer that
it were used for announcements of such contests, and the reporting
of results (probably with selected code).  I.e. I should prefer
that the 'entries' were submitted by Email, and not posted.

Right, now we have three different opinions in three postings :-)

Nick Maclaren,
University of Cambridge Computer Laboratory,
New Museums Site, Pembroke Street, Cambridge CB2 3QG, England.

Tel.:  +44 1223 334761    Fax:  +44 1223 334679



Mon, 03 Aug 1998 03:00:00 GMT  
 Evil C Contests




:|>
:|> >  Gotta say, amusing as the first-year-student-programming-style
:|> > contest is, I (for one) don't think this is a particularly
:|> > appropriate place for it.
:|>
:|> Where else would you put it?
:|>
:|> I think the bad examples are good for pointing out mistakes that
:|> beginners make.  They are clearly labeled as bad, so I don't see the
:|> problem.
:
:I think that this IS a reasonable place, but I should prefer that
:it were used for announcements of such contests, and the reporting
:of results (probably with selected code).  I.e. I should prefer
:that the 'entries' were submitted by Email, and not posted.
:
:Right, now we have three different opinions in three postings :-)
:
:
:Nick Maclaren,
:University of Cambridge Computer Laboratory,
:New Museums Site, Pembroke Street, Cambridge CB2 3QG, England.

:Tel.:  +44 1223 334761    Fax:  +44 1223 334679

The C contests can be quite illuminating or quite confusing depending
upon the reader's experience. I think that the posts should illuminate
why the code is "evil" and that a "proper" version of the code should
be included.



Tue, 04 Aug 1998 03:00:00 GMT  
 Evil C Contests

: >  Gotta say, amusing as the first-year-student-programming-style
: > contest is, I (for one) don't think this is a particularly
: > appropriate place for it.

: > I mean, c'mon, this is in _theory_ a
: > forum for exercising our collective knowledge of the C
: > language. While this contest, as well as the IOCCC do that, they
: > also provide a wealth of truly bad examples for the beginner.

: I think the bad examples are good for pointing out mistakes that
: beginners make.  They are clearly labeled as bad, so I don't see the
: problem.

But why don't we do something _productive_?

--
-=TED=-              |  Owner, HOMEBUILT-L mailing list



Wed, 05 Aug 1998 03:00:00 GMT  
 Evil C Contests


 > But why don't we do something _productive_?

Are you suggesting that there is something wrong with recreational
programming?

--
-----------------------------------------


-----------------------------------------



Sun, 09 Aug 1998 03:00:00 GMT  
 Evil C Contests

Quote:

>: I think the bad examples are good for pointing out mistakes that
>: beginners make.  They are clearly labeled as bad, so I don't see the
>: problem.
>But why don't we do something _productive_?

Feel free to suggest any contest/event/activity that you
think would be productive.

Personally, I think that the contest under discussion
_was_ productive, and certainly don't see how all
the complaints about it could be considered constructive.

--
* This is (no offense meant) just plain stupid. -- Peter Seebach



Sun, 09 Aug 1998 03:00:00 GMT  
 Evil C Contests

Quote:

> : I think the bad examples are good for pointing out mistakes that
> : beginners make.  They are clearly labeled as bad, so I don't see the
> : problem.

> But why don't we do something _productive_?

Actually--depending on how you look at it--that sort of contest
can be very productive in terms of learning and exercise. It is a
great excuse to get creative with algorithms. The part about
misleading/stupid comments is a different story. That is the malicious
part, so it can be a lot of fun as well.

        Bob.



Sun, 09 Aug 1998 03:00:00 GMT  
 Evil C Contests


: : >  Gotta say, amusing as the first-year-student-programming-style
: : > contest is, I (for one) don't think this is a particularly
: : > appropriate place for it.

: : > I mean, c'mon, this is in _theory_ a
: : > forum for exercising our collective knowledge of the C
: : > language. While this contest, as well as the IOCCC do that, they
: : > also provide a wealth of truly bad examples for the beginner.

: : I think the bad examples are good for pointing out mistakes that
: : beginners make.  They are clearly labeled as bad, so I don't see the
: : problem.

: But why don't we do something _productive_?

Well, we'll never all agree on which posts are good and which are bad.

_Personally_, I think the contest posts _are_ productive and on topic;
seeing exaggerated cases of bad code makes it easier to see why some
coding practices are so bad.  It's one thing to say "don't do this"
and another to see a demonstration showing why.

Even if something is funny or silly, it can still be educational.

Lex



Sun, 09 Aug 1998 03:00:00 GMT  
 Evil C Contests

[major snip]

Quote:
>But why don't we do something _productive_?

That's easy.  Don't read Usenet!

Cheers,
Stan.
--



Sun, 09 Aug 1998 03:00:00 GMT  
 Evil C Contests


|>
|>  > But why don't we do something _productive_?
|>
|> Are you suggesting that there is something wrong with recreational
|> programming?

Now _there's_ a subject with bringing up in an interview --
what recreational programming has he/she has done.

I've seen that some CS students gothru the whole school thing
only writing the assigned programs -- then there's the others,
who get the disease and hacak away out of curiosity.

(my first C compiler helped me flunk accounting....)
--

* Mississippi State University Center for Air-Sea Technology
*         To attain knowledge, add something every day.
*         To attain wisdom, remove something every day.    -- Lao-tse



Sun, 09 Aug 1998 03:00:00 GMT  
 Evil C Contests

Quote:


>>: I think the bad examples are good for pointing out mistakes that
>>: beginners make.  They are clearly labeled as bad, so I don't see the
>>: problem.

>>But why don't we do something _productive_?

>Feel free to suggest any contest/event/activity that you
>think would be productive.

  How about a contest to "Spot the Bug/Portibility Problem"?  For example, why
is the following program buggy (and possibly not portable)?

#include <stdio.h>
#include <limits.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>

int main(void)
{
  long counts[CHAR_MAX];
  int  c;
  int  i;

  memset(counts,0,sizeof(counts));
  while((c = getchar()) != EOF)
  {
    counts[c]++;
  }

  for (i = 0 ; i < CHAR_MAX ; i++)
  {
    if (isprint(i))
      printf("%c:",i);
    else
      printf("%d:",i);
    printf("\t50l\n",counts[i]);
  }
  return(EXIT_SUCCESS);

Quote:
}

  Some ground rules for the programs:

                1. ANSI C only.
                2. Must compile cleanly on at least one system.
                3. Must fail completely on at least one system or under
                   certain circumstances that can happen.
                4. The bug/portability problem has to stem from ANSI C.

  And some ground rules for the guesses:

                1. Must tell if the program has a bug, a portability
                   problem, or both.
                2. What steps are needed to fix the problem.

  -spc (Came across this problem once ... )



Mon, 10 Aug 1998 03:00:00 GMT  
 Evil C Contests


Quote:

>  How about a contest to "Spot the Bug/Portibility Problem"?  For example, why
>is the following program buggy (and possibly not portable)?

[snip]

The program has two problems that I see:

1) Portability: if the native char is signed, then the counts
   array (defined with CHAR_MAX) is not large enough to hold
   all the non-EOF return values from getchar.  Fix: replace
   all occurences of CHAR_MAX with UCHAR_MAX.

2) Bug: the format string for the last printf does not contain
   a conversion specification for the count number.  Fix:
   replace the "50l" in the string with "%50ld".

Quote:
>  Some ground rules for the programs:

>            1. ANSI C only.

I find this to be a very artificial constraint; most of the
real code I work with is in some truly {*filter*} bastardized mix
of K&R and ANSI.  If the goal is to help educate the new
coders, then I think we ought to at least acknowledge the
existence of K&R.  I've seen too many newgrads who get
horribly confused when shown a K&R-style function definition.

Quote:
>            2. Must compile cleanly on at least one system.
>            3. Must fail completely on at least one system or under
>               certain circumstances that can happen.

These are reasonable, given suffifiently loose definitions of
"compiles cleanly".  Some compilers (gcc for one) give lots of
warning messages, only some of which are valid, helpful, or
relevant; I don't think these messages should keep a program
from this arena.

Quote:
>            4. The bug/portability problem has to stem from ANSI C.

I'd also support portability problems stemming from the various
standard or semi-standard libraries in common use; one of the
nastier ones I've come across recently was in trying to port a
program which used the return value from sprintf from an ANSI
environment to a BSD environment.  I'm sure similar problems
could arise with other routines from other libraries with
multiple almost-identical interface implementations.

- Alex



Mon, 10 Aug 1998 03:00:00 GMT  
 Evil C Contests

Quote:


>>But why don't we do something _productive_?

>That's easy.  Don't read Usenet!

Counterexamples:  I got my wife and a six-figure contract
job reading Usenet; plus most of my programming cojones
and the knowledge I need to beat the tables in Vegas
(with my shoe, if nothing else).

                                --Blair
                                  "It's not what you have,
                                   it's how you use it."



Mon, 10 Aug 1998 03:00:00 GMT  
 
 [ 21 post ]  Go to page: [1] [2]

 Relevant Pages 

1. 1995 UT IEEE CS National Programming Contest

2. IEEE CS National Programming Contest [Addendum3]

3. 1993 IEEE CS National Programming Contest Notice

4. Description of The 1991 IEEE CS National Programming Contest

5. 1993 IEEE CS National Programming Contest Addendum 2

6. 1993 IEEE CS National Programming Contest [Addendum]

7. Newbie: separate big .cs file into small .cs files

8. C Contest: previous contest winners?

9. repost 1991 C contest rules - contest ends 16-May-91 0:00 UTC

10. Programming Contest: Contest Clarification

11. Decimal is evil

12. This snip is evil - why?

 

 
Powered by phpBB® Forum Software