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

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

    +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
    template <typename type>
    class some
    {
    
      type val;
    public:
      some( const type &a ) : val(a)
      {  }
      template<typename t>
      some( const some<t> &a )
      {
        val = static_cast<type>(a.val);
      }
      template <typename type>
      friend class some; // иначе ошибка - нет доступа к приватному члену
    };

    Филосовский однако язык. Для того что бы все свои секреты нужно с самим собой подружиться...
    Сбрил усы - дружись с усатым...

    Enelar, 17 Августа 2011

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

    +169

    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
    // Конструктор
    [...]
    $this->Messages = array(
            1 => 'Card succesfull edited !',
            2 => 'Error, edited card !',
            3 => 'Was change succesfull.', // Тут индекс = 3
            4 => 'Was change succesfull.', // А тут = 4. Сечешь разницу?
            5 => 'Change status...',
            6 => 'Comment added succesful',
            7 => 'Comment expediated !', // Коммент ушел в экспедицию 
            8 => 'The card was droped succesgul.', // succesGul
            9 => 'Can\'t to delete this card.', // I don't to know php and to have no idea about english
            10 => 'Can\'t do upload file.',
            11 => 'File was uploaded successful.',
            12 => 'The eacuation was succesfull.', // Успешная эякуляция :O
            13 => 'Eacuation !' // Эякуляция !
        );
    [...]
    
    // Сохранение в базу
    // - Папа, папа, а SQL Injection существует? - Нет сынок..........
    $this->SUA_DB->query("INSERT INTO cards SET type='{$_POST['selector_type']}',name='{$_POST['card']}',user = '{$this->user_id}', description='{$_POST['descr']}', project='{$_POST['selector_project']}', category='{$_POST['selector_category']}' ") &
    $this->Msg->SetMsg (vsprintf($this->Messages[7],$_POST['card'])) :
    $this->Msg->SetMsg ($this->Messages[6]) &
    $this->Msg->SetError(true);
    // Из область фантастики

    Сказали чинить код парня которого недавно уволили... Пришлось переписать все заново.

    Особенно понравившиеся строки прокомментировал

    cephuo, 17 Августа 2011

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

    +143

    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
    public string IsLarge
            {
                get
                {
                    return (txtValue.Style["width"] == "150px").ToString();
                }
                set
                {
                    if (value == true.ToString())
                    {
                        txtValue.Style["width"] = "150px";
                    }
                    else
                    {
                        txtValue.Style["width"] = "65px";
                    }
                }
            }

    Свойство из одного эпического веб-проекта

    daymansiege, 10 Августа 2011

    Комментарии (11)
  5. JavaScript / Говнокод #7475

    +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
    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
    datatypes.Float = function(inString)
    {
    	var fBytes = [];
    	for (var i=0;i<4;i++)
    	{
    		var curByte = (inString.charCodeAt(i)&255).toString(2);
    		var byteLen = curByte.length;
    		if (byteLen<8)
    		{
    			for (var bit=0;bit<(8-byteLen);bit++)
    				curByte = '0'+curByte;
    		}
    		fBytes[i] = curByte;
    	}
    	var fBits = fBytes[3]+fBytes[2]+fBytes[1]+fBytes[0];
    	var fSign = parseInt(fBits[0]) ? -1 : 1;
    	var fExp = parseInt(fBits.substring(1,9),2)-127;
    	var fMan;
    	if (fExp == -127)
    		fMan = 0;
    	else
    	{
    		fMan = 1;
    		for (i=0;i<23;i++)
    		{
    			if (parseInt(fBits[9+i])==1)
    				fMan = fMan + 1/Math.pow(2,i+1);
    		}
    		fMan = fMan.toFixed(7);
    	}
    	return(parseFloat((fSign*Math.pow(2,fExp)*fMan).toFixed(3)));
    }

    Вчера накодил, оцените говнистость.

    SiPlus, 06 Августа 2011

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

    +102

    1. 1
    org.quartz.jobStore.dontSetAutoCommitFalse=true

    config boolshit

    3.14159265, 06 Августа 2011

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

    +150

    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 Point(){
    	this.x = 0;
    	this.y = 0;
    	if(arguments.length==2){				//if parameters are 2 points
    		this.x = arguments[0] || 0;
    		this.y = arguments[1] || 0;
    	}else
    		if(arguments.length==1){			//if parameter is a point object
    			this.x = arguments[0].x;
    			this.y = arguments[0].y;
    		}
    };

    yahoo, 05 Августа 2011

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

    +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
    String classToType(Class cls) {
        if (cls == Point.class) {
          return "int2";
        } else if ((cls == Integer.TYPE) || (cls == Integer.class)) {
          return "int";
        } else if ((cls == Double.TYPE) || (cls == Double.class)) {
          return "double";
        } else if (cls == String.class) {
          return "String";
        } else if ((cls == Boolean.TYPE) || (cls == Boolean.class)) {
          return "boolean";
        } else {
          return null;
        }
      }

    Lure Of Chaos, 04 Августа 2011

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

    +164

    1. 1
    define('htmlFORM_DOMAIN', '/\w*\.\w*\.*\w*\.*\w*\.*\w*\.*\w*\.*\w*\.*\w*\.*/'); // CRAzY ;)

    тяжёлое утро, PHP лишился parse_url()

    roysa, 01 Августа 2011

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

    +147

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    more: function()
            {
                redactorActive = this;
                var mre = '<more>';
                redactorActive.execCommand('inserthtml', mre, false);
    			this.modalClose();
            }

    WYSIWYG редактор ...

    maeln0r, 29 Июля 2011

    Комментарии (11)
  11. Java / Говнокод #7373

    +147

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    /*
    org.springframework.aop.framework
    Class AbstractSingletonProxyFactoryBean
    
    Convenient proxy factory bean superclass for proxy factory beans that create only singletons. 
    */
    
    public abstract class AbstractSingletonProxyFactoryBean
    extends ProxyConfig
    implements FactoryBean, BeanClassLoaderAware, InitializingBean

    http://static.springsource.org/spring/docs/2.0.x/api/org/springframework/aop/framework/AbstractSingletonProxyFactoryBean.html
    Convenient proxy factory bean superclass for proxy factory beans that create only singletons. And we need to go deeper...

    zheka, 28 Июля 2011

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