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

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

    +146

    1. 1
    ... document.write('<img src="' + src + '" alt="" width="1" height="1" style="display:none"/>');

    microsoft.com, 24 строчка

    necropedophag, 14 Января 2012

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

    +146

    1. 1
    <a class="postbtn_hide" href="#" onclick="javascript:toggleThread('75280'); return false;"></a>

    Вот такое вот говнецо от небезызвестной обезьяны.

    m1el, 14 Января 2012

    Комментарии (15)
  4. PHP / Говнокод #8861

    +146

    1. 1
    2. 2
    $xml = simplexml_load_file($url);
    	return($xml);

    это пиздец

    Sulik78, 18 Декабря 2011

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

    +146

    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
    class Car<T>{
        public T type;
        public String name;
        public int speed;
        public double price;
        private Car cr;
        public Car(Car cr){ this.cr=cr;}
        public Car(){ this.cr=new Car<T>(this);}
        public String toString(){
            return "type "+type+" name "+name;
        }
        public T toStringCar(){
            return (T) this.cr.toString();
        }
        public void printing(){
            Car cr1=this.cr;
            for(;;){
               cr1=cr1.cr;
               System.out.println(cr1);
               
            }
        }
    }
    public class HoldA<T> {
        private Car cr;
        public static void main(String[] str){
            HoldA<Car> c1=new HoldA<Car>(new Car<Double>());
            Tag ht1=HTML.getTag(null);
        }
    
        private HoldA(T car) {
            cr=(Car) car;
            cr.name="fluffy";
            cr.type=45.43;
            System.out.println(cr);
            System.out.println(cr.toStringCar());
            cr.printing();
        }
    }

    Просто так, код

    AliceGoth, 17 Декабря 2011

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

    +146

    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
    public ActionResult RenderDesigner()
    {
        // Get the received text
        var received = string.Empty;
        using(var reader = new StreamReader(Request.InputStream))
        {
            received = reader.ReadToEnd();
        }
    
        // Possible texts received
        var xml = "";
        var id = "";
        var moveId = "";
        int distance = 0;
        
        // Get all string from received
        var keys = received.Split('&');
        for (var i = 0; i < keys.Length; i++)
        {
            // XML
            if(keys[i].StartsWith("xml="))
            {
                xml = Server.UrlDecode(keys[i].Split('=')[1]);
            }
    
            // ID
            else if (keys[i].StartsWith("id="))
            {
                id = keys[i].Split('=')[1];
            }
            // Position
            else if (keys[i].StartsWith("distance="))
            {
                distance = int.Parse(keys[i].Split('=')[1]);
            }
    
            // Move ID
            else if (keys[i].StartsWith("moveId="))
            {
                moveId = keys[i].Split('=')[1];
            }
        }
    }

    разбор параметров POST запроса в стиле MVC

    Eugene, 15 Декабря 2011

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

    +146

    1. 1
    2. 2
    aWidth = Math.min(Math.max(thisText*5+80, 150), 350);
    aHeight = (thisText>610) ? 290 : (thisText>550) ? 270 : (thisText > 490) ? 250 : (thisText > 420) ? 230 : (thisText > 360) ? 210 : (thisText > 300) ? 190 : (thisText > 240) ? 170 : (thisText > 180) ? 150 : (thisText > 120) ? 130 : (thisText > 60)? 110 : 100;

    обнаружил у себя в проекте, оказывается взяли тут http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/212610

    andrewshca, 15 Декабря 2011

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

    +146

    1. 1
    http://chechnya.gov.ru/page.php?day=102&month=13&year=2222

    Ещё можете год убрать, и посмотрите как вывалится ошибка mktime()
    XDDD

    Мне кажется этот сайт по бумагам стоит не менее чем 1ккк руб.

    vkontakte, 13 Декабря 2011

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

    +146

    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
    if ($url=='/news/index.html')
    {
    	$data = $this->dbf->execute('select * from news where status=1 order by date_add desc,id desc limit 10');
    	$object->smarty->assign('news_body',$data);
    	$object->smarty->assign('title','Новости');
    } elseif(preg_match('@/news/([0-9]+?)/@i',$url,$out)){
    			$data = $this->dbf->execute('select * from news where status=1 and id='.intval($out[1]).' order by date_add desc limit 1');
    			$object->smarty->assign('news_body',$data);
    			$object->smarty->assign('title','Новости');			
    } elseif($url=='/search/') {
    	$data = array();
    			
    	if ($_POST['search']!='' && strlen($_POST['search'])>6)
    	{
    		$data = $this->dbf->execute('select * from pages where content like "%'.mysql_real_escape_string($_POST['search'],$this->dbh->conn).'%" limit 10');
    	}
    	$object->smarty->assign('search',$data);
    	$object->smarty->assign('title','Поиск');
    	$object->smarty->assign('news',$this->dbh->execute('select * from news where status=1 order by date_add desc limit 3'));
    			
    } else {
    	$data = $this->dbf->execute('select * from pages where link="'.mysql_real_escape_string($url,$this->dbh->conn).'"');
    	$this->data = $data[0];
    	$object->smarty->assign('title',$this->data['title']);
    	$object->smarty->assign('news',$this->dbh->execute('select * from news where status=1 order by date_add desc limit 3'));
    }

    laplay, 29 Ноября 2011

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

    +146

    1. 1
    2. 2
    3. 3
    public void info(String msg) {
    		info(true, msg);
    	}

    Crazy_penguin, 25 Ноября 2011

    Комментарии (12)
  11. Куча / Говнокод #8640

    +146

    1. 1
    <input type="submit" name="op" id="edit-submit-2" value="Поиск"  onmousedown="return!1" class="form-submit" />

    В первый раз вижу "return!1", я бы до такого не додумался... Неужели для экономии символов. Не совсем говнокод, но улыбку вызвало)

    alex322, 25 Ноября 2011

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