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

    В номинации:
    За время:
  2. Java / Говнокод #7515

    +78

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    9. 9
    public class Settings {
    
    	public static String CURRENCY = "руб.";
    	
    	public static void setCurrency(String currency) {
    		CURRENCY = currency != null ? currency : "руб.";
    	}
    	
    }

    Мой проект. Можно ли считать это ГК?

    tir, 11 Августа 2011

    Комментарии (243)
  3. C++ / Говнокод #27932

    +2

    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
    struct S { struct Inner { }; };
    template<int N> struct X;
    auto refl = ˆS;
    auto tmpl = ˆX;
    void f() {
    typename [:refl:] * x; // OK: declares x to be a pointer-to-S
    [:refl:] * x; // error: attempt to multiply int by x
    [:refl:]::Inner i; // OK: splice as part of a nested-name-specifier
    typename [:refl:]{}; // OK: default-constructs an S temporary
    using T = [:refl:]; // OK: operand must be a type
    struct C : [:refl:] {}; // OK: base classes are types
    template [:tmpl:]<0>; // OK: names the specialization
    [:tmpl:] < 0 > x; // error: attempt to compare X with 0
    }

    и да, это приняли.
    https://lists.isocpp.org/sg7/2021/04/0226.php
    http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2320r0.pdf

    digitalEugene, 07 Января 2022

    Комментарии (242)
  4. Куча / Говнокод #25444

    0

    1. 1
    https://medium.com/@evnowandforever/f-you-i-quit-hiring-is-broken-bb8f3a48d324

    tl;tr:

    Чувак говорит что его заебали интервьюеры которые просят на доске перевернуть бинарное дерево.
    Он считает что надо давать практические задачи, пускай даже и на дом. Если для решения практической задачи ему понадобится перевернуть бинарное дерево -- он почитает статью и напишет алгоритм.

    А интервьюеры сначала хотят дерево, а потом ноют.

    HEymHblu_nemyx, 11 Марта 2019

    Комментарии (242)
  5. Куча / Говнокод #29285

    0

    1. 1
    IT Оффтоп #240

    #210: https://govnokod.ru/29079 https://govnokod.xyz/_29079
    #211: https://govnokod.ru/29092 https://govnokod.xyz/_29092
    #212: https://govnokod.ru/29093 https://govnokod.xyz/_29093
    #213: https://govnokod.ru/29104 https://govnokod.xyz/_29104
    #214: https://govnokod.ru/29114 https://govnokod.xyz/_29114
    #215: https://govnokod.ru/29125 https://govnokod.xyz/_29125
    #216: https://govnokod.ru/29132 https://govnokod.xyz/_29132
    #217: https://govnokod.ru/29147 https://govnokod.xyz/_29147
    #218: https://govnokod.ru/29156 https://govnokod.xyz/_29156
    #219: https://govnokod.ru/29166 https://govnokod.xyz/_29166
    #220: https://govnokod.ru/29181 https://govnokod.xyz/_29181
    #221: https://govnokod.ru/29185 https://govnokod.xyz/_29185
    #222: https://govnokod.ru/29190 https://govnokod.xyz/_29190
    #223: https://govnokod.ru/29203 https://govnokod.xyz/_29203
    #224: https://govnokod.ru/29211 https://govnokod.xyz/_29211
    #225: https://govnokod.ru/29212 https://govnokod.xyz/_29212
    #226: https://govnokod.ru/29218 https://govnokod.xyz/_29218
    #227: https://govnokod.ru/29220 https://govnokod.xyz/_29220
    #228: https://govnokod.ru/29230 https://govnokod.xyz/_29230
    #229: https://govnokod.ru/29235 https://govnokod.xyz/_29235
    #230: https://govnokod.ru/29241 https://govnokod.xyz/_29241
    #231: https://govnokod.ru/29246 https://govnokod.xyz/_29246
    #232: https://govnokod.ru/29249 https://govnokod.xyz/_29249
    #233: https://govnokod.ru/29253 https://govnokod.xyz/_29253
    #234: https://govnokod.ru/29259 https://govnokod.xyz/_29259
    #235: https://govnokod.ru/29262 https://govnokod.xyz/_29262
    #236: https://govnokod.ru/29267 https://govnokod.xyz/_29267
    #237: https://govnokod.ru/29271 https://govnokod.xyz/_29271
    #238: https://govnokod.ru/29274 https://govnokod.xyz/_29274
    #239: https://govnokod.ru/29281 https://govnokod.xyz/_29281

    nepeKamHblu_nemyx, 29 Сентября 2026

    Комментарии (240)
  6. Python / Говнокод #18382

    −125

    1. 1
    print "value: %s" % str(e)

    А вдруг tuple?

    3_14dar, 23 Июня 2015

    Комментарии (238)
  7. C++ / Говнокод #7867

    +171

    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
    char *f(char *s1, ...)
    { char **cp = &s1;            //--адрес первого указателя
       int len = 0;        
       // цикл для определения общей длины сцепляемых строк
       while (*cp) { len += strlen(*cp); cp++; }                          
      char *s = new char[len+1];       //--память для строки
      s[0]=0;                       //-- "очищаем" строку
    // цикл для сцепления строк
      cp=&s1;                       //-- опять установка на 1-й параметр
      while (*cp) 
      {  strcat(s, *cp);             //-- прицепляем первую (и следующие)
         cp++;                       //-- перемещаемся на следующую
      }         
      return s;
    }

    Сцепление строк (ноль в конце)
    http://www.rsdn.ru/forum/cpp/418970.1.aspx

    rat4, 14 Сентября 2011

    Комментарии (238)
  8. PHP / Говнокод #5213

    +160

    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
    66. 66
    67. 67
    68. 68
    69. 69
    <?php
     include '/system/config_bd.php'; // соединение с базой
     
    class pagination_start {
    public $page;
    public $CountListPage=10; 
    public $sql="SELECT * FROM `news`";
    public $start;
    public $limit;
    public $ires;
     
    public function page_settings() {
    $this->page_get();
    $this->start=($this->page-1)*$this->CountListPage; 
    $this->limit=" LIMIT $this->start,$this->CountListPage";
    $this->ires=mysql_query($this->sql.$this->limit);
    }
     
    public function page_get() {
    if(empty($_GET['page'])){$this->page=1;} 
    else {$this->page=$_GET['page'];} 
    }
    }
     
    class pagination_end extends pagination_start{
    public $link_interval;
    public $i;
    public $sp;
     
    public function pagination($class_all,$class_once) {
     $link_page = '';
     $this->page_get();
     $count=mysql_num_rows(mysql_query($this->sql)); 
     if($count>$this->CountListPage){ 
    $CountList=ceil($count/$this->CountListPage); 
     if($this->page > 3 && $CountList > 5){echo '<span class="'.$class_all.'"><a href="?page=1'.$this->link_interval.'">1</a></span><span class="'.$class_all.'">...</span>';} 
    if($this->page > 3 && $CountList > 5){$this->sp=$this->page-2;}else{$this->sp=1;} 
    if($this->page > $CountList-3 && $CountList > 5){$this->sp=$CountList-4; } 
    if($CountList>5)$cpc=5;else $cpc=$CountList; 
    for($this->i=$this->sp;$this->i<$this->sp+$cpc;$this->i++){ 
     
    if($this->i == $this->page){  printf ('<span class="'.$class_once.'">%s</span>',$this->i); }
    else{ $suit=$this->link_interval.$this->i; 
    $links_cent = '<span class="'.$class_all.'"><a href="?page='.$suit.'">'.$this->i.'</a></span>';
     echo $links_cent;  } } 
    $suit=$this->link_interval."?page=".$CountList.""; 
    if($this->page<=$CountList-3 and $CountList>5){echo '<span class="'.$class_all.'">...</span>  <span class="'.$class_all.'"><a href="'.$suit.'">'.$CountList.'</a></span> ';} }
    }
    }
    
    $CountListPage = 5;   // Сколько объектов отображать на странице # по умолчанию 10
    $sql="SELECT * FROM `news` ";  // SQL запрос # по умолчанию "SELECT * FROM `news`"
    $class_all='page_all'; // Css класс всех страниц кроме текущей
    $class_once='class_once'; // Css класс всех страниц кроме текущей
    
    /* Формирование страниц и sql запрос */
    $pagination = new pagination_start();
    $pagination->CountListPage = $CountListPage;
    $pagination->sql = $sql;
    $pagination->page_settings();
    while($ires_result=mysql_fetch_array($pagination->ires))
    {
    echo $ires_result['id']."<br/>";
    } 
    /* Пагенирование */
    $pagination_end = new pagination_end();
    $pagination_end->CountListPage = $CountListPage;
    $pagination_end->sql = $sql;
    $pagination_end->pagination($class_all,$class_once); // От css клас от 2 страници до предпоследней

    qbasic, 11 Января 2011

    Комментарии (238)
  9. PHP / Говнокод #2

    +77.5

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    <?php
      phpinfo();
      if (file_exist('../../../../etc/passwd'))
      {
        include('../../../../etc/passwd');
      }

    guest, 23 Ноября 2008

    Комментарии (238)
  10. Куча / Говнокод #26821

    0

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    > Improved People Nearby
    Profile videos make meeting new people a dozen times more interesting, and we've beefed up the People Nearby section for the occasion.
    
    When people contact you via the People Nearby section, you will see how far away they are. And when you start a chat with someone nearby, 
    Telegram will suggest a greeting sticker to break the ice. Luckily, all our stickers are extroverts.

    самый секьюрный мессенджер теперь палит еще и локацию юзеров
    теперь это у нас тиндер такой

    https://telegram.org/blog/profile-videos-people-nearby-and-more
    https://telegram.org/blog/new-profiles-people-nearby

    Fike, 28 Июля 2020

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

    0

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    https://habr.com/ru/post/454354/
    
    > я на данный момент только выпустился из 11-го 
    > На мой взгляд у меня имеется неплохое резюме с кучей ачивок и хороший скилл,
       который я день за днем совершенствую последние 8-9 лет.

    Какой скилл )))
    Помню свой 11 класс, где я понятия не имел что такое погромирование.

    AHCKuJlbHblu_nemyx, 01 Июня 2019

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