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

    −98

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    ResetList( Chars( ) )
    While NextElement( Chars( ) )
    	Define Address.l = @Chars( )
    	Define Reference.s = Chars( )
    	While NextElement( Chars( ) )
    		If Chars( ) = Reference
    			DeleteElement( Chars( ) )
    		EndIf
    	Wend
    	ChangeCurrentElement( Chars( ), Address )
    Wend

    Stertor-, 01 Марта 2014

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

    +36

    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
    #include <iostream>
    
    class StaticClassData {
      int *pointer, value;
    
    public:
      StaticClassData(): pointer(&value) {}
      
      void add(int i) {
        std::cout << "Hello, this is " << this << std::endl;
        value = i;
        std::cout << "I'm fine" << std::endl;
        *pointer = i;
        std::cout << "You never read this text" << std::endl;
      }
    };
    
    class SomeClass {
      struct StaticConstructor {
        StaticConstructor(){ storage.add(1); }
      };
      
      static StaticConstructor constructor;
      static StaticClassData storage;
    };
    
    SomeClass::StaticConstructor SomeClass::constructor;
    StaticClassData SomeClass::storage;
    
    int main(){}

    Долго думал, с какого хрена программа падает на заполнении static поля в "статическом конструкторе". Поле вроде бы есть, но толку от этого мало.
    http://ideone.com/Ux14ep - из раздела ub.govnokod.ru или как выстрелить себе в ногу до выполнения main.

    1024--, 01 Марта 2014

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

    +141

    1. 1
    "C++" - говно для говна.

    Konardino, 28 Февраля 2014

    Комментарии (1)
  4. Куча / Говнокод #15256

    +86

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    load 'regex'
    f=: 13 : '((+./-.(1 2 3 4{y))+.(0{y))*.(5{y)'
    a =: #:i.2^6
    b =: f"(1) a
    cc =: ":|:(|:a),(|:b)
    cc1 =: (32+i.32){cc
    cc2 =: (i.32){cc
    ccc=:|:(|:cc2),(1 32$'*'),(|:cc1)
    ccc=:('\*';'&&') rxrplc"1 (ccc)
    (,&'\\ \hline')"1 (' ';' & ')rxrplc"1 (ccc)

    Вот он, первый говнокод на J

    Abbath, 28 Февраля 2014

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

    +131

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    9. 9
    private static List<XElement> processAccountWithAdress(List<Dictionary<string, object>> AccountWithAdress, OrganizationServiceProxy service)
    		{
    			foreach (Dictionary<string, object> item in AccountWithAdress)
    			{
    				try
    				{
    					var adressees = (from n in AccountWithAdress
    									 where n["accountid"].ToString() == item["accountid"].ToString()
    									 select n);

    Вот такой код продают некоторые Киевские ИТ компании....

    ychernobai, 28 Февраля 2014

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

    +67

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    public class LoaderForMongoCompanies extends AbstractJdbcLoader {
    
        @Override
        protected String getTableSuffix() {
            return "mongo";
        }
    
    }

    нужно больше классов

    roman-kashitsyn, 28 Февраля 2014

    Комментарии (38)
  7. Куча / Говнокод #15222

    +134

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    load 'regex'
    f=: 13 : '((+./-.(1 2 3 4{y))+.(0{y))*.(5{y)'
    a =: #:i.2^6
    b =: f"(1) a
    cc =: ":|:(|:a),(|:b)
    cc1 =: (32+i.32){cc
    cc2 =: (i.32){cc
    ccc=:|:(|:cc2),(1 32$'*'),(|:cc1)
    ccc=:('\*';'&&') rxrplc"1 (ccc)
    (,&'\\ \hline')"1 (' ';' & ')rxrplc"1 (ccc)

    Вот он, первый говнокод на J

    Abbath, 27 Февраля 2014

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

    +178

    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
    // Performance optimization: http://jsperf.com/apply-vs-call-vs-invoke
    switch (self ? -1 : args.length) {
        case  0: return fn();
        case  1: return fn(args[0]);
        case  2: return fn(args[0], args[1]);
        case  3: return fn(args[0], args[1], args[2]);
        case  4: return fn(args[0], args[1], args[2], args[3]);
        case  5: return fn(args[0], args[1], args[2], args[3], args[4]);
        case  6: return fn(args[0], args[1], args[2], args[3], args[4], args[5]);
        case  7: return fn(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
        case  8: return fn(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7]);
        case  9: return fn(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8]);
        case 10: return fn(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], args[9]);
        default: return fn.apply(self, args);
    }

    Привет от Angular!

    Данный фрагмент присутствовал в официальном коде фреймворка с первой stable-версии и был бесчеловечно вырезан буквально пару месяцев назад (с 1.2.5 релиза).

    https://ajax.googleapis.com/ajax/libs/angularjs/1.2.4/angular.js

    dhilt, 27 Февраля 2014

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

    +176

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    function convert_date($date) {
        $part_date = explode(" ", $date);
        $part_day = explode("-", $part_date[0]);
        $year = $part_day[0];
        $month = $part_day[1];
        $day = $part_day[2];
        $part_time = explode(":", $part_date[1]);
        $hour = $part_time[0];
        $min = $part_time[1];
        $result = $day . "." . $month . "." . $year;
        return $result;
    }

    Трудное решение легких проблем

    eugene111222, 27 Февраля 2014

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

    +175

    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
    $select_from = false;
    		if ($_GET['news_id']){
    			$this_id = (int)htmlspecialchars($_GET['news_id']);
    			$select_from = "news";
    		}
    		if ($_GET['article_id']){
    			$this_id = (int)htmlspecialchars($_GET['article_id']);
    			$select_from = "articles";
    		}
    		if ($_GET['articles_id']){
    			$this_id = (int)htmlspecialchars($_GET['articles_id']);
    			$select_from = "articles";
    		}
    		
    		$w = mysql_fetch_assoc(mysql_query("SELECT * FROM `".$getdata['pref'].$select_from."` WHERE `id` = \"{$this_id}\" LIMIT 1"));

    good_web_master, 27 Февраля 2014

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