1. C# / Говнокод #11815

    +136

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    // http://msdn.microsoft.com/en-us/library/dya2szfk%28v=VS.71%29.aspx
    
    If x = True Then   ' Compares x to the Boolean value True.
       ' Insert code to execute if x = True.
    Else
       ' Insert code to execute if x = False.
    End If

    http://msdn.microsoft.com/en-us/library/dya2szfk%28v=VS.71%29.aspx
    Учебник по языку, да

    Demetr, 21 Сентября 2012

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

    +20

    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
    class CRenderWindow
    {
    public:
    	/***/
    	bool IsWindow(); 
    	/***/
    };
    
    
    class CWindow : public CRenderWindow
    {
    	/***/
    };

    Код для работы с окнами. Лишнее я убрал (весь код занимает больше 500 строк).
    О чем думал человек, который это проектировал? О_о

    Artur, 21 Сентября 2012

    Комментарии (8)
  3. Куча / Говнокод #11813

    +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
    /**
       * Determines equality based upon the contents of this Box instead of the box itself.
       * As a result, it is not symmetric. Which means that for
       *
       * <pre name="code" class="scala">
       *     val foo = "foo"
       *     val boxedFoo = Full(foo)
       *     foo == boxedFoo //is false
       *     boxedFoo == foo //is true
       * </pre>
       *
       * For Full and Empty, this has the expected behavior. Equality in terms of Failure
       * checks for equivalence of failure causes.
       */
      override def equals(other: Any): Boolean = (this, other) match {
        case (Full(x), Full(y)) => x == y
        case (Full(x), y) => x == y
        case (x, y: AnyRef) => x eq y
        case _ => false
      }

    https://github.com/lift/framework/blob/master/core/common/src/main/scala/net/liftweb/common/Box.scala

    rat4, 20 Сентября 2012

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

    +131

    1. 1
    o?o.f():{};

    Мне было стыдно постить это в С++.

    http://www.gamedev.ru/flame/forum/?id=167142&page=2#m25

    LispGovno, 20 Сентября 2012

    Комментарии (28)
  5. PHP / Говнокод #11810

    +62

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    <?php
    session_start();
    
    //Сообщение ЛОХУ
    
    $strpath="admin/conf/stop_mes.txt";
    $size=filesize($strpath);
    if($size):
     $f=fopen($strpath,'r');
     @$stop_mes=fread($f, filesize($strpath));
    fclose($f);
    endif;

    Зашел на сайт, а он закрыт? Ебать ты лох.

    TBoolean, 20 Сентября 2012

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

    +35

    1. 1
    2. 2
    assert( -(PHP_INT_MAX + 1)  ===  -PHP_INT_MAX - 1 );
    assert( -(PHP_INT_MAX + 2)  ===  -PHP_INT_MAX - 2 );

    __proto__, 20 Сентября 2012

    Комментарии (2)
  7. Куча / Говнокод #11808

    +130

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    <div id="busyList" class="busyList">
        <div id="busyList" class="busyList">...</div>
        <div id="busyList" class="busyList">...</div>
        <div id="busyList" class="busyList">...</div>
        <div id="busyList" class="busyList">...</div>
        <div id="busyList" class="busyList">...</div>
        <div id="busyList" class="busyList">...</div>
    </div>

    Как-то даже грустно становится...

    somnambulism, 20 Сентября 2012

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

    +53

    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
    function valid_date($date='0000-00-00 00:00:00') {
    		
            if(strtotime($date)) {
            
        		$d = substr($date,8,2);
        		$m = substr($date,5,2);
        		$y = substr($date,0,4);
        					
        		     if($m == '01') {$m = 'января';}
        		else if($m == '02') {$m = 'февраля';}
        		else if($m == '03') {$m = 'марта';}
        		else if($m == '04') {$m = 'апреля';}
        		else if($m == '05') {$m = 'мая';}
        		else if($m == '06') {$m = 'июня';}
        		else if($m == '07') {$m = 'июля';}
        		else if($m == '08') {$m = 'августа';}
        		else if($m == '09') {$m = 'сентября';}
        		else if($m == '10') {$m = 'октября';}
        		else if($m == '11') {$m = 'ноября';}
        		else if($m == '12') {$m = 'декабря';}
        						
        		if($d[0] == 0) {$d = substr($d,1,2);}
        						
        		return $d." ".$m." ".$y;
                
            } else {
                return false;
            }
    }

    И что думаете ?

    nepster, 20 Сентября 2012

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

    +63

    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
    function projects_action($action)
    {
    	switch ($action) {
    		 case '1': return 'Создал проект'; break;
    		 case '2': return 'Изменил название'; break;
    		 case '3': return 'Изменил бюджет'; break;
    		 case '4': return 'Изменил дату добавления'; break;
    		 case '5': return 'Изменил дату окончания'; break;
    		 case '6': return 'Изменил приоритет'; break;
    		 case '7': return 'Изменил язык'; break;
    		 case '8': return 'Сменил клиента'; break
    
                     # …
    
    		 case '32': return 'Изменил схему'; break;
    		 default: return;
    	}
    }

    smileart, 20 Сентября 2012

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

    +27

    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
    String MyClass::ConvertToString(int i)
    {
    	switch(i)
    	{
    	case 71:
    		return String::Format("%s", "ab703d2");
    	case 72:
    		return String::Format("%s", "ab70382");
    	case 73:
    		return String::Format("%s", "ab7038c");
    	case 74:
    		return String::Format("%s", "ab70396");
    	case 79:
    		return String::Format("%s", "ab703be");
    	case 80:
    		return String::Format("%s", "ab703c8");
    	case 82:
    		return String::Format("%s", "ab703dc");
    	case 86:
    		return String::Format("%s", "ab703fa");
    	case 75:
    		return String::Format("%s", "ab703a0");
    	case 77:
    		return String::Format("%s", "ab703aa");
    	case 83:
    		return String::Format("%s", "ab703e6");
    	case 84:
    		return String::Format("%s", "ab703f0");
    	case 78:
    		return String::Format("%s", "ab703b4");
    	case 87:
    		return String::Format("%s", "ab70404");
    	case 90:
    		return String::Format("%s", "fe8c33d");
    	case 93:
    		return String::Format("%s", "fe8c35b");
    	case 91:
    		return String::Format("%s", "fe8c347");
    	case 92:
    		return String::Format("%s", "fe8c351");
    	case 81:
    		return String::Format("%s", "fe8c329");
    	case 85:
    		return String::Format("%s", "fe8c333");
    	default:
    		return String::Format("%s", "1a177fd");
    	}
    }

    Фиг с ними, с массивами. Но Format() то зачем???

    bazhenovc, 20 Сентября 2012

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