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

    В номинации:
    За время:
  2. 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)
  3. Куча / Говнокод #7736

    +144

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    Говнокод за последние 2 года превратился в унылое говно и с этим ничего не поделаешь.
    Постится одна хуйня, толпа бешеных долбоёбов минусует всё подряд, половина из выложенного - откровенный троллинг.
    Все поливают друг друга говном и меряются письками как в детском саду.
    Это что по-вашему govnocomment.ru?
    Сосните хуйцов, уроды.

    Fai, 02 Сентября 2011

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

    +167

    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
    $select = $db->select()
    ->from('advertisement AS a', $columns)
    ->joinLeft('resid_apt_secondary AS ras', 'ras.resid_apartment_residental_advertisement_id=a.id', array())
    ->joinLeft('resid_apt_newly_unready AS ranu', 'ranu.resid_apartment_residental_advertisement_id=a.id', array())
    ->joinLeft('resid_apt_newly_ready AS ranr', 'ranr.resid_apartment_residental_advertisement_id=a.id', array())
    ->joinLeft('resid_house_house AS rh', 'rh.resid_house_residental_advertisement_id=a.id', array())
    ->joinLeft('resid_house_cottage AS rc', 'rc.resid_house_residental_advertisement_id=a.id', array())
    ->joinLeft('resid_house_dacha AS rd', 'rd.resid_house_residental_advertisement_id=a.id', array())
    ->joinLeft('resid_garage AS rg', 'rg.residental_advertisement_id=a.id', array())
    ->joinLeft('sec_residental AS sr', 'sr.section_advertisement_id=a.id', array())
    ->joinLeft('bld_prod_common AS bpc', 'bpc.bld_production_commercial_advertisement_id=a.id', array())
    ->joinLeft('bld_prod_food AS bpf', 'bpf.bld_production_commercial_advertisement_id=a.id', array())
    ->joinLeft('bld_prod_restaurant AS bpr', 'bpr.bld_production_commercial_advertisement_id=a.id', array())
    ->joinLeft('bld_prod_warehouse AS bpw', 'bpw.bld_production_commercial_advertisement_id=a.id', array())
    ->joinLeft('bld_prod_garage AS bpg', 'bpg.bld_production_commercial_advertisement_id=a.id', array())
    ->joinLeft('bld_prod_service_station AS bpss', 'bpss.bld_production_commercial_advertisement_id=a.id', array())
    ->joinLeft('bld_prod_other AS bpo', 'bpo.bld_production_commercial_advertisement_id=a.id', array())
    ->joinLeft('bld_office_any AS boa', 'boa.bld_office_commercial_advertisement_id=a.id', array())
    ->joinLeft('bld_office_admin AS boad', 'boad.bld_office_commercial_advertisement_id=a.id', array())
    ->joinLeft('bld_office_sales AS bos', 'bos.bld_office_commercial_advertisement_id=a.id', array())
    ->joinLeft('bld_office_kiosk AS bok', 'bok.bld_office_commercial_advertisement_id=a.id', array())
    ->joinLeft('bld_farm_cowshed AS bfc', 'bfc.bld_farm_commercial_advertisement_id=a.id', array())
    ->joinLeft('bld_farm_workshop AS bfw', 'bfw.bld_farm_commercial_advertisement_id=a.id', array())
    ->joinLeft('bld_farm_chicken_house AS bfch', 'bfch.bld_farm_commercial_advertisement_id=a.id', array())
    ->joinLeft('bld_farm_other AS bfo', 'bfo.bld_farm_commercial_advertisement_id=a.id', array())
    ->joinLeft('gas_station AS gs', 'gs.commercial_advertisement_id=a.id', array())
    ->joinLeft('rm_prod_common AS rpc', 'rpc.room_production_commercial_advertisement_id=a.id', array())
    ->joinLeft('rm_prod_food AS rpf', 'rpf.room_production_commercial_advertisement_id=a.id', array())
    ->joinLeft('rm_prod_restaurant AS rpr', 'rpr.room_production_commercial_advertisement_id=a.id', array())
    ->joinLeft('rm_prod_warehouse AS rpw', 'rpw.room_production_commercial_advertisement_id=a.id', array())
    ->joinLeft('rm_prod_garage AS rpg', 'rpg.room_production_commercial_advertisement_id=a.id', array())
    ->joinLeft('rm_prod_service_station AS rpss', 'rpss.room_production_commercial_advertisement_id=a.id', array())
    ->joinLeft('rm_prod_other AS rpo', 'rpo.room_production_commercial_advertisement_id=a.id', array())
    ->joinLeft('rm_office_any AS roa', 'roa.rm_office_commercial_advertisement_id=a.id', array())
    ->joinLeft('rm_office_sales AS ros', 'ros.rm_office_commercial_advertisement_id=a.id', array())
    ->joinLeft('rm_office_off AS roo', 'roo.rm_office_commercial_advertisement_id=a.id', array())
    ->joinLeft('rm_office_admin AS road', 'road.rm_office_commercial_advertisement_id=a.id', array())
    ->joinLeft('rm_office_hall_rental AS roh', 'roh.rm_office_commercial_advertisement_id=a.id', array())
    ->where('is_recycled = ?', 'no')
    ->where('is_published = ?', 'yes')
    ->group(array('a.type', 'a.in_archive'));

    Переделываем проект. В старой версии нашел следующие строчки.

    nkarakin, 25 Июля 2011

    Комментарии (37)
  5. C++ / Говнокод #7059

    +179

    1. 1
    2. 2
    public:
      void* getThis(void){return this;};;;;

    Говногость, 26 Июня 2011

    Комментарии (37)
  6. PHP / Говнокод #6649

    +159

    1. 1
    2. 2
    3. 3
    while ($row = @mysql_fetch_array($this->_sqlResult, $result_type)):
    	$return[] = $row;
    endwhile;

    1_and_0, 13 Мая 2011

    Комментарии (37)
  7. PHP / Говнокод #6626

    +165

    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
    $date = $_POST['date2'];
    if($_POST['1']!="") $r1=mysql_query ("INSERT INTO `bazaname`.`dz` (`id` ,`value` ,`id_subject` ,`id_class` ,`date`) VALUES (NULL , '$_POST[1]', '$lesson1', '$classID', '$date')");
    if($_POST['2']!="") $r2=mysql_query ("INSERT INTO `bazaname`.`dz` (`id` ,`value` ,`id_subject` ,`id_class` ,`date`) VALUES (NULL , '$_POST[2]', '$lesson2', '$classID', '$date')");
    if($_POST['3']!="") $r3=mysql_query ("INSERT INTO `bazaname`.`dz` (`id` ,`value` ,`id_subject` ,`id_class` ,`date`) VALUES (NULL , '$_POST[3]', '$lesson3', '$classID', '$date')");
    if($_POST['4']!="") $r4=mysql_query ("INSERT INTO `bazaname`.`dz` (`id` ,`value` ,`id_subject` ,`id_class` ,`date`) VALUES (NULL , '$_POST[4]', '$lesson4', '$classID', '$date')");
    if($_POST['5']!="") $r5=mysql_query ("INSERT INTO `bazaname`.`dz` (`id` ,`value` ,`id_subject` ,`id_class` ,`date`) VALUES (NULL , '$_POST[5]', '$lesson5', '$classID', '$date')");
    if($_POST['6']!="") $r6=mysql_query ("INSERT INTO `bazaname`.`dz` (`id` ,`value` ,`id_subject` ,`id_class` ,`date`) VALUES (NULL , '$_POST[6]', '$lesson6', '$classID', '$date')");
    if($_POST['7']!="") $r7=mysql_query ("INSERT INTO `bazaname`.`dz` (`id` ,`value` ,`id_subject` ,`id_class` ,`date`) VALUES (NULL , '$_POST[7]', '$lesson7', '$classID', '$date')");
    if($_POST['8']!="") $r8=mysql_query ("INSERT INTO `bazaname`.`dz` (`id` ,`value` ,`id_subject` ,`id_class` ,`date`) VALUES (NULL , '$_POST[8]', '$lesson8', '$classID', '$date')");
    }
    
    
    
    
    $Sunday = date("Y-m-d", mktime (0,0,0,date("m") ,date("d")+0-$todayis,$year));
    $Monday = date("Y-m-d", mktime (0,0,0,date("m") ,date("d")+1-$todayis,$year));
    $Tuesday = date("Y-m-d", mktime (0,0,0,date("m") ,date("d")+2-$todayis,$year));
    $Wednesday = date("Y-m-d", mktime (0,0,0,date("m") ,date("d")+3-$todayis,$year));
    $Thursday = date("Y-m-d", mktime (0,0,0,date("m") ,date("d")+4-$todayis,$year));
    $Friday = date("Y-m-d", mktime (0,0,0,date("m") ,date("d")+5-$todayis,$year));
    $Saturday = date("Y-m-d", mktime (0,0,0,date("m") ,date("d")+6-$todayis,$year));

    С песочницы хабра
    http://habrahabr.ru/sandbox/28776/

    rO_ot, 11 Мая 2011

    Комментарии (37)
  8. C# / Говнокод #6575

    +127

    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
    private void bbbut_Click(object sender, EventArgs e)
            {
                if (this.plugDescr.SelectedText.Length > 0)
                {
                    ToolStripButton button = (ToolStripButton) sender;
                    if (button.Name == "bbB")
                    {
                        this.plugDescr.SelectedText = BB_HTMLwork.WriteBBToString(this.plugDescr.SelectedText, "", "b");
                    }
                    if (button.Name == "bbI")
                    {
                        this.plugDescr.SelectedText = BB_HTMLwork.WriteBBToString(this.plugDescr.SelectedText, "", "i");
                    }
                    if (button.Name == "bbU")
                    {
                        this.plugDescr.SelectedText = BB_HTMLwork.WriteBBToString(this.plugDescr.SelectedText, "", "u");
                    }
                    if (button.Name == "bbS")
                    {
                        this.plugDescr.SelectedText = BB_HTMLwork.WriteBBToString(this.plugDescr.SelectedText, "", "s");
                    }
                    if (button.Name == "bbURL")
                    {
                        this.plugDescr.SelectedText = BB_HTMLwork.WriteBBToString(this.plugDescr.SelectedText, this.bbAddInfoContent.Text, "url");
                    }
                }
            }

    Обработчик кнопок ббкода в утилите для генерации ридми. Весь ее код выполнем в таком духе.
    Утилита: http://fullrest.ru/forum/topic/34114-generator-readme/
    Сорцы: http://depositfiles.com/files/kvi4gsajy

    Говногость, 06 Мая 2011

    Комментарии (37)
  9. JavaScript / Говнокод #6466

    +156

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    function check() {
    
    if (document.login.user.value == "user" &&
    document.login.password.value == "correct_password")
        window.location.href = 'http://this.site/login.html';
    else
        window.location.href = 'http://this.site/loginfehler.html';
    
    return false;
    }

    Функция входа, хуле

    jQuery, 24 Апреля 2011

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

    +177

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    if(x*x > = 0)
    {
    // какие-то действия
    }
    else
    {
    // какие-то действия
    }

    Код встретил у знакомой студентки :3 Не, ну а в вдруг?

    minuzZ, 05 Апреля 2011

    Комментарии (37)
  11. C++ / Говнокод #6049

    +159

    1. 1
    2. 2
    3. 3
    4. 4
    bool DoYouWannaRealyDoThisFunctionYesNo(T*(f)(T...), bool answer)
    {
    	return answer;
    }

    Microsoft style

    semens, 21 Марта 2011

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