Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Surge Strip
Nov 2, 2005
Takin' hits
Our intern programmer makes me laugh some days. For example, he future proofed all his code, just in case the definition for a newline ever changes on Windows:

code:
CRLF := #13 + #10;
He codes mostly in Delphi, which has quite a few functions for you to use. I guess he just didn't like the Uppercase function they wrote:

code:
function Upercase(str : string) : string;
   var
   len : integer;
   count : integer;
   newstring : string;
   begin
   len := length(str);
   count := 0;
   while (count < len) do
      begin
      newstring[count] := str[count] - 32;
      count := count + 1;
      end;
   result := newstring;
   end;
So many things wrong. He even got an error that Uppercase was already defined, and so he misspelled it.

Adbot
ADBOT LOVES YOU

Surge Strip
Nov 2, 2005
Takin' hits
Another one I found today. Apparently the programmer did not know that the TListBox in C++ Builder has an ItemIndex property, which, oddly enough, will tell you what item is selected!

code:
for (cnt = 0; cnt < ListBox->Count; cnt++)
   {
   if (ListBox->Selected[cnt])
      {
      /*stuff with cnt*/
      break;
      }
   }
Also, classes that abuse OOP principles. Next to no private members, and worst of all, all the data is in public pointers, that have no documentation.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply