1. 1C / Говнокод #14166

    −131

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    Процедура ОбработкаЗаполения(Основание)
    
    	// Другой говнокод
    
    КонецПроцедуры

    Стажёр подошёл с вопросом, почему не обрабатывается ввод на основании, а до этого бился не менее часа.

    Voittamaton, 03 Декабря 2013

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

    +130

    1. 1
    class Int extends Float {}

    http://haxe.ru/ref-base_types

    someone, 02 Декабря 2013

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

    +129

    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
    [Serializable]
     private class NameValue<N, V>
     {
          public N Name { get; set; }
          public V Value { get; set; }
          public NameValue() { }
          public NameValue(N name, V value)
          {
              Name = name;
              Value = value;
          }
     }
    
     private System.Collections.Generic.List<NameValue<string, string>> productList =
                new System.Collections.Generic.List<NameValue<string, string>>();

    не шутка

    taburetka, 02 Декабря 2013

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

    +77

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    final Pair<List<Pair<Pair<Long, String>, Maybe<String>>>, List<Pair<Pair<Long, String>, Maybe<String>>>> split = Cu.split(pushResults, new Filter<Pair<Pair<Long, String>, Maybe<String>>>() {
                @Override
                public boolean fits(final Pair<Pair<Long, String>, Maybe<String>> arg) {
                    return arg.second.hasValue();
                }
            });

    Functional Java: simply clever

    roman-kashitsyn, 02 Декабря 2013

    Комментарии (16)
  5. PHP / Говнокод #14161

    +155

    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
    $sqlQuery = trim(str_replace("\n", ' ', $sqlQuery));
    $sqlQuery = trim(str_replace("\r", ' ', $sqlQuery));
    $sqlQuery = trim(str_replace("\r\n", ' ', $sqlQuery));
    $sqlQuery = trim(str_replace("\t", ' ', $sqlQuery));
    
    $len = strlen($sqlQuery);
    $type = '';
    $i = 0;
    
    while ($i < $len && $sqlQuery{$i} != ' ') {
    	$type .= $sqlQuery{$i};
    	$i++;
    }
    
    $type = strtoupper($type);

    Получение типа запроса (SELECT, UPDATE и т.д. из строки запроса)

    Homess, 02 Декабря 2013

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

    +121

    1. 1
    http://developerslife.ru/7879

    // говнокодогенератор, он существует

    Smekalisty, 02 Декабря 2013

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

    +13

    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
    typedef std::queue<Msg> Queue;    
        
    
    struct SharedQueue
    {
        private:
            Queue m_queue;
            boost::mutex m_mux;
            boost::condition_variable m_condvar;    
        private:
            struct is_empty
            {
                Queue& queue;
                is_empty( Queue& q):
                    queue(q)
                {
                }
    
                bool operator()() const
                {
                    return !queue.empty();
                }
            };
        public:
            void push(const Msg& msg)
            {
                boost::mutex::scoped_lock lock(m_mux);
                m_queue.push( msg);
                m_condvar.notify_one();
            }
    
            bool try_pop( Msg& msg, Kind kind)
            {
                boost::system_time const timeout=boost::get_system_time()+ boost::posix_time::milliseconds( 30000);
                boost::mutex::scoped_lock lock( m_mux);
                if ( m_condvar.timed_wait( lock, timeout, is_empty( m_queue)))
                {
                    if( !m_queue.empty() && m_queue.front().kind == kind)
                    {
                        msg = m_queue.front();
                        m_queue.pop();
                        return true;
                    }
                }
                return false;
            }
    };

    Это ж пипец, дорогие товарищи...

    blackhearted, 29 Ноября 2013

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

    +137

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    catch(Exception ex)
    {
        try
        {
            insertAction(TXTextControl.StringStreamType.PlainText);
            GcmExceptionHandlerForm.ShowException(ex);
        }
        catch (Exception ex2)
        {
                GcmExceptionHandlerForm.ShowException(ex2);
        }
    }

    Что-то пошло не так...

    minuzZ, 29 Ноября 2013

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

    +157

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    that.add = function(rule, handler){
        if(typeof handler == 'function'){
            var ruleArray = rule.split('.'),
                  ruleLength = ruleArray.length;
            rule = stack;
            cm.forEach(ruleArray, function(str, i){
                rule = rule[str] && rule[str].constructor == Array && rule[str].push(handler) || (++i < ruleLength)? (rule[str] = {}) : (rule[str] = [handler]);
            });
        }
        return that;
    };

    Захотелось запихнуть всё в одну строку ) Вовремя остановился и переделал )

    SerDIDG, 28 Ноября 2013

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

    +161

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    $login = $_COOKIE['login'];
      $pass = $_COOKIE['pass'];
      $sec = $_COOKIE['sec'];
    
    
      if ($pass == '')
      {
        header("Location: index.php");
        exit;
      }

    Проверка авторизации в административной части сайта

    santa_microbe, 28 Ноября 2013

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