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

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

    +164

    1. 1
    i = j ? k : l = m;

    опять же с форума wasm.ru... пол дня объяснял почему с++ компилятор трактует это выражение как i = j ? k : (l = m), а никак по-другому... не пишите такую чушь никогда)

    ReL, 07 Февраля 2011

    Комментарии (26)
  3. Си / Говнокод #5456

    +137

    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
    if (c>=0xC0)
                    {c=LCD_Chars[c-0xC0];}
            else
            {
                    if (c==0xA8)
                            {c=0xA2;}
                    else
                            if (c==0xB8)
                                    {c=0xB5;}
                            else
                                    if (c==0xB0)
                                            {c=0xDF;}
            }

    qbasic, 31 Января 2011

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

    +160

    1. 1
    2. 2
    3. 3
    if ( isset($this->q_param["submit_form_one"]) && is_numeric($this->q_param["submit_form_one"]) && $this->q_param["submit_form_one"] == 1 ){
    //тут разный код
    }

    ппц

    ilyamx, 28 Января 2011

    Комментарии (26)
  5. ActionScript / Говнокод #5296

    −152

    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
    /**
    		 * Returns UserData object of the user with specific clientId from the friend list.
    		 * If there is no such clientId, throws an error.
    		 * @return <B>com.gixoo.videoRound.data.users.UserData</B>
    		 */
    		public function getUserDataByClientID(clientId : String) : UserData 
    		{
    			var result : UserData;
    			for (var i:uint; i < _people.length; i++) 
    			{
    				if (_people[i].userServerData.clientId == clientId) 
    				{
    					result = _people[i];
    					break;
    				}
    			}
    			if ( !result )
    			{
    				result = _people[i];	
    			}
    			return result;
    		}

    Тестирование показало, что ошибку эту никто не ловит... но зачем так сложно ее выбрасывать...

    wvxvw, 16 Января 2011

    Комментарии (26)
  6. SQL / Говнокод #5278

    −860

    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
    SELECT
        node.nid AS nid,
        location.latitude AS location_latitude,
        location.longitude AS location_longitude,
        node.title AS node_title,
        node.language AS node_language,
        location.lid AS location_lid,
        (IFNULL(ACOS(0.501284223863*COS(RADIANS(location.latitude))*(0.863228195442*COS(RADIANS(location.longitude)) + 0.504813908876*SIN(RADIANS(location.longitude))) + 0.865282686124*SIN(RADIANS(location.latitude))), 0.00000)*6362105.74365) AS location_distance,
        node_data_field_rate_prior.field_rate_prior_amount AS node_data_field_rate_prior_field_rate_prior_amount,
        node_data_field_rate_prior.field_rate_prior_currency AS node_data_field_rate_prior_field_rate_prior_currency,
        node.type AS node_type, node.vid AS node_vid,
        node_data_field_rate_prior.field_rate_reg_amount AS node_data_field_rate_prior_field_rate_reg_amount,
        node_data_field_rate_prior.field_rate_reg_currency AS node_data_field_rate_prior_field_rate_reg_currency,
        node_data_field_rate_prior.field_rate_vip_amount AS node_data_field_rate_prior_field_rate_vip_amount,
        node_data_field_rate_prior.field_rate_vip_currency AS node_data_field_rate_prior_field_rate_vip_currency
      FROM node node
      LEFT JOIN location_instance location_instance ON node.vid = location_instance.vid
      LEFT JOIN location location ON location_instance.lid = location.lid
      LEFT JOIN content_type_dta_kiosk node_data_field_rate_prior ON node.vid = node_data_field_rate_prior.vid
      WHERE node.type in ('dta_kiosk')
        AND (location.latitude > 40.9991009563 
          AND location.latitude < 59.0008990437 
          AND location.longitude > 5.91311892539 
          AND location.longitude < 34.0868810746
        )
      ORDER BY location_distance ASC

    vectoroc, 14 Января 2011

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

    +181

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    /**
          * Quits the script.
          *
          * @return Page
          */
         protected function quit()
         {
              exit;
              return $this;
         }

    Bydlo, 03 Января 2011

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

    +158

    1. 1
    2. 2
    3. 3
    $where = "(`user_id` = ".$id." and `user_fr` = ".$user->Get('u_id').") or (`user_id` = ".$user->Get('u_id')." and `user_fr` = ".$id.")";
        
    $inc = array_merge($db->Select('friends', $where), $db->Select('friends_incoming', $where));

    Проверка на существования дружбы или предложений дружбы между двумя пользователями (каунтом $inc).

    Мартин, 15 Декабря 2010

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

    +155

    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
    <?php
    if ( !defined("MAGIC_WORD") ) die( "Доступ к данной странице запрещен!" );
    /**
     * ==============================
     * Page Load
     * ============================== 
     */
    $file = phpInjection(sqlInjection(@$_GET['f']));
    switch ($file)
    {
        case "news":
            $module = "news.php";
            break;
        case "lk":
            $module = "profile.php";
            break;
        case "register":
            $module = "register.php";
            break;
        case "stat":
            $module = "stat.php";
            break;
        case "forget":
            $module = "forget.php";
            break;
        case "vote":
            $module = "vote.php";
            break;
        case "webmoney":
            $module = "webmoney.php";
            break;
        default:
            $module = "main.php";
    }
    if (file_exists(ROOT_DIR . "/engine/" . $module))
    {
        include ROOT_DIR . '/engine/' . $module;
    }
    else
    {
        $tpl->result["content"] = "<div class='error'>Ошибка 404. Страница не найдена</div>";
    }
    ?>

    rat4, 17 Ноября 2010

    Комментарии (26)
  10. PHP / Говнокод #4642

    +145

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    <map name="Map">
    	<area shape="rect" coords="0,1,25,14" href="/rada/control/uk/index">
    	<area shape="rect" coords="40,1,64,14" href="/rada/control/ru/index">
    	<area shape="rect" coords="79,1,104,14" href="/rada/control/en/index">
    </map>

    http://portal.rada.gov.ua/
    Это они так ссылки на переключение языков сделали <_<
    Просто пиздец.

    p.s. категории "html" нет, поэтому запостил в РНР.

    olegsuv, 15 Ноября 2010

    Комментарии (26)
  11. Assembler / Говнокод #4571

    +223

    1. 1
    2. 2
    3. 3
    mov ax, 4C00h
    mov dx, offset msg
    int 21h

    После этих строк пошёл спать.

    Mencey, 09 Ноября 2010

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