Click here to Skip to main content
15,897,518 members

The Weird and The Wonderful

   

The Weird and The Wonderful forum is a place to post Coding Horrors, Worst Practices, and the occasional flash of brilliance.

We all come across code that simply boggles the mind. Lazy kludges, embarrassing mistakes, horrid workarounds and developers just not quite getting it. And then somedays we come across - or write - the truly sublime.

Post your Best, your worst, and your most interesting. But please - no programming questions . This forum is purely for amusement and discussions on code snippets. All actual programming questions will be removed.

 
GeneralRe: Stupid variable names Pin
fantasy121525-Dec-07 20:08
fantasy121525-Dec-07 20:08 
GeneralRe: Stupid variable names Pin
Robodroid17-Jan-08 9:29
Robodroid17-Jan-08 9:29 
GeneralRe: Stupid variable names Pin
Daniel Ch. Bloch (MCSD, MCAD, MCTS)17-Dec-07 20:34
Daniel Ch. Bloch (MCSD, MCAD, MCTS)17-Dec-07 20:34 
GeneralRe: Stupid variable names Pin
Hufak18-Dec-07 7:31
Hufak18-Dec-07 7:31 
GeneralRe: Stupid variable names Pin
Jamie Nordmeyer26-Dec-07 2:26
Jamie Nordmeyer26-Dec-07 2:26 
GeneralRe: Stupid variable names Pin
Derek Bartram21-Mar-08 12:29
Derek Bartram21-Mar-08 12:29 
GeneralRe: Stupid variable names Pin
Mark C Hagers7-Jan-08 3:12
Mark C Hagers7-Jan-08 3:12 
GeneralHow NOT to reverse a list [modified] Pin
CurtD13-Dec-07 12:38
CurtD13-Dec-07 12:38 
Does anyone see anything stupid in this code? Here's a hint: it isn't the most efficient logic I've seen.

void CrapClass::reverse_points()
{
   CPoint *pt, *npt;
   CList <CPoint *, CPoint *> list;
   POSITION next, prev;

   // copy the list
   next = m_point_list.GetHeadPosition();
   while (next != NULL)
   {
      pt = m_point_list.GetNext(next);
      npt = new CPoint(*pt);
      list.AddTail(npt);
   }

   // delete the old list
   delete_points();


   // create the new list in reverse order
   prev = list.GetTailPosition();
   while (prev != NULL)
   {
      pt = list.GetPrev(prev);
      npt = new CPoint(*pt);
      m_point_list.AddTail(npt);
   }

   // delete the points from the temp list
   while (!list.IsEmpty())
      delete list.RemoveHead();
}

modified on Thursday, December 13, 2007 6:52:30 PM

GeneralRe: How NOT to reverse a list Pin
Pete O'Hanlon13-Dec-07 22:49
mvePete O'Hanlon13-Dec-07 22:49 
GeneralRe: How NOT to reverse a list Pin
CurtD14-Dec-07 9:09
CurtD14-Dec-07 9:09 
GeneralRe: How NOT to reverse a list Pin
Pete O'Hanlon14-Dec-07 9:44
mvePete O'Hanlon14-Dec-07 9:44 
GeneralRe: How NOT to reverse a list [modified] Pin
Haroon Sarwar14-Dec-07 2:36
Haroon Sarwar14-Dec-07 2:36 
GeneralRe: How NOT to reverse a list Pin
CurtD14-Dec-07 9:08
CurtD14-Dec-07 9:08 
GeneralWondering Pin
Fatbuddha 112-Dec-07 0:38
Fatbuddha 112-Dec-07 0:38 
GeneralRe: Wondering Pin
Jason Lepack (LeppyR64)12-Dec-07 1:34
Jason Lepack (LeppyR64)12-Dec-07 1:34 
GeneralRe: Wondering Pin
m@u12-Dec-07 2:19
m@u12-Dec-07 2:19 
GeneralRe: Wondering Pin
Fatbuddha 112-Dec-07 21:24
Fatbuddha 112-Dec-07 21:24 
GeneralRe: Wondering Pin
Luc Pattyn13-Dec-07 1:38
sitebuilderLuc Pattyn13-Dec-07 1:38 
GeneralRe: Wondering Pin
darkelv13-Dec-07 21:24
darkelv13-Dec-07 21:24 
GeneralRe: Wondering Pin
Pete O'Hanlon13-Dec-07 22:53
mvePete O'Hanlon13-Dec-07 22:53 
GeneralWhat happens when a Java coder decides to explain a Red Black Tree in C#? Pin
leppie11-Dec-07 7:39
leppie11-Dec-07 7:39 
GeneralRe: What happens when a Java coder decides to explain a Red Black Tree in C#? Pin
Pete O'Hanlon11-Dec-07 10:30
mvePete O'Hanlon11-Dec-07 10:30 
GeneralRe: What happens when a Java coder decides to explain a Red Black Tree in C#? Pin
Rizwan Yasin11-Dec-07 19:04
Rizwan Yasin11-Dec-07 19:04 
GeneralRe: What happens when a Java coder decides to explain a Red Black Tree in C#? Pin
leppie11-Dec-07 19:22
leppie11-Dec-07 19:22 
GeneralRe: What happens when a Java coder decides to explain a Red Black Tree in C#? Pin
Mike Dimmick14-Dec-07 13:38
Mike Dimmick14-Dec-07 13:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.