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

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

    +157

    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
    <SCRIPT language=JavaScript>                     <!--#### Подпрограммы (скрипты) для вывода фотографий составных частей ПК #### -->
    	function picture1(){
    		window.open("P4P800.jpg", "newwindow01", config="width=460, height=515, toolbar=0, location=0, directories=0, status=0, menubar=0, scrollbars=0, resizable=0");
    }
    	function picture2(){
    		window.open("CPU.jpg", "newwindow02", config="width=355, height=380, toolbar=0, location=0, directories=0, status=0, menubar=0, scrollbars=0, resizable=0");
    }
    	function picture3(){
    		window.open("Video.jpg", "newwindow03", config="width=475, height=380, toolbar=0, location=0, directories=0, status=0, menubar=0, scrollbars=0, resizable=0");
    }
    	function picture4(){
    		window.open("Syst.jpg", "newwindow04", config="width=220, height=220, toolbar=0, location=0, directories=0, status=0, menubar=0, scrollbars=0, resizable=0");
    }
    	function picture5(){
    		window.open("audio.jpg", "newwindow05", config="width=315, height=200, toolbar=0, location=0, directories=0, status=0, menubar=0, scrollbars=0, resizable=0");
    }
    	function picture6(){
    		window.open("Seti.jpg", "newwindow06", config="width=190, height=120, toolbar=0, location=0, directories=0, status=0, menubar=0, scrollbars=0, resizable=0");
    }
    	function picture7(){
    		window.open("hdd.jpg", "newwindow07", config="width=725, height=425, toolbar=0, location=0, directories=0, status=0, menubar=0, scrollbars=0, resizable=0");
    }
    	function picture8(){
    		window.open("dvd.jpg", "newwindow08", config="width=520, height=205, toolbar=0, location=0, directories=0, status=0, menubar=0, scrollbars=0, resizable=0");
    }
    	function picture9(){
    		window.open("korpus.jpg", "newwindow09", config="width=820, height=435, toolbar=0, location=0, directories=0, status=0, menubar=0, scrollbars=0, resizable=0");
    }
    	function picture10(){
    		window.open("monitor.jpg", "newwindow10", config="width=320, height=320, toolbar=0, location=0, directories=0, status=0, menubar=0, scrollbars=0, resizable=0");
    }
    	function picture11(){
    		window.open("Klava.jpg", "newwindow11", config="width=510, height=250, toolbar=0, location=0, directories=0, status=0, menubar=0, scrollbars=0, resizable=0");
    }
    	function picture12(){
    		window.open("Mouse.jpg", "newwindow12", config="width=340, height=285, toolbar=0, location=0, directories=0, status=0, menubar=0, scrollbars=0, resizable=0");
    }
    	function picture13(){
    		window.open("print.jpg", "newwindow13", config="width=467, height=295, toolbar=0, location=0, directories=0, status=0, menubar=0, scrollbars=0, resizable=0");
    }
    	function picture14(){
    		window.open("RAM.jpg", "newwindow14", config="width=530, height=135, toolbar=0, location=0, directories=0, status=0, menubar=0, scrollbars=0, resizable=0");
    }
    </script>                                    <!--#### Конец скриптов ####-->

    Stallman, 18 Ноября 2012

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

    +83

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    if ((decoded.length() > 40) && (el != null))
          el.addMsg("Info: Decoded More Characters Than Is Specified By The Track 2 ANSI/ISO Standards");
        else if ((decoded.length() > 107) && (el != null)) {
          el.addMsg("Info: Decoded More Characters Than Is Specified By The Track 3 ANSI/ISO Standards");
        }

    Декодинг содержимого магнитной полосы карты в софте одного банка.

    popoffka, 17 Ноября 2012

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

    +135

    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
    int index = 0;
            this.item[index].SetDefaults("Mining Helmet");
            index++;
            this.item[index].SetDefaults("Piggy Bank");
            index++;
            this.item[index].SetDefaults("Iron Anvil");
            index++;
            this.item[index].SetDefaults("Copper Pickaxe");
            index++;
            this.item[index].SetDefaults("Copper Axe");
            index++;
            this.item[index].SetDefaults("Torch");
            index++;
            this.item[index].SetDefaults("Lesser Healing Potion");
            index++;
            ...

    Crazy_penguin, 08 Ноября 2012

    Комментарии (9)
  5. Java / Говнокод #12059

    +94

    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
    String s="a, b, c, d,,,";
    		
    		String[] spl=s.split ( "," );
    		o.println(spl.length);
    		for (String s1: spl)
    			o.print(s1+";");
    //4
    //a; b; c; d;
    		StringTokenizer st=new StringTokenizer(s);
    		o.println("\n"+st.countTokens ());
    		while (st.hasMoreElements ()){
    			o.print(
    				st.nextToken ()+";"
    			);
    		}
    //4
    //a,;b,;c,;d,,,;
    		st=new StringTokenizer(s,",");
    		o.println("\n"+st.countTokens ());
    		while (st.hasMoreElements ()){
    			o.print(
    				st.nextToken ()+";"
    			);
    		}
    //4
    //a; b; c; d;

    http://ideone.com/zh0paB
    Очередной сюжет из серии JavaGovno.

    3.14159265, 05 Ноября 2012

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

    +20

    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
    void __fastcall TfРѕrm1::SpeedButton1Click(TobjРµct *Sender)
    {
    SpeedButton1->Enabled=false;
     SpeedButton1->Caption=Edit1->Text;
     if(Edit1->Text=="X")
     Edit1->Text="0";
     else
     Edit1->Text="X";
     if(SpeedButton1->Caption=="X" && SpeedButton2->Caption=="X" && SpeedButton3->Caption=="X" ||
     SpeedButton4->Caption=="X" && SpeedButton5->Caption=="X" && SpeedButton6->Caption=="X" ||
     SpeedButton7->Caption=="X" && SpeedButton8->Caption=="X" && SpeedButton9->Caption=="X" ||
     SpeedButton1->Caption=="X" && SpeedButton4->Caption=="X" && SpeedButton7->Caption=="X" ||
      SpeedButton2->Caption=="X" && SpeedButton5->Caption=="X" && SpeedButton8->Caption=="X" ||
       SpeedButton3->Caption=="X" && SpeedButton6->Caption=="X" && SpeedButton9->Caption=="X" ||
        SpeedButton1->Caption=="X" && SpeedButton5->Caption=="X" && SpeedButton9->Caption=="X" ||
         SpeedButton3->Caption=="X" && SpeedButton5->Caption=="X" && SpeedButton7->Caption=="X")
    
      ShowMessage("Ea?a caeii?aia, e?anoeee auea?aee");
    
      else
       if(SpeedButton1->Caption=="0" && SpeedButton2->Caption=="0" && SpeedButton3->Caption=="0" ||
     SpeedButton4->Caption=="0" && SpeedButton5->Caption=="0" && SpeedButton6->Caption=="0" ||
     SpeedButton7->Caption=="0" && SpeedButton8->Caption=="0" && SpeedButton9->Caption=="0" ||
     SpeedButton1->Caption=="0" && SpeedButton4->Caption=="0" && SpeedButton7->Caption=="0" ||
      SpeedButton2->Caption=="0" && SpeedButton5->Caption=="0" && SpeedButton8->Caption=="0" ||
       SpeedButton3->Caption=="0" && SpeedButton6->Caption=="0" && SpeedButton9->Caption=="0" ||
        SpeedButton1->Caption=="0" && SpeedButton5->Caption=="0" && SpeedButton9->Caption=="0" ||
         SpeedButton3->Caption=="0" && SpeedButton5->Caption=="0" && SpeedButton7->Caption=="0")
      ShowMessage("Ea?a caeii?aia, iieeee auea?aee");
    
    }

    jQuery, 29 Октября 2012

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

    +136

    1. 1
    2. 2
    3. 3
    4. 4
    revision = String.Format("{0}{1:d2}{2:d2}",
    				DateTime.Now.Year.ToString().Substring(2),
    				DateTime.Today.Month,
    				DateTime.Today.Day);

    видно автор хотел сделать
    revision = DateTime.Today.ToString("yyMMdd");

    http://www.codeproject.com/Articles/272551/Custom-Assembly-Versioning-with-VS-2010-and-MSBUIL

    graph_di5, 28 Октября 2012

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

    +129

    1. 1
    arr <- return $ map (2*) lst

    Я тут читал раздел на одном форуме по решению задач для школьников и наткнулся на такое говно.
    - let?
    - Не, не слышал.
    Подозреваю, что автор не понял, что let нужно писать без in в монадах, чтобы скомпилировалось.

    HaskellGovno, 17 Октября 2012

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

    +50

    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
    $submit = $_REQUEST['submit'];
    if(isset($submit))
    {
    
    	$first_name = $_REQUEST['first_name'];
    	$last_name = $_REQUEST['last_name'];	
    	$address = $_REQUEST['address'];
    	$city = $_REQUEST['city'];
    	$country = $_REQUEST['country'];
    	$state = $_REQUEST['state'];
    	$zipcode = $_REQUEST['zipcode'];
    	$phone = $_REQUEST['phone'];
    	$email = $_REQUEST['email'];
    		
    	$_SESSION['first_name'] = $first_name;
    	$_SESSION['last_name'] = $last_name;
    	$_SESSION['address'] = $address;
    	$_SESSION['city'] = $city;
    	$_SESSION['country'] = $country;
    	$_SESSION['state'] = $state;
    	$_SESSION['zipcode'] = $zipcode;
    	$_SESSION['phone'] = $phone;
    	$_SESSION['email'] = $email;
    	
    	
    	?>
    	  <meta http-equiv="refresh" content="0;url=https://www.site.com/development1/billing_info.php"/>
    	<?
    	  exit();

    оригинальная обработка сабмита формы и редиректа

    bytes, 16 Октября 2012

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

    +139

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    switch (!_data.Provider)
    {
            case true: _currentState = states.DT2F; break;
            case false: _currentState = states.DT2P; break;
    }

    Проверка двух условий

    Prafesor, 10 Октября 2012

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

    +50

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    /**
         * Что я курил, когда это писал? Почему нельзя было date('H:i:s', $time) ??? +___=
         * @param $seconds
         * @return string
         */
        private static function prettySecondsPrint($seconds){
            return str_pad((int)($seconds / 3600), 2, '0', STR_PAD_LEFT)
                .':'.str_pad((int)(($seconds % 3600) / 60), 2, '0', STR_PAD_LEFT)
                .':'.str_pad($seconds % 60, 2, '0', STR_PAD_LEFT);
        }

    А это, к сожалению, мое творение) Комменарий приписал когда позже просматривал код и обнаружил это)

    et, 28 Сентября 2012

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