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

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

    +5

    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
    if($row198['verein_id']==$row511['verein_1'])
    {
    				$row198['neu_tore']=$row198['last_tore']+$row511['tore_1'];
    				$row198['neu_gegentore']=$row198['last_gegentore']+$row511['tore_2'];
    				$row198['neu_tordiff']=$row198['neu_tore']-$row198['neu_gegentore'];
    				$row198['neu_siege']=$row198['last_siege']+($row511['tore_1']>$row511['tore_2']);
    				$row198['neu_niederlagen']=$row198['last_niederlagen']+($row511['tore_1']<$row511['tore_2']);
    				$row198['neu_unentschieden']=$row198['last_unentschieden']+($row511['tore_1']==$row511['tore_2']);
    				$row198['neu_spiele']=$row198['last_spiele']+1;
    				$row198['last_punkte']=$row198['last_siege']*3+$row198['last_unentschieden']*1;
    				$row198['neu_punkte']=$row198['neu_siege']*3+$row198['neu_unentschieden']*1;
    }
    else if($row198['verein_id']==$row511['verein_2'])
    {
    				$row198['neu_tore']=$row198['last_tore']+$row511['tore_2'];
    				$row198['neu_gegentore']=$row198['last_gegentore']+$row511['tore_1'];
    				$row198['neu_tordiff']=$row198['neu_tore']-$row198['neu_gegentore'];
    				$row198['neu_siege']=$row198['last_siege']+($row511['tore_1']<$row511['tore_2']);
    				$row198['neu_niederlagen']=$row198['last_niederlagen']+($row511['tore_1']>$row511['tore_2']);
    				$row198['neu_unentschieden']=$row198['last_unentschieden']+($row511['tore_1']==$row511['tore_2']);
    				$row198['neu_spiele']=$row198['last_spiele']+1;
    				$row198['last_punkte']=$row198['last_siege']*3+$row198['last_unentschieden']*1;
    				$row198['neu_punkte']=$row198['neu_siege']*3+$row198['neu_unentschieden']*1;
    }

    через 5 минут заметил разницу.

    kropotor, 31 Июля 2015

    Комментарии (16)
  3. Python / Говнокод #18244

    −120

    1. 1
    sqlalchemy.orm.relationship(argument, secondary=None, primaryjoin=None, secondaryjoin=None, foreign_keys=None, uselist=None, order_by=False, backref=None, back_populates=None, post_update=False, cascade=False, extension=None, viewonly=False, lazy=True, collection_class=None, passive_deletes=False, passive_updates=True, remote_side=None, enable_typechecks=True, join_depth=None, comparator_factory=None, single_parent=False, innerjoin=False, distinct_target_key=None, doc=None, active_history=False, cascade_backrefs=True, load_on_pending=False, strategy_class=None, _local_remote_pairs=None, query_class=None, info=None)

    Охуенный АПИ: прочитал и сразу запомнил.

    wvxvw, 27 Мая 2015

    Комментарии (16)
  4. Java / Говнокод #17877

    +77

    1. 1
    2. 2
    3. 3
    if (measurer instanceof IsGroundedMeasurer) {
        measurer = (IsGroundedMeasurer) measurer;
    }

    nikit13, 27 Марта 2015

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

    +127

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    // А
    if (x) {
        ...
        doStuff (x);
        ...
    
    // Б
    if (x) {
        ...
        doStuff (true);
        ...

    что меньшее говно? А или Б?

    в случае А приходится напрягать мысль на строчке doStuff(x) чему же там равно х. но при этом эту строчку можно безболезненно вынести за if(x), если понадобится.

    makc3d, 27 Марта 2015

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

    −118

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    def updateLicenseApps( self ):
    	self.block()
    	self.statusbarSetLicenseName();
    	self.applicationGrid.ClearGrid()
    
    	if type( self.licenseEditor ) != type( None ):
    		licparams = self.licenseEditor.licenseApps
    		....
    	for x in xrange( len( licparams ) ):
    		self.applicationGrid.AppendRows( 1, True )
    		self.applicationGrid.SetCellValue( x, 0, licparams[x]["name"] )
    		self.applicationGrid.SetCellValue( x, 1, licparams[x]["startdate"] )

    MMAXIMUM PYTHON

    Anus, 20 Марта 2015

    Комментарии (16)
  7. JavaScript / Говнокод #17721

    +168

    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
    83. 83
    84. 84
    85. 85
    86. 86
    87. 87
    88. 88
    89. 89
    90. 90
    91. 91
    92. 92
    93. 93
    94. 94
    95. 95
    96. 96
    97. 97
    98. 98
    generator=function(a,q){m=Math;no='';nb=' ';
    rnd=function(r,w){return((m.round(((+new Date)*m.random())%r)||0)+(w||0));};
    ff=function(ff){ma=function(ma1,ma2){return(m.max(ma1,ma2));};return(ma(ma(rnd(rnd(ff)),rnd(rnd(ff))),ma(rnd(rnd(ff)),rnd(rnd(ff)))));};
    sumb=function(x,y){return(String.fromCharCode(rnd(m.abs((y||1)-1),m.abs(x||32))));};
    sor=function(o){return(o.sort(function(){return(0.5-m.random())}));};
    a=Number(a||0);
    q=q||[];
    
    
    
    
    
    
    
    
    
    
    q=function(z){r=0;for(j=0;j<z.length;j++){r+=z[j]};return(r);}(q)?q:(Array(4+4+4+4+4+4+4+4
    
    		+4+4+4		+4+4+4
    
    +1).join('1').split(no));sx=function(p,u){g=q.length;return(Number(q[p>g?g:p])?u:no);};len=Array();for(r=0;r<rnd(a,a*5);r++){e=[
    
    
    
    
    	sumb(958)
    
    	,sumb(97,26)
    	,sumb(945,25)
    
    
    
    	,sumb(97,26)
    	,sumb(97,26)
    	,sumb(97,26)
    	,sumb(97,26)
    
    
    			,sumb(97,26)
    			,sumb(97,26)
    			,sumb(97,26)
    			,sumb(97,26)
    
    
    
    
    
    
    			,sumb(97,26)
    			,sumb(97,26)
    			,sumb(97,26)
    			,sumb(97,26)
    
    
    
    	,sumb(97,26)
    	,sumb(945,25)
    	,sumb(97,26)
    	,sumb(945,25)
    	,sumb(97,26)
    	,sumb(945,25)
    	,sumb(97,26)
    	,sumb(945,25)
    
    
    
    			,sumb(97,26)
    			,sumb(97,26)
    			,sumb(97,26)
    			,sumb(97,26)
    
    
    
    
    	,sumb(223)
    	,sumb(228)
    	,sumb(230)
    	,sumb(231)
    
    
    
    
    
    	,sumb(239)
    	,sumb(240)
    	,sumb(241)
    	,sumb(235)
    
    
    
    
    
    
    
    
    
    	,sumb(246)

    И это было написано ручками, не использовался никакой uglify
    И этот проект мне достался в наследство на новой работе.
    КМП.

    JSMastaRolu, 03 Марта 2015

    Комментарии (16)
  8. Java / Говнокод #17664

    +85

    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
    int[] pirates = {
                    R.drawable.final_0001, R.drawable.final_0002, R.drawable.final_0003, R.drawable.final_0004,
                    R.drawable.final_0005, R.drawable.final_0006, R.drawable.final_0007, R.drawable.final_0008,
                    R.drawable.final_0009, R.drawable.final_0010, R.drawable.final_0011, R.drawable.final_0012,
                    R.drawable.final_0013, R.drawable.final_0014, R.drawable.final_0015, R.drawable.final_0016,
                    R.drawable.final_0017, R.drawable.final_0018, R.drawable.final_0019, R.drawable.final_0020,
                    R.drawable.final_0021, R.drawable.final_0022, R.drawable.final_0023, R.drawable.final_0024,
                    R.drawable.final_0025, R.drawable.final_0026, R.drawable.final_0027, R.drawable.final_0028,
                    R.drawable.final_0029, R.drawable.final_0030, R.drawable.final_0031, R.drawable.final_0032,
                    R.drawable.final_0033, R.drawable.final_0034, R.drawable.final_0035, R.drawable.final_0036,
                    R.drawable.final_0037, R.drawable.final_0038, R.drawable.final_0039, R.drawable.final_0040,
                    R.drawable.final_0041, R.drawable.final_0042, R.drawable.final_0043, R.drawable.final_0044,
                    R.drawable.final_0045, R.drawable.final_0046, R.drawable.final_0047, R.drawable.final_0048,
                    R.drawable.final_0049, R.drawable.final_0050, R.drawable.final_0051, R.drawable.final_0052,
                    R.drawable.final_0053, R.drawable.final_0054, R.drawable.final_0065, R.drawable.final_0056,
                    R.drawable.final_0057, R.drawable.final_0058, R.drawable.final_0059, R.drawable.final_0060,
                    R.drawable.final_0061, R.drawable.final_0062, R.drawable.final_0063, R.drawable.final_0064,
                    R.drawable.final_0065, R.drawable.final_0066, R.drawable.final_0067, R.drawable.final_0068,
                    R.drawable.final_0069, R.drawable.final_0070, R.drawable.final_0071, R.drawable.final_0072,
                    R.drawable.final_0073, R.drawable.final_0074, R.drawable.final_0075, R.drawable.final_0076,
                    R.drawable.final_0077, R.drawable.final_0078, R.drawable.final_0079, R.drawable.final_0080,
                    R.drawable.final_0081, R.drawable.final_0082, R.drawable.final_0083, R.drawable.final_0084,
                    R.drawable.final_0085, R.drawable.final_0086, R.drawable.final_0087, R.drawable.final_0088,
                    R.drawable.final_0089, R.drawable.final_0090, R.drawable.final_0091, R.drawable.final_0092,
                    R.drawable.final_0093, R.drawable.final_0094, R.drawable.final_0095, R.drawable.final_0096,
                    R.drawable.final_0097, R.drawable.final_0098, R.drawable.final_0099, R.drawable.final_0100,
                    R.drawable.final_0101, R.drawable.final_0102, R.drawable.final_0103, R.drawable.final_0104,
                    R.drawable.final_0105, R.drawable.final_0106, R.drawable.final_0107, R.drawable.final_0108,
                    R.drawable.final_0109, R.drawable.final_0110, R.drawable.final_0111, R.drawable.final_0112,
                    R.drawable.final_0113, R.drawable.final_0114, R.drawable.final_0115, R.drawable.final_0116,
                    R.drawable.final_0117, R.drawable.final_0118, R.drawable.final_0119, R.drawable.final_0120
            };

    Погромист на Ондроид наговнокодил это...

    argamidon, 18 Февраля 2015

    Комментарии (16)
  9. C++ / Говнокод #17616

    +55

    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
    uint8_t const Q_ROM QF_div8Lkup[65] = {
        static_cast<uint8_t>(0), // unused location
        static_cast<uint8_t>(0), static_cast<uint8_t>(0), static_cast<uint8_t>(0),
        static_cast<uint8_t>(0), static_cast<uint8_t>(0), static_cast<uint8_t>(0),
        static_cast<uint8_t>(0), static_cast<uint8_t>(0),
        static_cast<uint8_t>(1), static_cast<uint8_t>(1), static_cast<uint8_t>(1),
        static_cast<uint8_t>(1), static_cast<uint8_t>(1), static_cast<uint8_t>(1),
        static_cast<uint8_t>(1), static_cast<uint8_t>(1),
        static_cast<uint8_t>(2), static_cast<uint8_t>(2), static_cast<uint8_t>(2),
        static_cast<uint8_t>(2), static_cast<uint8_t>(2), static_cast<uint8_t>(2),
        static_cast<uint8_t>(2), static_cast<uint8_t>(2),
        static_cast<uint8_t>(3), static_cast<uint8_t>(3), static_cast<uint8_t>(3),
        static_cast<uint8_t>(3), static_cast<uint8_t>(3), static_cast<uint8_t>(3),
        static_cast<uint8_t>(3), static_cast<uint8_t>(3),
        static_cast<uint8_t>(4), static_cast<uint8_t>(4), static_cast<uint8_t>(4),
        static_cast<uint8_t>(4), static_cast<uint8_t>(4), static_cast<uint8_t>(4),
        static_cast<uint8_t>(4), static_cast<uint8_t>(4),
        static_cast<uint8_t>(5), static_cast<uint8_t>(5), static_cast<uint8_t>(5),
        static_cast<uint8_t>(5), static_cast<uint8_t>(5), static_cast<uint8_t>(5),
        static_cast<uint8_t>(5), static_cast<uint8_t>(5),
        static_cast<uint8_t>(6), static_cast<uint8_t>(6), static_cast<uint8_t>(6),
        static_cast<uint8_t>(6), static_cast<uint8_t>(6), static_cast<uint8_t>(6),
        static_cast<uint8_t>(6), static_cast<uint8_t>(6),
        static_cast<uint8_t>(7), static_cast<uint8_t>(7), static_cast<uint8_t>(7),
        static_cast<uint8_t>(7), static_cast<uint8_t>(7), static_cast<uint8_t>(7),
        static_cast<uint8_t>(7), static_cast<uint8_t>(7)
    };
    
    // ....
    
        //! the function evaluates to TRUE if the priority set has the element n.
        bool hasElement(uint_fast8_t const n) const {
            uint_fast8_t const m =
                static_cast<uint_fast8_t>(Q_ROM_BYTE(QF_div8Lkup[n]));
            return ((m_bits[m]
                      & static_cast<uint_fast8_t>(Q_ROM_BYTE(QF_pwr2Lkup[n])))
                   != static_cast<uint_fast8_t>(0));
        }
    
        //! insert element \a n into the set, n = 1..64
        void insert(uint_fast8_t const n) {
            uint_fast8_t m =
                static_cast<uint_fast8_t>(Q_ROM_BYTE(QF_div8Lkup[n]));
            m_bits[m] |= static_cast<uint_fast8_t>(Q_ROM_BYTE(QF_pwr2Lkup[n]));
            m_bytes   |=
                static_cast<uint_fast8_t>(Q_ROM_BYTE(QF_pwr2Lkup[m
                                              + static_cast<uint_fast8_t>(1)]));
        }

    делим на 8 в индустриальном С++. это такой специальный вариант крестов где пользователям сначала лоботомию делают.

    из реализации bitset'а. insert() приведен в качестве примера.

    Dummy00001, 11 Февраля 2015

    Комментарии (16)
  10. JavaScript / Говнокод #17597

    +158

    1. 1
    var picNumber = +!backgroundBlock.data('number');

    или не говнокод?

    artembegood, 07 Февраля 2015

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

    +133

    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
    // Common styles for any tag
    .clear {
      clear: both;
    }
    
    .grey {
      color: $pcolor;
    }
    
    .colored {
      color: $headercolor;
    }
    
    .siteName {
      font-family: $siteNameFontFamily;
    }
    
    .common-ctx {
      color: $pcolor;
      font-size: 105%;
    }
    .common-ctx-light {
      color: $pcolorlight;
      font-size: 100%;
    }
    
    .fs95 {
      font-size: 95%;
    }
    
    .undisplayable {
      display: none;
    }
    
    .displayable {
      display: block;
    }
    
    hr.black-hr {
        border-color: black;
        margin: 10px 0 10px 0;
    }
    
    hr.grey-hr {
        border-color: #cccccc;
        margin: 20px 0 30px 0;
    }
    
    .w30p {
      width: 30% !important;
    }
    
    .w100 {
      width: 100%;
    }
    
    .fl {
      float: left;
    }
    
    .p0 {
        padding: 0 !important;
    }

    Самые интуитивно-понятные имена CSS-классов.

    crazyh, 28 Января 2015

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