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

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

    +157

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    function writemsg(msg, colors)
    {
    	length = msg.length;
    	i=0;
    	while(i<length)
    	{
    		document.getElementById("msgbox").innerHTML = document.getElementById("msgbox").innerHTML + "<br><font color="+colors[i]+">"+msg[i]+"</font>";
    		i=i+1; //z
    	}
    	return true;
    }

    XyHb, 31 Июля 2010

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

    +169

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    public function Add()
    {
    $db->query ('DELETE FROM ' . $this->_table . ' WHERE clientId=' . $this->clientId . ' AND memberId=' . $this->userId);
    $db->query ('INSERT INTO ' . $this->_table . ' SET clientId=' . $this->clientId . ', memberId=' . $this->userId);
    return true;
    }

    без комментариев

    rtfm, 28 Июля 2010

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

    +147

    1. 1
    2. 2
    3. 3
    if(@$_GET['modul']=="logout"){
        //code
    }

    ленивый мудак

    sogekoder, 19 Июля 2010

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

    +159

    1. 1
    Boolean.prototype.toLocaleString = function () { return this; return this ? 'Yes' : 'No' }

    пукнул...

    bugmenot, 16 Июля 2010

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

    +158

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    Object.prototype.addEvent = function (type, handler) {
    	for (var i = 0; i < this.length; i++) {
    		this[i]['on' + type] += ';' + (handler + '').replace(/function.+?\{/, '').replace(/}$/, '');
    	}
    	return this;
    };

    eval, 16 Июля 2010

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

    +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
    Author: decker <decker@personal-army>  2010-06-19 05:39:42
    Committer: decker <decker@personal-army>  2010-06-19 05:39:42
    
        fix potential race in reservation id generation
    
    @@ -97,7 +98,7 @@ public class VmInstances extends AbstractNamedRegistry<VmInstance> {
         do {
           MessageDigest digest = Hashes.Digest.MD5.get();
           digest.reset();
    -      digest.update( Long.toString( rsvId + launchIndex + System.currentTimeMillis() ).getBytes() );
    +      digest.update( Long.toString( rsvId + launchIndex + System.nanoTime( ) ).getBytes() );
     
           Adler32 hash = new Adler32();
           hash.reset();

    Вот так суровые калифорнийцы сурово чинят race...

    raorn, 13 Июля 2010

    Комментарии (8)
  8. Ruby / Говнокод #3675

    −92

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    if html_content.product_id == 11 || html_content.product_id == 8 || html_content.product_id == 15 || html_content.product_id == 20 
      @terms_and_conditions = Page.find(212).contents
    else 
      @terms_and_conditions = Page.find(213).contents  
    end

    paveldruzyak, 09 Июля 2010

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

    +74

    1. 1
    2. 2
    3. 3
    public static int indexOf(String str, String... array) {
    		return ArrayUtils.indexOf(array, str);
    }

    cdf_easy, 07 Июля 2010

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

    +166

    1. 1
    2. 2
    3. 3
    function remove(e) {
    e.parentNode.innerHTML = e.parentNode.innerHTML.replace(e.outerHTML, '');
    }

    Кроссбраузерное удаление элемента из DOM.

    eval, 06 Июля 2010

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

    −179

    1. 1
    SELECT REPLACE(RTRIM(REPLACE(REPLACE(RTRIM(REPLACE(LTRIM('  850.0000'),'0',' ')),' ','0'),'.',' ')),' ','.')

    Совет, как убрать лишние нули после точки

    Back, 01 Июля 2010

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