Democratic Underground Latest Greatest Lobby Journals Search Options Help Login
Google

I'm going to give a presentation about coding practices tomorrow.

Printer-friendly format Printer-friendly format
Printer-friendly format Email this thread to a friend
Printer-friendly format Bookmark this thread
This topic is archived.
Home » Discuss » The DU Lounge Donate to DU
 
Commie Pinko Dirtbag Donating Member (1000+ posts) Send PM | Profile | Ignore Wed Sep-15-04 05:28 PM
Original message
I'm going to give a presentation about coding practices tomorrow.
In one part there's a "what's wrong with this C code" exercise for the audience. In the following slide, one of the listed answers is:
gets() was written by Beelzebub himself.

Yep, that's what I wrote there. Am I weird or what? :crazy:
Printer Friendly | Permalink |  | Top
kixot Donating Member (1000+ posts) Send PM | Profile | Ignore Wed Sep-15-04 06:04 PM
Response to Original message
1. So, uh, what are some of the questions?
Just curious.
Printer Friendly | Permalink |  | Top
 
Commie Pinko Dirtbag Donating Member (1000+ posts) Send PM | Profile | Ignore Wed Sep-15-04 06:12 PM
Response to Reply #1
2. A two-line snipped of code from a fictitious library
It outputs a message with fprintf() and asks for a string with gets(). The audience has to figure out what good practices were violated by that.

There are other, less obvious exercises.
Printer Friendly | Permalink |  | Top
 
aePrime Donating Member (676 posts) Send PM | Profile | Ignore Wed Sep-15-04 07:38 PM
Response to Reply #2
4. Did you also do this?
char myString[] = "Hello, World!";

printf(myString);


// Security hole! And yet, common pratice.
Printer Friendly | Permalink |  | Top
 
Skittles Donating Member (1000+ posts) Send PM | Profile | Ignore Wed Sep-15-04 07:21 PM
Response to Original message
3. are you giving it to Americans?
:(
Printer Friendly | Permalink |  | Top
 
DU AdBot (1000+ posts) Click to send private message to this author Click to view 
this author's profile Click to add 
this author to your buddy list Click to add 
this author to your Ignore list Fri Apr 26th 2024, 06:16 PM
Response to Original message
Advertisements [?]
 Top

Home » Discuss » The DU Lounge Donate to DU

Powered by DCForum+ Version 1.1 Copyright 1997-2002 DCScripts.com
Software has been extensively modified by the DU administrators


Important Notices: By participating on this discussion board, visitors agree to abide by the rules outlined on our Rules page. Messages posted on the Democratic Underground Discussion Forums are the opinions of the individuals who post them, and do not necessarily represent the opinions of Democratic Underground, LLC.

Home  |  Discussion Forums  |  Journals |  Store  |  Donate

About DU  |  Contact Us  |  Privacy Policy

Got a message for Democratic Underground? Click here to send us a message.

© 2001 - 2011 Democratic Underground, LLC