1. VisualBasic / Говнокод #134

    −593.8

    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
    Dim cr
    
    Private Function click()
    If cr = 0 Then
    cr = 1
    click = "X"
    Else
    cr = 0
    click = "O"
    End If
    End Function
    Private Sub CommandButton1_Click()
    If CommandButton1.Caption = "" Then CommandButton1.Caption = click()
    End Sub
    
    Private Sub CommandButton10_Click()
    cr = 0
     CommandButton1.Caption = ""
     CommandButton2.Caption = ""
     CommandButton3.Caption = ""
     CommandButton4.Caption = ""
     CommandButton5.Caption = ""
     CommandButton6.Caption = ""
     CommandButton7.Caption = ""
     CommandButton8.Caption = ""
     CommandButton9.Caption = ""
     
    End Sub
    
    Private Sub CommandButton2_Click()
    If CommandButton2.Caption = "" Then CommandButton2.Caption = click()
    
    End Sub
    
    Private Sub CommandButton3_Click()
    If CommandButton3.Caption = "" Then CommandButton3.Caption = click()
    End Sub
    
    Private Sub CommandButton4_Click()
    If CommandButton4.Caption = "" Then CommandButton4.Caption = click()
    End Sub
    
    Private Sub CommandButton5_Click()
    If CommandButton5.Caption = "" Then CommandButton5.Caption = click()
    End Sub
    
    Private Sub CommandButton6_Click()
    If CommandButton6.Caption = "" Then CommandButton6.Caption = click()
    End Sub
    
    Private Sub CommandButton7_Click()
    If CommandButton7.Caption = "" Then CommandButton7.Caption = click()
    End Sub
    
    Private Sub CommandButton8_Click()
    If CommandButton8.Caption = "" Then CommandButton8.Caption = click()
    End Sub
    
    Private Sub CommandButton9_Click()
    If CommandButton9.Caption = "" Then CommandButton9.Caption = click()
    End Sub

    Крестики-нолики на Power Point за 2 минуты.

    guest, 12 Декабря 2008

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

    +44

    1. 1
    document.getElementById(element.id).checked = true;

    guest, 12 Декабря 2008

    Комментарии (27)
  3. Pascal / Говнокод #131

    +23

    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
    if not MultiThread then
      begin
        GetName(@rec);
        result:=rec.fname;
      end
      else
      begin
        hThread:=CreateThread(0,0,@GetName,@rec,0,tmp);
        if WaitForSingleObject(hThread,100)=WAIT_TIMEOUT then
          TerminateThread(hThread,0)
        else
          result:=rec.fname;
        CloseHandle(hThread);
      end;

    Дельфисты - ущербные люди......

    guest, 12 Декабря 2008

    Комментарии (12)
  4. Python / Говнокод #130

    −229.2

    1. 1
    2. 2
    3. 3
    4. 4
    try:
        tray.pop_item('Note')
    except:
        pass

    Этот код вытаскивает (вытаскивал) элемент из трея. На каждом кадре. %)

    guest, 12 Декабря 2008

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

    +3.4

    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
    try
    {
        ...
        if (obj == null)
        {
            LogManager.GetLogger("Log").Warn(msg);
            throw new SoapException("Object not found", SoapException.ServerFaultCode);
        }
    }
    catch (Exception ex)
    {
        LogManager.GetLogger("Log").Error(msg, ex);
        throw new SoapException("Object not found, SoapException.ServerFaultCode, ex);                
    }

    guest, 12 Декабря 2008

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

    −60

    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
    if (!account_number.equals("") && cycleT != null) {
        if (!account_number.equals(num)) {
            doWrite(bufferedOut);
            account_number = num;
            cycleT = c;
            vT = v;
        } else if (!cycleT.equals(c)) {
            doWrite(bufferedOut);
            account_number = num;
            cycleT = c;
            vT = v;
        } else if (vT != v) {
            doWrite(bufferedOut);
            account_number = num;
            cycleT = c;
            vT = v;
        }
    } else {
        account_number = num;
        cycleT = c;
        vT = v;
    }

    guest, 12 Декабря 2008

    Комментарии (8)
  7. C++ / Говнокод #127

    −32

    1. 1
    #define NULL 1

    :) Из той же оперы, что и http://govnokod.ru/62

    guest, 12 Декабря 2008

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

    +29

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    int main ()
    {{{
        
        return 0;
    }}}

    Я любил делать так... От этого хуже работать не будет, но вызывает вопросительное выражение лица.

    guest, 12 Декабря 2008

    Комментарии (7)
  9. Си / Говнокод #125

    −11.9

    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
    void safecpy(char *str1, char *str2)
    {
    	strncpy(str1, str2, strlen(str1));
    	str1[strlen[str1]] = 0;
    }
    
    ...
    
    void safecpy(char *str1, char *str2)
    {
    	strncpy(str1, str2, sizeof(str1));
    	str1[sizeof(str1)] = 0;
    }

    Две примера функций \"безопасного\" копирования строк :-)

    guest, 12 Декабря 2008

    Комментарии (3)
  10. PHP / Говнокод #124

    −71.9

    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
    // get today's date string as YYYY-MM-DD HH:MM:SS
    
       function getDateTime(){
           $datetime = getdate();
           $mday = $datetime['mday'];
           if ($mday<10){
               $mday="0$mday";
           }
           $mon = $datetime['mon'];
           if ($mon<10){
               $mon="0$mon";
           }
           $year = $datetime['year'];
           $mhour = $datetime['hours'];
           if ($mhour<10){
               $mhour="0$mhour";
           }
           $mmin = $datetime['minutes'];
           if ($mmin<10){
               $mmin="0$mmin";
           }
           $msec = $datetime['seconds'];
           if ($msec<10){
               $msec="0$msec";
           }
    
           $dateTime = "$year-$mon-$mday $mhour:$mmin:$msec";
           return $dateTime;
       }

    Китайский код самый беспощадный...

    guest, 12 Декабря 2008

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