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

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

    +46

    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
    public function getAddressInfo($address) {
    		if (!$address instanceof SalesOrderAddressShipping) return '';
    		
    		$country = $address->getCountry();
    		$region = $address->getRegion();
    		$city = $address->getCity();
    		$zipCode = $address->getZipCode();
    		$street = $address->getStreet();
    		$houseNumber = $address->getHouseNumber();
    		$building = $address->getBuilding();
    		$appartment = $address->getAppartment();
    
    		$addressInfo = '';
    		$addressInfo .= $city . ', ' . $street . ' ' . $houseNumber;
    		$addressInfo .= !empty($building) ? ', корп. ' . $building : '';
    		$addressInfo .= !empty($appartment) ? ', кв. ' . $appartment : '';
    
    		return $addressInfo;
    	}
    
    	public function getAddressInfoWithoutApartment($address) {
    		if (!$address instanceof SalesOrderAddressShipping) return '';
    
    		$country = $address->getCountry();
    		$region = $address->getRegion();
    		$city = $address->getCity();
    		$zipCode = $address->getZipCode();
    		$street = $address->getStreet();
    		$houseNumber = $address->getHouseNumber();
    		$building = $address->getBuilding();
    		$appartment = $address->getAppartment();
    
    		$addressInfo = '';
    		$addressInfo .= $city . ', ' . $street . ' ' . $houseNumber;
    		$addressInfo .= !empty($building) ? ', корп. ' . $building : '';
    		//$addressInfo .= !empty($appartment) ? ', кв. ' . $appartment : '';
    
    		return $addressInfo;
    	}

    а сам класс называется AdminOrderListContentView, ебиеговрот....

    SET, 31 Июля 2012

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

    +19

    1. 1
    delete this;

    Это написал гейдевщик.
    Но когда его спросили: "Почему? Зачем?"
    Он ответил: "Я создаю принципиально новую охретектуру движка. Это будет лучший двиг всех времен и народов."

    HaskellGovno, 28 Июля 2012

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

    +26

    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
    input >> heap;
    	while( heap[0] == '0' ) heap.erase( 0, 1 );
    
    	heaps.push_back( heap );
    
    	input >> heap;
    	while( heap[0] == '0' ) heap.erase( 0, 1 );
    
    	heaps.push_back( heap );
    
    	input >> heap;
    	while( heap[0] == '0' ) heap.erase( 0, 1 );
    
    	heaps.push_back( heap );

    Fai, 05 Июля 2012

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

    +167

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    $zfunctv=0;
    if ($zfunctv==1 || $zfunctv==2 || $zfunctv==3 || $zfunctv==4) require_once('function1.php');
    if ($zfunctv==2 || $zfunctv==3) require_once('function2.php');
    if ($zfunctv==3 || $zfunctv==4) require_once('function3.php');
    if ($zfunctv==''){
    	require_once('function1.php');//Для всех окон
    	require_once('function2.php');//Для полноразмерных окон
    	require_once('function3.php');//Для оборудования
    	require_once('admfunct.php');
    }

    Какого хрена? Как это работает?! Код коммерческой системы UserSide v2.48

    Neka, 13 Января 2012

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

    −122

    1. 1
    this.cutUnderLineAndG((this.getChildAt(bottomIndex.layer) as MovieClip).getChildAt(bottomIndex.child) as MovieClip, point1, point2, pointG, this.clothes[bottomIndex.layer][bottomIndex.child].colored_set[this.clothes[bottomIndex.layer][bottomIndex.child].currentColorVariant].variants[this.clothes[bottomIndex.layer][bottomIndex.child].currentWearVariant][this.currentView].arm_points_right, this.clothes[bottomIndex.layer][bottomIndex.child].colored_set[this.clothes[bottomIndex.layer][bottomIndex.child].currentColorVariant].variants[this.clothes[bottomIndex.layer][bottomIndex.child].currentWearVariant][this.currentView].arm_points_left);

    Нет слов...

    Z-13, 29 Ноября 2011

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

    +1020

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    #include <QtGui>
    #include <math.h>
    #include "scene3D.h"
    #include "glext.h"
    
    const GLfloat pi=3.141593, k=pi/180;

    http://www.gamedev.ru/code/articles/OpenGL_Qt4_part2 maximum omsk

    dos_, 20 Ноября 2011

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

    +94

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    @Override public int hashCode()
        {
            int hash = 7;
            return hash;
        }

    Ну это явно хит!

    dwinner, 06 Ноября 2011

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

    +77

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    try {
        order.setAddress(address.clone());
    } catch (CloneNotSupportedException e) {
        // We will not get here, because priorAddressDtoToAdd.address is of Address type.
        // Moreover - none of the subclasses throws this exception
        LOG.error("Address clone is not supported? Nonsense...", e);
    }

    Это было бы даже весело, если бы не повторялось вместе с коментами 3 раза в одном классе.

    roman-kashitsyn, 22 Сентября 2011

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

    +177

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    int arr[100][100];
    
    for (int i = 0; i < 100; i++) {
       for (int j = 0; j < 100; j++) {
           if (i == j) arr[i][j] = 0;
       }
    }

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

    sotlef, 25 Июля 2011

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

    +153

    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(FirstDot == 0 && LastDot == 0)
    			NoDots = true;
    		else
    			if(FirstDot != 0 && LastDot == 0)
    				throw gcnew System::Exception("Левый коррелятор начал работу, правый - нет.");
    			else
    				if(FirstDot == 0 && LastDot != 0)
    					throw gcnew System::Exception("Правый коррелятор начал работу, левый - нет.");
    				else
    					if(FirstDot != 0 && LastDot != 0)
    						if(FirstDot == LastDot)
    							NoDots = true;
    						else
    							NoDots = false;
    					else
    						throw gcnew System::Exception("WTF?");

    Нужно определить, есть на графике точки или нет. Человек решил подстраховаться и рассмотреть все возможные (и невозможные) варианты.

    ScumCoder, 19 Июня 2011

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