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

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

    +171

    1. 1
    2. 2
    3. 3
    4. 4
    <?php
    class Modules_Admin_Parser_Driver_SiteCom implements Modules_Admin_Parser_Interface {
    }
    ?>

    Старый добрый неймспейс

    Zho, 17 Апреля 2012

    Комментарии (65)
  3. Haskell / Говнокод #9598

    −92

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    -- | The unit datatype @()@ has one non-undefined member, the nullary
    -- constructor @()@.
    data () = () deriving Generic
    
    data (,) a b = (,) a b
    . . .
    data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__
     = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__
        -- deriving Generic
    {- Manuel says: Including one more declaration gives a segmentation fault.
    . . .

    *тяжелый вздох*

    http://www.haskell.org/ghc/docs/latest/html/libraries/ghc-prim-0.2.0.0/src/GHC-Tuple.html#%28%29

    wvxvw, 03 Марта 2012

    Комментарии (65)
  4. ActionScript / Говнокод #8714

    −111

    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
    70. 70
    71. 71
    72. 72
    73. 73
    74. 74
    75. 75
    76. 76
    77. 77
    78. 78
    79. 79
    80. 80
    81. 81
    82. 82
    public class MonstrGrafic extends ModulINT {
    		var data:XML;
    		var colors:Array = new Array(
    			'0x008080',
    			'0x800080',
    			'0xccffcc',
    			'0x00ffff',
    			'0x800000',
    			'0x0000ff',
    			'0x00ccff',
    			'0xccffff',
    			'0xffff00',
    			'0xffff99',
    			'0x000080',
    			'0xff00ff'
    		);
    		var ListTime:Array = new Array(
    			"08:00:00 - 08:15:00",
    			"08:15:00 - 08:30:00",
    			"08:30:00 - 08:45:00",
    			"08:45:00 - 09:00:00",
    			"09:00:00 - 09:15:00",
    			"09:15:00 - 09:30:00",
    			"09:30:00 - 09:45:00",
    			"09:45:00 - 10:00:00",
    			"10:00:00 - 10:15:00",
    			"10:15:00 - 10:30:00",
    			"10:30:00 - 10:45:00",
    			"10:45:00 - 11:00:00",
    			"11:00:00 - 11:15:00",
    			"11:15:00 - 11:30:00",
    			"11:30:00 - 11:45:00",
    			"11:45:00 - 12:00:00",
    			"12:00:00 - 12:15:00",
    			"12:15:00 - 12:30:00",
    			"12:30:00 - 12:45:00",
    			"12:45:00 - 13:00:00",
    			"13:00:00 - 13:15:00",
    			"13:15:00 - 13:30:00",
    			"13:30:00 - 13:45:00",
    			"13:45:00 - 14:00:00",
    			"14:00:00 - 14:15:00",
    			"14:15:00 - 14:30:00",
    			"14:30:00 - 14:45:00",
    			"14:45:00 - 15:00:00",
    			"15:00:00 - 15:15:00",
    			"15:15:00 - 15:30:00",
    			"15:30:00 - 15:45:00",
    			"15:45:00 - 16:00:00",
    			"16:00:00 - 16:15:00",
    			"16:15:00 - 16:30:00",
    			"16:30:00 - 16:45:00",
    			"16:45:00 - 17:00:00",
    			"17:00:00 - 17:15:00",
    			"17:15:00 - 17:30:00",
    			"17:30:00 - 17:45:00",
    			"17:45:00 - 18:00:00",
    			"18:00:00 - 18:15:00",
    			"18:15:00 - 18:30:00",
    			"18:30:00 - 18:45:00",
    			"18:45:00 - 19:00:00",
    			"19:00:00 - 19:15:00",
    			"19:15:00 - 19:30:00",
    			"19:30:00 - 19:45:00",
    			"19:45:00 - 20:00:00",
    			"20:00:00 - 20:15:00",
    			"20:15:00 - 20:30:00",
    			"20:30:00 - 20:45:00",
    			"20:45:00 - 21:00:00",
    			"21:00:00 - 21:15:00",
    			"21:15:00 - 21:30:00",
    			"21:30:00 - 21:45:00",
    			"21:45:00 - 22:00:00",
    			"22:00:00 - 22:15:00",
    			"22:15:00 - 22:30:00",
    			"22:30:00 - 22:45:00",
    			"22:45:00 - 23:00:00",
    			"23:00:00 - 23:15:00",
    			"23:15:00 - 23:30:00",
    			"23:30:00 - 23:45:00",
    			"23:45:00 - 24:00:00"
    		);

    kyzi007, 03 Декабря 2011

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

    +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
    class array
    {
        int data[256];
        int p;
    
    public:
        array ():
            p (0)
        {}
    
        array & operator , (int a)
        {
            data[p++] = a;
            return *this;
        }
    
        array & operator = (const array & arr)
        {
            p = 0;
            memcpy (data, arr.data, sizeof (data));
            return *this;
        }
    
        int & operator [] (size_t i)
        {
            return data[i];
        }
    };
    
    #define _I array(),
    #define I_
    #define o_O ,
    
    int _tmain(int argc, _TCHAR* argv[])
    {
        array arr;
        arr = _I 1,2,3,4,5,6 I_;    // init
        arr o_O 7,8,9,10;           // append new
        arr o_O 11 o_O 12;          // append new
    }

    http://www.gamedev.ru/flame/forum/?id=153265#m4

    RS-232, 09 Октября 2011

    Комментарии (65)
  6. Java / Говнокод #7788

    +78

    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
    /**
    	* @param loginName
    	* @return
    	* This method is create a LoginName as Input data
    	*/
    public String getLoginName(String loginName)
    {
    	String userQuery="select u.LoginName from User u";
    	Recordset rs_user=null;
    	rs_user = CustomExternalServiceImplUtil.getInstance().executeQuery(userQuery);
    	List<String> userList = new ArrayList<String>();
    	while(rs_user.moveNext()){ 
    		userList.add(rs_user.valueFromIndex(0).toString());
    	}
    	int i=1;
    	String result = loginName;
    	for(int j=0; j < userList.size(); j++){
    		if(userList.get(j).equals(result))
    		{
    			result = loginName+i++;
    			j=0;
    		}
    	}
    	return result;
    }

    Рефаткоринг чужого кода. Минут пять втуплял, что же тут вообще делается. Еще столько же придумывал, как же это привести в божеский вид с сохранением прежней функциональности.

    askell, 06 Сентября 2011

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

    +174

    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
    if(isset($_GET['aspx'])) include("parthers/aspx.php");  
    elseif(isset($_GET['b7186'])) include("parthers/b7186.php");  
    elseif(isset($_GET['dip'])) include("parthers/dip.php");  
    elseif(isset($_GET['Maslyakov'])) include("parthers/Maslyakov.php");  
    elseif(isset($_GET['Zhannetka'])) include("parthers/Zhannetka.php");  
    elseif(isset($_GET['b7186rft'])) include("parthers/b7186rft.php");  
    elseif(isset($_GET['mistral09'])) include("parthers/mistral09.php");  
    elseif(isset($_GET['Simmka'])) include("parthers/Simmka.php");  
    elseif(isset($_GET['polevnik'])) include("parthers/polevnik.php");  
    elseif(isset($_GET['dmitriev83'])) include("parthers/dmitriev83.php");  
    elseif(isset($_GET['orion'])) include("parthers/orion.php");  
    elseif(isset($_GET['Krick'])) include("parthers/Krick.php");  
    elseif(isset($_GET['ae63237'])) include("parthers/ae63237.php");  
    elseif(isset($_GET['zen'])) include("parthers/zen.php");  
    elseif(isset($_GET['antkuz'])) include("parthers/antkuz.php"); 
    elseif(isset($_GET['psd'])) include("parthers/psd.php"); 
    elseif(isset($_GET['122745105643'])) include("parthers/122745105643.php"); 
    elseif(isset($_GET['amadey'])) include("parthers/amadey.php"); 
    elseif(isset($_GET['prosto'])) include("parthers/prosto.php"); 
    elseif(isset($_GET['Oushin'])) include("parthers/Oushin.php"); 
    elseif(isset($_GET['alkir'])) include("parthers/alkir.php"); 
    elseif(isset($_GET['werty2011'])) include("parthers/werty2011.php"); 
    elseif(isset($_GET['valjek'])) include("parthers/valjek.php"); 
    elseif(isset($_GET['32167911'])) include("parthers/32167911.php"); 
    elseif(isset($_GET['biz'])) include("parthers/biz.php"); 
    elseif(isset($_GET['hranitely'])) include("parthers/hranitely.php"); 
    elseif(isset($_GET['stalker147'])) include("parthers/stalker147.php"); 
    elseif(isset($_GET['boef8'])) include("parthers/boef8.php"); 
    elseif(isset($_GET['Mastak'])) include("parthers/Mastak.php"); 
    elseif(isset($_GET['kna888'])) include("parthers/kna888.php"); 
    elseif(isset($_GET['index'])) include("parthers/index.php"); 
    elseif(isset($_GET['abc'])) include("parthers/abc.php"); 
    elseif(isset($_GET['ollgga69'])) include("parthers/ollgga69.php"); 
    elseif(isset($_GET['Stalker007'])) include("parthers/Stalker007.php"); 
    elseif(isset($_GET['maluw'])) include("parthers/maluw.php"); 
    elseif(isset($_GET['diana2113327'])) include("parthers/diana2113327.php"); 
    elseif(isset($_GET['staschel'])) include("parthers/staschel.php"); 
    else include("parthers/file.php");

    Набрёл в проектах на фри-ланс.ру. Описание проекта: "Есть вот такой код, нужно придумать как его оптимизировать"

    wxx, 31 Мая 2011

    Комментарии (65)
  8. Си / Говнокод #6754

    +147

    1. 1
    memcpy((void*)m_sendBuffer,(void*)jsonString,strlen(jsonString));

    3 ошибки в одной строчке))

    r00t31337, 25 Мая 2011

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

    +170

    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
    //ці граблі краще не чіпати, а то все завалиться) тут якось магічно визначається попередній крок)
    if (($step_id - 1) == 4) {
        $prstep_id = 3;
    } elseif (($step_id - 1) == 6) {
        $prstep_id = 5;
    
    } elseif (($step_id - 1) == 9) {
        $prstep_id = 8;
    } elseif (($step_id - 1) == 3) {
        $prstep_id = 4;
    } elseif (in_array($step_id, array(6, 9, 14))) { //кроки на яких рахуються закритим проектом
        $prstep_id = $step_id;
    } else {
        $prstep_id = ($step_id - 1);
    }

    hudson, 23 Мая 2011

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

    +123

    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
    <html>
            <head>
            <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
                    <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.0/jquery-ui.min.js"></script>
                    <link rel="stylesheet" href="/ww.admin/theme/admin.css" type="text/css" />
                    <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.0/themes/south-street/jquery-ui.css" type="text/css" />
            </head>
                <body>
                    <div id="header"> 
                            <div id="menu-top">
                                    <ul>
                                            <li><a href="/ww.admin/pages.php">Pages</a></li>
                                            <li><a href="/ww.admin/users.php">Users</a></li>
                                            <li><a href="/ww.incs/logout.php?redirect=/ww.admin/">Log Out</a></li>
                                    </ul>
                            </div>
                    </div>
                    <div id="wrapper">
    <h1>Pages</h1><div class="left-menu"><script src="/j/jstree/jquery.jstree.js"></script>
    <script src="/ww.admin/pages/menu.js"></script>
    <div id="pages-wrapper"><ul><li id="page_1"><a href="pages.php?id=1"><ins>&nbsp;</ins>Home</a><ul><li id="page_2">
    <a href="pages.php?id=2"><ins>&nbsp;</ins>Second Page</a></li></ul></li></ul></div></div>
    <div class="has-left-menu"><h2>FORM GOES HERE</h2></div>
    <style type="text/css"> @import "pages/css.css";</style></div>
    	</body>
    </html>

    aslikeyou, 20 Апреля 2011

    Комментарии (65)
  11. PHP / Говнокод #5291

    +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
    class country extends baza
    {
    ......
    function show_description($country=NULL)
    {
        if ($this instanceof country)
            $quest="SELECT description FROM countries WHERE name=\"$this->name"";
        if ($this instanceof city) // йобаный стыд!!! 0_0
            $quest="SELECT description FROM cities WHERE name\"$this->name\" AND country=\"$country\" ";
    ......
    }
    
    class city extends country
    .....

    предок "country" знает о потомке "city"

    Говнокод из говнокнижки Елены Бенкен "PHP, MySQL, XML Программирование для интернета" БХВ-Петербург,ISBN 5-9775-0039-4 страница 209

    StriderMan, 16 Января 2011

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