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

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

    +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
    if (M[1]<>M[2]) and (M[1]<>M[3]) and (M[1]<>M[4]) and (M[1]<>M[5]) and (M[1]<>M[6]) then
    begin
    if (M[1]<>M[7]) and (M[1]<>M[8]) and (M[1]<>M[9]) and (M[1]<>M[10]) then
    write('  ',M[1],'  ');
    end;
     
    if (M[2]<>M[1]) and (M[2]<>M[3]) and (M[2]<>M[4]) and (M[2]<>M[5]) and (M[2]<>M[6]) then
    begin
    if (M[2]<>M[7]) and (M[2]<>M[8]) and (M[2]<>M[9]) and (M[2]<>M[10]) then
    write('  ',M[2],'  ');
    end;
     
    if (M[3]<>M[1]) and (M[3]<>M[2]) and (M[3]<>M[4]) and (M[3]<>M[5]) and (M[3]<>M[6]) then
    begin
    if (M[3]<>M[7]) and (M[3]<>M[8]) and (M[3]<>M[9]) and (M[3]<>M[10]) then
    write('  ',M[3],'  ');
    end;
     
    if (M[4]<>M[1]) and (M[4]<>M[2]) and (M[4]<>M[3]) and (M[4]<>M[5]) and (M[4]<>M[6]) then
    begin
    if (M[4]<>M[7]) and (M[4]<>M[8]) and (M[4]<>M[9]) and (M[4]<>M[10]) then
    write('  ',M[4],'  ');
    end;
     
    if (M[5]<>M[1]) and (M[5]<>M[2]) and (M[5]<>M[3]) and (M[5]<>M[4]) and (M[5]<>M[6]) then
    begin
    if (M[5]<>M[7]) and (M[5]<>M[8]) and (M[5]<>M[9]) and (M[5]<>M[10]) then
    write('  ',M[5],'  ');
    end;
     
    if (M[6]<>M[1]) and (M[6]<>M[2]) and (M[6]<>M[3]) and (M[6]<>M[4]) and (M[6]<>M[5]) then
    begin
    if (M[6]<>M[7]) and (M[6]<>M[8]) and (M[6]<>M[9]) and (M[6]<>M[10]) then
    write('  ',M[6],'  ');
    end;
     
    if (M[7]<>M[1]) and (M[7]<>M[2]) and (M[7]<>M[3]) and (M[7]<>M[4]) and (M[7]<>M[5]) then
    begin
    if (M[7]<>M[6]) and (M[7]<>M[8]) and (M[7]<>M[9]) and (M[7]<>M[10]) then
    write('  ',M[7],'  ');
    end;
    readln;
     
    if (M[8]<>M[1]) and (M[8]<>M[2]) and (M[8]<>M[3]) and (M[8]<>M[4]) and (M[8]<>M[5]) then
    begin
    if (M[8]<>M[6]) and (M[8]<>M[7]) and (M[8]<>M[9]) and (M[8]<>M[10]) then
    write('  ',M[8],'  ');
    end;
     
    if (M[9]<>M[1]) and (M[9]<>M[2]) and (M[9]<>M[3]) and (M[9]<>M[4]) and (M[9]<>M[5]) then
    begin
    if (M[9]<>M[6]) and (M[9]<>M[7]) and (M[9]<>M[8]) and (M[8]<>M[10]) then
    write('  ',M[9],'  ');
    end;
     
    if (M[10]<>M[1]) and (M[10]<>M[2]) and (M[10]<>M[3]) and (M[10]<>M[4]) and (M[10]<>M[5]) then
    begin
    if (M[10]<>M[6]) and (M[10]<>M[7]) and (M[10]<>M[8]) and (M[10]<>M[9]) then
    write('  ',M[10],'  ');
    end;

    Циклы? Не, не слышал...

    HighPredator, 19 Июня 2012

    Комментарии (6)
  3. C# / Говнокод #10358

    +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
    PropertyAdminFormModel data = new PropertyAdminFormModel
                    { 
                        DateFinish = rep.DateFinish,
                        Name = rep.Name,
                        ReportingCircleId = rep.ReportingCircleId
                    };
    
                    if (data != null)
                    {
                        Id = reportId;
                        Name = data.Name;
                        DateFinish = data.DateFinish;
                        ReportingCircleId = data.ReportingCircleId;
                    }

    А вдруг!? =)

    DukeGonzo, 24 Мая 2012

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

    +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
    private void button6_Click(object sender, EventArgs e)
            {
                string str;
                FileStream fs = new FileStream("file.data", FileMode.Open,FileAccess.Read);
                BinaryReader br = new BinaryReader(fs, Encoding.UTF8);
                try
                {
                    while (true)
                    {
                        str = br.ReadString();
                        listBox1.Items.Add(str);
                    }
                }
                catch { MessageBox.Show("Файл file.data успешно считан", "Успех!", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); }
    
                fs.Close();
                br.Close();
            }

    while (true)-изюминка конечно =)
    а так это из курсовой первокурсницы, так что простительно

    Bagger288, 29 Апреля 2012

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

    +110

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    int[] k = new int[docArr.Length];
    int index = 0;
    
    foreach (var item in docArr)
    {
          k[index] = (int)item;
          index++;
    }
    
    var l = k.ToArray().OrderByDescending(i => i);

    True сортировка массива.

    partizan, 23 Апреля 2012

    Комментарии (14)
  6. 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)
  7. C# / Говнокод #9974

    +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
    public  Operation.OperationStatus   OperState
            {
                get { return fOperState; }
                set
                {
                    fOperState  =   value;
                    // Надписи кнопок смены статуса
                    TOperation.TOperationState  
                        OperationState  =   TOperation.OperationState(value);
                    btnOldState.Text    =   OperationState.OldName;
                    btnNewState.Text    =   OperationState.NewName;
                    // Видимость кнопок смены статуса
                    switch (value)
                    {
                        case Operation.OperationStatus.New          :
                            btnOldState.Visible =   OperationState.OldName.Length > 0 && !ReadOnlyMode;
                            btnNewState.Visible =   OperationState.NewName.Length > 0 && OwnerOper.AccessInput && !ReadOnlyMode;
                            break;
    
                        case Operation.OperationStatus.DataInput    :
                            btnOldState.Visible =   OperationState.OldName.Length > 0 && OwnerOper.AccessInput && !ReadOnlyMode;
                            btnNewState.Visible =   OperationState.NewName.Length > 0 && OwnerOper.AccessCheck && !ReadOnlyMode;
                            break;
    
                        case Operation.OperationStatus.DataCheck    :
                            btnOldState.Visible =   OperationState.OldName.Length > 0 && OwnerOper.AccessCheck && !ReadOnlyMode;
                            btnNewState.Visible =   OperationState.NewName.Length > 0 && OwnerOper.AccessConfirm && !ReadOnlyMode;
                            break;
    
                        case Operation.OperationStatus.Closed       :
                            btnOldState.Visible =   OperationState.OldName.Length > 0 && OwnerOper.AccessConfirm && !ReadOnlyMode;
                            btnNewState.Visible =   OperationState.NewName.Length > 0 && !ReadOnlyMode;
                            break;
                    }
                }
            }
    public  static  TOperationState OperationState(Operation.OperationStatus pState)
            {
                TOperationState Result  =   new TOperationState();
                switch (pState)
                {
                    case Operation.OperationStatus.New          :
                        Result.OldName  =   "";
                        Result.NewName  =   "Данные введены";
                        break;
                    case Operation.OperationStatus.DataInput    :
                        Result.OldName  =   "Отменить \"Данные введены\"";
                        Result.NewName  =   "Данные проверены";
                        break;
                    case Operation.OperationStatus.DataCheck    :
                        Result.OldName  =   "Отменить \"Данные проверены\"";
                        Result.NewName  =   "Завершена";
                        break;
                    case Operation.OperationStatus.Closed       :
                        Result.OldName  =   "Отменить \"Завершена\"";
                        Result.NewName  =   "";
                        break;
                }
                return Result;
            }

    Не прям штобы очень, но шоколад есть...

    gcoder, 18 Апреля 2012

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

    +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
    public abstract class AbstractSegment<P extends Number, V extends IOffsettable<P, V>,
    		U extends AbstractSegment<P, V, U>> implements IOffsettable<P, U>, Iterable<V>, Serializable {
    	...
    	
    	protected final List<V> offsetHelper(final P dx, final P dy) {
    		return Lists.transform(points, new Function<V, V>() {
    			@Override
    			public V apply(final V input) {
    				return input.offset(dx, dy);
    			}
    		});
    	}
    
    
    
    public final class FloatSegment extends AbstractSegment<Float, FloatPoint, FloatSegment> {
    	...
    	@Override
    	public FloatSegment offset(final Float dx, final Float dy) {
    		return new FloatSegment(offsetHelper(dx, dy));
    	}
    }

    someone, 11 Апреля 2012

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

    +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
    public class CatalogCache : IDIsposable
    {
        public void Dispose()
        {
            if (_loadThread != null)
            {
                if (_loadThread.IsAlive)
                    _loadThread.Abort();
            }
    
            if (_updateThread != null)
            {
                if (_updateThread.IsAlive)
                    _updateThread.Abort();
            }
    }

    abatishchev, 05 Апреля 2012

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

    +110

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    // Loop through the list of passwords and try them until one works
    for (; passwordcounter < passwords.Length; passwordcounter++) 
    { 
         //shit goes here 
    }

    ...another one.

    fr0mrus, 14 Марта 2012

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

    +110

    1. 1
    <span class="<asp:PlaceHolder runat='server' Visible='<%# IsSuspiciousActivity(10) %>'> b-suspicious-activity </asp:PlaceHolder>">

    banderror, 01 Марта 2012

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