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

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

    +123

    1. 1
    createCanvas(); // create canvas!

    Комментарии от Кэпа.

    someone, 29 Мая 2012

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

    −131

    1. 1
    2. 2
    alter table EqualityCodes add constraint chk_EqualityCodes_Code
      check (Code not in ('', ' ', '  ', '   ', '    ', '     ', '      ', '       '));

    glprizes, 28 Мая 2012

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

    −22

    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
    class TFunctorMap
    	{
    	public:
    		typedef bool (*TFunctor)(const TSentenceList&, unsigned short &);
    	private:
    		std::map<char, TFunctor> _functorMap;
    	public:
    		TFunctorMap(void)
    		{
    			_functorMap.insert(std::make_pair('g', &RZC));
    			_functorMap.insert(std::make_pair('t', &STN));
    			_functorMap.insert(std::make_pair('d', &RTC));
    		}
    		TFunctor GetFunctor(const char Key)
    		{
    			if (_functorMap.find(Key) == _functorMap.end())
    				return NULL;
    			return _functorMap[Key];
    		}
    	};

    Говногость, 16 Мая 2012

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

    +141

    1. 1
    2. 2
    string Signal = Console.ReadLine();
    Console.WriteLine(Convert.ToString(bool.Parse(Signal))); //НУ НАХУЯ?!?!?

    Для непонятных: Автор говна создает переменную типа string и записывает туда введенную в консоли строку, после он нехилым образом вызывает метод Parse который из string переводит в bool, а потом этот поносопроггер переконвертирует полученную переменную типа bool в переменную типа string. Ну нахуя спрашивается????

    KusokGovna, 15 Мая 2012

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

    +160

    1. 1
    2. 2
    3. 3
    4. 4
    <button type='button' id='button-download'>download zipfile</button>
    $("#button-download").live("click", function() {
        $.get("http://localhost/admin/zip/002140.zip"); // doesn't work?
    })

    Ссылка на скачивание файла, современный вариант.

    mozg, 13 Мая 2012

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

    +83

    1. 1
    $v = (((bool) $v) ? true : false);

    somnambulism, 05 Мая 2012

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

    −282

    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
    NSArray *beautifulValues = [[NSArray alloc] initWithObjects:
                                    [NSNumber numberWithFloat:0.00001], 
                                    [NSNumber numberWithFloat:0.00005], 
                                    [NSNumber numberWithFloat:0.0001],
                                    [NSNumber numberWithFloat:0.005],
                                    [NSNumber numberWithFloat:0.001],
                                    [NSNumber numberWithFloat:0.005],
                                    [NSNumber numberWithFloat:0.01],
                                    [NSNumber numberWithFloat:0.05], 
                                    [NSNumber numberWithFloat:0.1],
                                    [NSNumber numberWithFloat:0.5],
                                    [NSNumber numberWithFloat:1],
                                    [NSNumber numberWithFloat:5],
                                    [NSNumber numberWithFloat:10],
                                    [NSNumber numberWithFloat:50],
                                    [NSNumber numberWithFloat:100],
                                    [NSNumber numberWithFloat:500],
                                    [NSNumber numberWithFloat:1000],
                                    [NSNumber numberWithFloat:5000],
                                    [NSNumber numberWithFloat:10000],
                                    [NSNumber numberWithFloat:50000],
                                    [NSNumber numberWithFloat:100000],
                                    [NSNumber numberWithFloat:500000],
                                    [NSNumber numberWithFloat:1000000],
                                    [NSNumber numberWithFloat:5000000],
                                    [NSNumber numberWithFloat:10000000], nil];

    Нашел в одном из проектов.

    itruf, 30 Апреля 2012

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

    +155

    1. 1
    2. 2
    3. 3
    4. 4
    <style type="text/css">
    #1{display:<script type="text/javascript">if(NextStrInfo(1) == 1){document.write("block");}else{document.write("none");}</script>;}
    #2{display:<script type="text/javascript">if(NextStrInfo(2) == 1){document.write("block");}else{document.write("none");}</script>;}
    </style>

    Замечено на форуме.

    Nikitian, 29 Апреля 2012

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

    +958

    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
    public int RomeToArab (string str)
    {
    	int[] arabian = new int[13] { 1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1 };
    	strint[] rome = new string[13] { "M", "CM", "D", "CD", "C", "XC", "L", "XL", "X", "IX", "V", "IV", "I" };
    	int n = 0;
    	int i = 0;
    	do
    	{
    		if (str.StartsWith(rome[i]))
    		{
    			n = n + arabian[i];
    			str = str.Substring(rome[i].Length, str.Length - rome[i].Length);
    		}
    		if (!str.StartsWith(rome[i])
    			i++;
    	}
    	while (i < 13);
    	return n;
    }

    aleksi, 20 Апреля 2012

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

    +110

    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
    this.pictureBox14.BeginInit();
          this.pictureBox15.BeginInit();
          this.pictureBox15.BeginInit();
          this.pictureBox21.BeginInit();
          this.pictureBox21.BeginInit();
          this.pictureBox22.BeginInit();
          this.pictureBox22.BeginInit();
          this.pictureBox23.BeginInit();
          this.pictureBox23.BeginInit();
          this.pictureBox24.BeginInit();
          this.pictureBox24.BeginInit();
          this.pictureBox16.BeginInit();
          this.pictureBox16.BeginInit();
          this.pictureBox17.BeginInit();
          this.pictureBox17.BeginInit();
          this.pictureBox18.BeginInit();
          this.pictureBox18.BeginInit();
          this.pictureBox19.BeginInit();
          this.pictureBox19.BeginInit();
          this.pictureBox20.BeginInit();
          this.pictureBox20.BeginInit();
          this.pictureBox9.BeginInit();
          this.pictureBox9.BeginInit();
          this.pictureBox6.BeginInit();
          this.pictureBox6.BeginInit();
          this.pictureBox5.BeginInit();
          this.pictureBox5.BeginInit();
          this.pictureBox7.BeginInit();
          this.pictureBox7.BeginInit();
          this.pictureBox10.BeginInit();
          this.pictureBox10.BeginInit();
          this.panel1.SuspendLayout();
          this.panel1.SuspendLayout();
          this.SuspendLayout();
          this.SuspendLayout();
          this.panel3.Location = new Point(140, 36);
          this.panel3.Location = new Point(140, 36);
          this.panel3.Name = "panel3";
          this.panel3.Name = "panel3";
          this.panel3.Size = new Size(740, 436);
          this.panel3.Size = new Size(740, 436);
          this.panel3.TabIndex = 4;
          this.panel3.TabIndex = 4;
          this.panel3.MouseDown += new MouseEventHandler(this.panel3_MouseDown);
          this.panel3.MouseDown += new MouseEventHandler(this.panel3_MouseDown);
          this.panel3.MouseUp += new MouseEventHandler(this.panel3_MouseUp);
          this.panel3.MouseUp += new MouseEventHandler(this.panel3_MouseUp);
          this.pictureBox2.BackColor = Color.Gray;
          this.pictureBox2.BackColor = Color.Gray;
          this.pictureBox2.Location = new Point(-11, 0);
          this.pictureBox2.Location = new Point(-11, 0);
          this.pictureBox2.Name = "pictureBox2";
          this.pictureBox2.Name = "pictureBox2";
          this.pictureBox2.Size = new Size(938, 36);
          this.pictureBox2.Size = new Size(938, 36);
          this.pictureBox2.TabIndex = 1;
          this.pictureBox2.TabIndex = 1;
          this.pictureBox2.TabStop = false;
          this.pictureBox2.TabStop = false;
          this.pictureBox3.BackColor = Color.Gray;
          this.pictureBox3.BackColor = Color.Gray;
          this.pictureBox3.Location = new Point(880, 12);
          this.pictureBox3.Location = new Point(880, 12);
          this.pictureBox3.Name = "pictureBox3";
          this.pictureBox3.Name = "pictureBox3";
          this.pictureBox3.Size = new Size(36, 466);
          this.pictureBox3.Size = new Size(36, 466);
          this.pictureBox3.TabIndex = 0;
          this.pictureBox3.TabIndex = 0;
          this.pictureBox3.TabStop = false;
          this.pictureBox3.TabStop = false;
          this.pictureBox1.BackColor = Color.Gray;
          this.pictureBox1.BackColor = Color.Gray;
          this.pictureBox1.Location = new Point(-4, 472);
          this.pictureBox1.Location = new Point(-4, 472);
          this.pictureBox1.Name = "pictureBox1";
          this.pictureBox1.Name = "pictureBox1";
          this.pictureBox1.Size = new Size(938, 36);
          this.pictureBox1.Size = new Size(938, 36);
          this.pictureBox1.TabIndex = 0;

    Полная версия: http://pastebin.com/KwDzLR4s

    P4R4, 18 Апреля 2012

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