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

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

    −40

    1. 1
    *new

    Самая соль.

    Говногость, 20 Июня 2012

    Комментарии (22)
  3. JavaScript / Говнокод #10548

    +151

    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
    ISQ.Widget.ContactForm.clickEventHandler=function(a){
        switch(a.result){
        case ISQ.Forms.clickEventEnum.SUBMIT:
    	ISQ.Widget.Log.add("contactForm submit");
    	ISQ.Widget.ContactForm.send(a.formElements);
    	ISQ.Widget.ContactForm.close(true);
    	break;
        case ISQ.Forms.clickEventEnum.CANCEL:
    	if(ISQ.Cnf.limited){
    	    break
    	}
    	ISQ.Widget.Log.add("contactForm cancel");
    	if(a.query!==""){
    	    ISQ.Widget.HTML.queryField.value=a.query
    	}
    	ISQ.Widget.ContactForm.canceled=true;
    	ISQ.Widget.ContactForm.close();
    	break;
        case ISQ.Forms.clickEventEnum.ERROR:
    	ISQ.Widget.Log.add("contactForm input error");
    	break
        }
    };

    Если честно, то тут автор даже удивил. Как-то раньше ни разу не пришлось два брейка в одном кейсе делать, все как-то одним обходился.

    wvxvw, 04 Июня 2012

    Комментарии (22)
  4. Haskell / Говнокод #10205

    −84

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    data (,) a b = (,) a b
        deriving Generic
    data (,,) a b c = (,,) a b c
        deriving Generic
    data (,,,) a b c d = (,,,) a b c d
        deriving Generic
    .......
    data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__
     = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__
        -- deriving Generic
    {- Manuel says: Including one more declaration gives a segmentation fault.

    Вот такая вот реализация туплов:
    http://www.haskell.org/ghc/docs/7.4.1/html/libraries/ghc-prim-0.2.0.0/src/GHC-Tuple.html

    bormand, 05 Мая 2012

    Комментарии (22)
  5. 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)
  6. bash / Говнокод #10070

    −366

    1. 1
    d:/mingw/lib/gcc/../../x86_64-w64-mingw32/include/io.h:175:16: error: 'long long long' is too long for GCC

    lebutirate, 28 Апреля 2012

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

    +162

    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
    function reverseStack()
    {
    $this->stackNotation = array_reverse($this->stackNotation);
    $this->lenght = count($this->stackNotation);
    return $this->lenght;
    }
    
    function calculateNotation()
    {
    $this->result = $this->stackNotation[0];
    for($this->i = 1; $this->i < $this->lenght; $this->i++) {
    $this->j = $this->i — 1;
    switch($this->arifmeticSign[$this->j] ) {
    case ’*’:
    $this->result = $this->result * $this->stackNotation[$this->i];
    
    ...

    новое слово в пэхэпэ-оопэ.

    http://dou.ua/forums/topic/5548/

    huitka, 11 Апреля 2012

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

    +106

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    private void ReferenceButton_Click(object sender, EventArgs e)
            {
                this.ContentBox.Controls.Remove(this.BooksPanel);
                this.ContentBox.Controls.Remove(this.LogoPanel);
                this.ContentBox.Controls.Remove(this.SearchPanel);
                this.ContentBox.Controls.Add(this.FAQPanel);
            }

    Удаляем старые контролы таким образом)
    Почти в 100% случаев найдется умник, который назовет любой код - говном.

    Govnisti_Diavol, 11 Марта 2012

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

    +142

    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
    #include <dos.h>
    #include <conio.h>
    #include <graphics.h>
    
    
    void pix(unsigned int x, unsigned int  y, unsigned char c){
        unsigned char nb, ms, bt;                     //nomerbit maska bite
        unsigned int ofs;                      //sdvig
        unsigned char *pb;                //ukazatel na bit
    
        ofs= x/8 + y*80;
        nb=7-(x % 8);
        pb=(unsigned char *)MK_FP(0xA000, ofs);
        bt=*pb;
        ms=1<<nb;
    
        if( c !=0  ){
            bt=bt |  ms;
        }else{
            bt=bt&(~ms);
        };
    
        *pb=bt;
    };
    
    void main(){
        int drDriver, grMode;
        drDriver=VGA;
        grMode=VGAHI;
        initgraph(&drDriver, &grMode, "C:\\BORLANDC\\BGI");
        pix(60,30,15);
        getch();
    };

    13: где взял адрес
    28,29: с чего ты решил, что для паскалевского драйвера подходят определения сишного драйвера?
    30: почему драйвер паскалевский?

    all: ебанный пиздец, кто ж так пишет...

    d4rw1n1s7, 17 Февраля 2012

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

    +1000

    1. 1
    2. 2
    3. 3
    4. 4
    while (cin >> v1 >> v2 >> t >> f >> c)
    {
        ...
    }

    Олимпиадная задачка, на вход подается всего 5 чисел. Все решение находится внутри вышеприведенного while'а.

    haskile, 02 Февраля 2012

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

    +1006

    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
    int main()
    {
        // инициализация графики
        ...
        
        while (!kbhit())
        {
            int start = rand();
            srand(start);
            
            // рисуем фейерверк
            for (int i = 0; i < 100; i++)
            {
                int x = rand();
                int y = rand();
                int color = rand();
                
                putPixel(x, y, color);
            }
            
            sleep(100);
            
            // стираем
            srand(start);
            
            for (int i = 0; i < 100; i++)
            {
                int x = rand();
                int y = rand();
                rand();
                
                if (getPixelColor(x, y) != BLACK)
                    putPixel(x, y, BLACK);
            }
        }
        
        return 0;
    }

    Вот такой пример использования графической библиотеки нам давали в институте. (Набирал по памяти т.к. я решил это с доски не переписывать.)

    vovams, 31 Января 2012

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