1. Ruby / Говнокод #14245

    −87

    1. 1
    2. 2
    # ugh
    task = task.task.task

    http://programmingisterrible.com/post/50285403468/a-lifetime-of-terrible-code

    someone, 18 Декабря 2013

    Комментарии (77)
  2. C# / Говнокод #14244

    +138

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    Control authorizationPanel= iddbd
          .Controls.Cast<Control>().Where(x => x.Name == "panelMaxim").FirstOrDefault()
          .Controls.Cast<Control>().Where(x => x.Name == "panelInternetB").FirstOrDefault()
          .Controls.Cast<Control>().Where(x => x.Name == "panelPassiveIB").FirstOrDefault()
          .Controls.Cast<Control>().Where(x => x.Name == "panelPhone").FirstOrDefault();

    не, ну а как его еще достать? У нас это квест такой на работе - "Найди контрол" называется

    taburetka, 18 Декабря 2013

    Комментарии (17)
  3. Java / Говнокод #14243

    +129

    1. 1
    com.sun.java.swing.plaf.nimbus.InternalFrameInternalFrameTitlePaneInternalFrameTitlePaneMaximizeButtonWindowNotFocusedState

    Класс из состава JDK 6.

    someone, 18 Декабря 2013

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

    +156

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    /* @component Phoca Component
     * @copyright Copyright (C) Jan Pavelka www.phoca.cz
    */
    	protected function getLabel() {
    		echo '<div class="clearfix"></div>';
    		return parent::getLabel();
    		echo '<div class="clearfix"></div>';
    	}

    Это диагноз...

    virtual_cia, 18 Декабря 2013

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

    +128

    1. 1
    2. 2
    3. 3
    4. 4
    http://rghost.ru/51035531
    Новый бот для минусования (запускать на виртуалке)
    
    Описание такое, чтобы отпугнуть хомячье.

    Новый бот для минусования.

    Stertor, 17 Декабря 2013

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

    +119

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    Well, there were other factors in play there. htmlspecialchars was a
    very early function. Back when PHP had less than 100 functions and the
    function hashing mechanism was strlen(). In order to get a nice hash
    distribution of function names across the various function name lengths
    names were picked specifically to make them fit into a specific length
    bucket. This was circa late 1994 when PHP was a tool just for my own
    personal use and I wasn't too worried about not being able to remember
    the few function names.
    
    -Rasmus

    http://news.php.net/php.internals/70691

    someone, 17 Декабря 2013

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

    +166

    1. 1
    if (substr(json_encode($row['list']), 0, 1) == '[') {

    Такой вот аналог is_array()

    Lowezar, 17 Декабря 2013

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

    −163

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    CREATE TABLE [dbo].[PPLS2BILLS_SRCO_MESAGE] (
    	[DOCUMENT] [char] (8) COLLATE Ukrainian_CI_AI_KS_WS NULL ,
    	[Nom_Document] [int] NULL ,
    	[Kol_Reis_In_Docum] [int] NULL ,
    	[Cancel_Kol_Reis_Doc] [int] NULL ,
    	[Greate_Date_Docum] [datetime] NULL ,
    	[Flag_Out_EC] [bit] NULL 
    ) ON [PRIMARY]

    именуй, не именуй ...

    bahamot, 17 Декабря 2013

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

    +149

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    if ($result->fetch()) {
        return $result->get('num_flags');
    }
    else {
        return 666;
    }

    Верующий программист :)

    xakip, 17 Декабря 2013

    Комментарии (110)
  10. Си / Говнокод #14236

    +141

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    if (connfailed) {
    			KSOCKET_CALLBACK(so, disconnected, error);
    		} else {
    			KSOCKET_CALLBACK(so, connectfailed, error);
    		}

    https://github.com/joyent/illumos-joyent/blob/master/usr/src/uts/common/fs/sockfs/socknotify.c

    myaut, 17 Декабря 2013

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