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

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

    +162

    1. 1
    2. 2
    3. 3
    4. 4
    <?php
    $opis = trim(esc(implode(NULL,file($dir_loads.'/'.$file.'.txt'))));  // читаем файл
    echo $opis;
    ?>

    Без комментариев даже..

    icq677555, 06 Июля 2011

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

    −109

    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
    public function UiAnalyticVO()
    		{
    		}
    		
    		public function get ageGroup():String
    		{
    			var ageGroup:String;
    // Данные о возрасте пользователя никогда не отправляются, важно только
    // чтобы он был старше 18 (хз зачем).
    // Возраст пользователя устанавливается 1 раз за всю жизнь приложения,
    // даже если у него случится день Рождения - об этом приложение не
    // узнает.
    			if (_age)
    			{
    				ageGroup = _age < 18 ? "1":"2";
    			}
    			else
    			{
    				ageGroup = "0";//undefined age
    			}
    			return ageGroup;
    		}
    . . .
    // эту функцию вызывают много раз в секунду
    		protected function sendAnalytics(categoryType:String, evtType:String):void
    		{
    // жизненный цикл этого объекта - ровно пока не отработает эта функция, 
    // потом он жертва мусорщика
    			var analyticsVo:UiAnalyticVO = new UiAnalyticVO();
    . . .

    Тут прийдется немного нарпячь воображение, чтобы понять, что происходит. Kак бы много всего одновременно... (и даже больше, но для того, чтобы объяснить на сколько все плохо пришлось бы очень много постить. Я думаю, этого должно хватить :)

    wvxvw, 05 Июля 2011

    Комментарии (8)
  4. Perl / Говнокод #7129

    −116

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    9. 9
    sub _check_sms_hash {
        my $self = shift;
        my $q = shift;
    
        my $qs = $q->param('id').$q->param('phone').$q->param('trigger').$q->param('text').$q->param('date').$q->param('check').$self->_sicretsms();
        my $hash = $self->{DB}->selectrow_array("SELECT MD5(?)", undef, $qs);
        return 1 if $hash eq $q->param('sign');
        return 0;
    }

    Православное вычисление контрольной суммы.

    Alikus, 01 Июля 2011

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

    +147

    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
    try
    {
        // A lot of code
    }
    catch (Exception &exception)
    {
        Application->ShowException(&exception);
    }
    catch (...)
    {
        try
        {
           throw Exception("");
        }
        catch (Exception &exception)
        {
            Application->ShowException(&exception);
        }
    }

    :) Обработка исключений

    egoroff, 01 Июля 2011

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

    +136

    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
    <style>
    .comments_indent_holder .comment { margin-left:400px;}
    .comments_indent_holder .indent_0 {	margin-left:38px;}
    .comments_indent_holder .indent_1 {	margin-left:58px;}
    .comments_indent_holder .indent_2 {	margin-left:78px;}
    .comments_indent_holder .indent_3 {	margin-left:98px;}
    .comments_indent_holder .indent_4 {	margin-left:118px;}
    .comments_indent_holder .indent_5 {	margin-left:138px;}
    .comments_indent_holder .indent_6 {	margin-left:158px;}
    .comments_indent_holder .indent_7 {	margin-left:178px;}
    .comments_indent_holder .indent_8 {	margin-left:198px;}
    .comments_indent_holder .indent_9 {	margin-left:218px;}
    .comments_indent_holder .indent_10 { margin-left:238px;}
    .comments_indent_holder .indent_11 { margin-left:258px;}
    .comments_indent_holder .indent_12 { margin-left:278px;}
    .comments_indent_holder .indent_13 { margin-left:298px;}
    .comments_indent_holder .indent_14 { margin-left:318px;}
    .comments_indent_holder .indent_15 { margin-left:338px;}
    .comments_indent_holder .indent_16 { margin-left:358px;}
    .comments_indent_holder .indent_17 { margin-left:378px;}
    .comments_indent_holder .indent_18 { margin-left:398px;}
    .comments_indent_holder .indent_19 { margin-left:418px;}
    .comments_indent_holder .indent_20 { margin-left:438px;}
    </style>
    
    
    <div id="6509734" class="comment indent_0 u28525">
    	....
    </div>
    		
    			
    <div id="6509750" class="comment indent_1 u34409">
    	....
    </div>

    одно иллитарное сообщество с ограниченной вложенностью камментов. facepalm.svg

    DrFreez, 29 Июня 2011

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

    +158

    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
    $('#home').click(function(){
            $.get("q.php", { id: 1 }, function(data){                            
                $('#content').html(data);
            });
        });
    
        $('#programz').click(function(){
            $.get("q.php", { id: 2 }, function(data){                            
                $('#content').html(data);
            });
        });
    				
        $('#contactz').click(function(){
            $.get("q.php", { id: 3 }, function(data){                            
                $('#content').html(data);
            });
        });
    	
        $('#aboutazz').click(function(){
            $.get("q.php", { id: 4 }, function(data){                            
                $('#content').html(data);
            });
        });
    	
        $('#chatz').click(function(){
            $.get("q.php", { id: 5 }, function(data){                            
                $('#content').html(data);
            });
        });  
    
        $('#advertisement').click(function(){
            $.get("q.php", { id: 6 }, function(data){               
                $('#content').html(data);
            });

    Jquery во всей красе.

    bteam, 27 Июня 2011

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

    +147

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    9. 9
    if(dOper1p->Caption == "-0")
       dOper1p->Caption = "+0";
     if(dOper2p->Caption == "-0")
       dOper2p->Caption = "+0";
    
     if(dOper1m->Caption == "-0.0")
       dOper1m->Caption = "+0.0";
     if(dOper2m->Caption == "-0.0")
       dOper2m->Caption = "+0.0";

    yasosiska, 27 Июня 2011

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

    +152

    1. 1
    2. 2
    3. 3
    4. 4
    if ('yes'!= 'yes') {
    	checkCaptcha();
    	return true;
    }

    yasosiska, 27 Июня 2011

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

    +158

    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
    <?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
    <?php echo $this->getChildHtml('form_before') ?>
    <form action="<?php echo $this->getUrl('checkout/cart/updatePost') ?>" method="post">
    <fieldset>
    <table id="shopping-cart-table" class="data-table cart-table">
        <col width="1" />
        <col />
        <col width="1" />
    <?php if ($this->helper('wishlist')->isAllowInCart()) : ?>
        <col width="1" />
    <?php endif ?>
    <?php if ($this->helper('tax')->displayCartPriceExclTax() || $this->helper('tax')->displayCartBothPrices()): ?>
        <col width="1" />
    <?php endif; ?>
    <?php if ($this->helper('tax')->displayCartPriceInclTax() || $this->helper('tax')->displayCartBothPrices()): ?>
        <col width="1" />
    <?php endif; ?>
        <col width="1" />
    <?php if ($this->helper('tax')->displayCartPriceExclTax() || $this->helper('tax')->displayCartBothPrices()): ?>
        <col width="1" />
    <?php endif; ?>
    <?php if ($this->helper('tax')->displayCartPriceInclTax() || $this->helper('tax')->displayCartBothPrices()): ?>
        <col width="1" />
    <?php endif; ?>
        <col width="1" />
    
    <?php $mergedCells = ($this->helper('tax')->displayCartBothPrices() ? 2 : 1); ?>

    Ну так, для уверенности, можно и 4 раза. Искал в этом смысл - смысла не найдено. Copyright (c) 2011 Magento Inc.

    message, 17 Июня 2011

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

    +128

    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
    if (body.ToLower().Contains("pr") || 
                    subject.Contains("PM") ||
                    subject.Contains("pm") ||
                    subject.Contains("Pm") ||
                    subject.Contains("pM") ||
                    subject.Contains("PMR") ||
                    subject.Contains("prs") || 
                    subject.ToLower().Contains("prt") ||
                    subject.ToLower().Contains("prm") ||
                    subject.ToLower().Contains("pmt") ||
                    subject.ToLower().Contains("pmk") ||
                    subject.ToLower().Contains("pml") ||
                    subject.ToLower().Contains("pal"))
                {
                    result = true;
                }

    Пишут друзья из Норвегии

    jenik15, 15 Июня 2011

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