1. Лучший говнокод

    В номинации:
    За время:
  2. Куча / Говнокод #8000

    +90

    1. 1
    http://rghost.ru/23248281

    3.14159265, 27 Сентября 2011

    Комментарии (59)
  3. Pascal / Говнокод #7817

    +90

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    36. 36
    37. 37
    38. 38
    39. 39
    40. 40
    41. 41
    42. 42
    43. 43
    44. 44
    45. 45
    46. 46
    47. 47
    48. 48
    49. 49
    50. 50
    51. 51
    52. 52
    Procedure TfMain.CheckButtonsStatus;
    begin
      // Если есть кто-то в персональной очереди, то возобновить активна
      if (dMain.PersonalQueueQuery.RecordCount > 0) then
        TImageButton(mButtons[6]).mlabel.Enabled := true
      else
        TImageButton(mButtons[6]).mlabel.Enabled := False;
    
      // 'приглашен', 3, 'оповещен', 4, 'оповещен', 5, 'прием начат')
      if (dMain.StateQuery.FieldValues['state'] = 'свободно') then
      begin
        TImageButton(mButtons[0]).mlabel.Enabled := False;
        TImageButton(mButtons[1]).mlabel.Enabled := False;
        if dMain.CommonQueueQuery.RecordCount > 0 then
          TImageButton(mButtons[2]).mlabel.Enabled := true
        else
          TImageButton(mButtons[2]).mlabel.Enabled := False;
    
        TImageButton(mButtons[3]).mlabel.Enabled := False;
        TImageButton(mButtons[4]).mlabel.Enabled := False;
        TImageButton(mButtons[5]).mlabel.Enabled := False;
        OperPopupMenu.Items[0].Enabled := False;
      end;
    
      if (dMain.StateQuery.FieldValues['state'] = 'приглашен') or
        (dMain.StateQuery.FieldValues['state'] = 'оповещен') then
      begin
        TImageButton(mButtons[0]).mlabel.Enabled := true;
        TImageButton(mButtons[1]).mlabel.Enabled := False;
        TImageButton(mButtons[2]).mlabel.Enabled := False;
        TImageButton(mButtons[3]).mlabel.Enabled := true;
        TImageButton(mButtons[4]).mlabel.Enabled := False;
        TImageButton(mButtons[5]).mlabel.Enabled := False;
        TImageButton(mButtons[6]).mlabel.Enabled := False;
        if (dMain.StateQuery.FieldValues['state'] = 'приглашен') then
          OperPopupMenu.Items[0].Enabled := False
        else
          OperPopupMenu.Items[0].Enabled := true;
      end;
    
      if (dMain.StateQuery.FieldValues['state'] = 'прием начат') then
      begin
        TImageButton(mButtons[0]).mlabel.Enabled := False;
        TImageButton(mButtons[1]).mlabel.Enabled := true;
        TImageButton(mButtons[2]).mlabel.Enabled := False;
        TImageButton(mButtons[3]).mlabel.Enabled := False;
        TImageButton(mButtons[4]).mlabel.Enabled := true;
        TImageButton(mButtons[5]).mlabel.Enabled := true;
        TImageButton(mButtons[6]).mlabel.Enabled := False;
        OperPopupMenu.Items[0].Enabled := False;
      end;
    end;

    На работе достался проект, состоящий чуть менее чем полностью из подобных высеров.

    chaoswithin, 09 Сентября 2011

    Комментарии (37)
  4. Java / Говнокод #7303

    +90

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    @Override
    public Object clone() {
              try {
                            return super.clone();
    	        } catch (Exception e) {
    			return this;
    		}
    }

    "Клонирование"

    auf1r2, 21 Июля 2011

    Комментарии (66)
  5. Pascal / Говнокод #6149

    +90

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    Uses CRT;
    const
         a=10;
         b=21;
         c=30;
    Var
       max: integer;
    Begin
         if (a>b) then
                  if (a>c) then
                     begin
                       max:=a;
                     end
                  else max:=c;
         if (b>a)then
                 if (b>c)then
                          max:=b
                 else
                   max:=c;
    Writeln(max);
    if (max mod 5 = 0 ) then
       writeln ('Кратное')
    else writeln('некратное');
       
    End.

    Juris_Kabanis, 30 Марта 2011

    Комментарии (13)
  6. Java / Говнокод #5340

    +90

    1. 1
    2. 2
    if (name != null ? !name.equals(module.name) : module.name != null) return false;
    return true;

    Jk, 20 Января 2011

    Комментарии (36)
  7. Pascal / Говнокод #4321

    +90

    1. 1
    2. 2
    if DirectoryExists(ExtractFilePath(Application.ExeName)+'Folder')=false then
    CreateDir(ExtractFilePath(Application.ExeName)+'Folder');

    Мартин, 09 Октября 2010

    Комментарии (13)
  8. Pascal / Говнокод #3448

    +90

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    36. 36
    37. 37
    38. 38
    39. 39
    40. 40
    41. 41
    42. 42
    43. 43
    44. 44
    45. 45
    46. 46
    47. 47
    48. 48
    49. 49
    50. 50
    51. 51
    52. 52
    53. 53
    54. 54
    55. 55
    56. 56
    57. 57
    58. 58
    59. 59
    60. 60
    61. 61
    62. 62
    63. 63
    64. 64
    65. 65
    procedure TForm1.registration;
    var
    reg:TRegistry;
    i,lbc:integer;
    aentsys,alawarkey:boolean;
    const
    dw:DWORD =1800000;
    begin
      reg:=TRegistry.Create;
      reg.RootKey:=HKEY_CURRENT_USER;
      aentsys:= reg.KeyExists('software\Aent Sys');
    
      alawarkey:=reg.KeyExists('software\Alawar');
      //aentsys
         if aentsys = true  then
       begin
      reg.OpenKey('software\Aent Sys\pr',true);
      reg.GetKeyNames(ListBox1.Items);
      reg.CloseKey;
      lbc:=listbox1.Items.Count;
      sProgressBar1.Max:=lbc*10;
      i:=0;
      while not (i=lbc) do
      begin
       reg.RootKey:=HKEY_CURRENT_USER;
      reg.OpenKey('software\Aent Sys\pr',true);
      reg.OpenKey(ListBox1.Items.Strings[i],true);
      reg.GetKeyNames(ListBox2.Items);
      reg.OpenKey(ListBox2.Items.Strings[0],true);
      reg.WriteInteger('Program',dw);
      sProgressBar1.Position:= sProgressBar1.Position+10;
      i:=i+1;
      listbox2.Clear;
      reg.CloseKey;
      end;
      end;
      i:=0;
      listbox2.Clear;
      listbox1.clear;
      lbc:=0;
      //alawar key
       if alawarkey = true  then
       begin
      reg.OpenKey('software\Alawar\play',true);
      reg.GetKeyNames(ListBox1.Items);
      reg.CloseKey;
      lbc:=listbox1.Items.Count;
      sProgressBar1.Max:=lbc*10;
      i:=0;
      while not (i=lbc) do
      begin
       reg.RootKey:=HKEY_CURRENT_USER;
      reg.OpenKey('software\Alawar\play',true);
      reg.OpenKey(ListBox1.Items.Strings[i]+'\trial',true);
      reg.GetKeyNames(ListBox2.Items);
      reg.OpenKey(ListBox2.Items.Strings[0],true);
      reg.WriteInteger('Program',dw);
      sProgressBar1.Position:= sProgressBar1.Position+10;
      i:=i+1;
      listbox2.Clear;
      reg.CloseKey;
      end;
      end;
    
    end;

    Заново даёт триццать минут для игры от компании Alawar))) аццкое гавно

    mistmax, 10 Июня 2010

    Комментарии (4)
  9. Java / Говнокод #458

    +89.9

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    static char DigitToChar(
        int _Digit
      )
    {
      switch (_Digit)
      {
        case 0: return '0';
        case 1: return '1';
        case 2: return '2';
        case 3: return '3';
        case 4: return '4';
        case 5: return '5';
        case 6: return '6';
        case 7: return '7';
        case 8: return '8';
        case 9: return '9';
        default: return ':';
      }
    }

    в результате долгих размышлений всетаки заменили на return '0' + _Digit;

    guest, 26 Января 2009

    Комментарии (4)
  10. C# / Говнокод #2213

    +89.5

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    private void ProcessActionsLookup(object sender)
            {
                LookUpEdit lookUpEdit = sender as LookUpEdit;
                if (lookUpEdit != null)
                {
                    if (lookUpEdit.EditValue != null)
                    {
                        if (lookUpEdit.EditValue.Equals(currentActionLookupValue))
                        {
                            if (actionsGridControlBindingSource.Current != null &&
                                !_presenter.ActionHasProperParameters(actionsGridView.FocusedRowHandle))
                            {
                                SetDataSourceForInnerGrid(sender);
                            }
                        }
                        else
                        {
                            SetDataSourceForInnerGrid(sender);
                        }
                    }
                    else
                    {
                        SetDataSourceForInnerGrid(sender);
                    }
                }
            }

    Мы пойдем другим путем.
    Некоторые скажут что в представленном контексте абсолютно нормальный код, я все же не соглашусь

    codeposter, 03 Декабря 2009

    Комментарии (9)
  11. Куча / Говнокод #1920

    +89.4

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    <option name="d">
          <select value="collection">Коллекции</select>
          <select value="cash">В наличии</select>
          <select value="documents">Выставки</select>
          <select value="bio">Биография</select>
          <select value="int">Интерьер</select>
      </option>

    HTML без комментариев) Я валялся от смеха, когда увидел :D

    greevex, 30 Сентября 2009

    Комментарии (9)