1. JavaScript / Говнокод #3468

    +148

    1. 1
    2. 2
    3. 3
    if (browser.opera && browser.version < 10.50) {
              parent.innerHTML = parent.innerHTML;
            }

    http://vkontakte.ru/js/player.js?10 (c)

    Back, 13 Июня 2010

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

    +115

    1. 1
    <%=Convert.ToDateTime(item.CreatedOnDate).ToString("D", new System.Globalization.CultureInfo(System.Globalization.CultureInfo.CurrentCulture.ToString()))%>

    Кусок кода, который отображает некую дату

    phoenixx, 13 Июня 2010

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

    +152

    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
    typedef signed int s32;
    
    //...
    
    void SomeStruct::SomeFunc(const char* ipImageName /*, ... */ )
    {
    	// ...
    
    	s32 imageNameSize = strlen(ipImageName) * sizeof(char) + 1;
    	this->mpImageName = new char[imageNameSize];
    	strcpy(this->mpImageName, ipImageName);
    	
    	// ...
    }

    А теперь представим, что вместо char будет wchar_t... ...автор - лид-программист...

    Kirinyale, 13 Июня 2010

    Комментарии (128)
  4. Си / Говнокод #3465

    +144

    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
    typedef signed int s32;
    
    //...
    
    void SomeStruct::SomeFunc(const char* ipImageName /*, ... */ )
    {
    	// ...
    
    	s32 imageNameSize = strlen(ipImageName) * sizeof(char) + 1;
    	this->mpImageName = new char[imageNameSize];
    	strcpy(this->mpImageName, ipImageName);
    	
    	// ...
    }

    А теперь представим, что вместо char будет wchar_t... ...автор - лид-программист...

    Kirinyale, 13 Июня 2010

    Комментарии (19)
  5. SQL / Говнокод #3464

    −873

    1. 1
    SELECT users.nick,group.name FROM users,group WHERE user.id='$id' AND group.id=user.group;

    Это мой код. Мне сказали что это говнокод, и порекомендовали спросить здесь.
    В чём именно говнокодость, и как надо писать правильно?

    avamana, 13 Июня 2010

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

    +158

    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
    #include <math.h>
    #include <stdio.h>
    double zero = 0, three = 3, four = 4;
    class Complex
         {
            public:
            double &x, &y;
            Complex() : x(zero), y(zero) { }
            Complex( double &z ) : x(y), y(z) { }
            Complex( double &_x, double &_y ) : x(_x), y(_y) { }
         };
         double square( double const &x ) { return x * x; }
         double absValue( Complex &c ) { return sqrt( square(c.x)+square(c.y) ); }
         int main()
         {
             Complex c(four);
             printf( "absolute value is %g\n", absValue( c ) );
             return 0;
         }

    говно отсюда http://www.gimpel.com/html/bugs.htm

    xXx_totalwar, 13 Июня 2010

    Комментарии (13)
  7. PHP / Говнокод #3462

    +154

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    function nameFilter(str){
    
    		var re = /^(oxypit|Штемп|хуй|пиде|пидр|пидо|пида|гыы|Techn|PIZDA)/i
    		if (re.test(str)) return true; else return false;
    
    }

    hromjo, 12 Июня 2010

    Комментарии (24)
  8. VisualBasic / Говнокод #3461

    −98

    1. 1
    lDate = DateSerial(Year(Date), Month(Date), Day(Date) - Day(Date) + 1)

    Человек формирует дату - 1 число текущего месяца.
    В каком классе учат упрощать выражения вида х-х+у?

    govnobot, 11 Июня 2010

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

    +167

    1. 1
    2. 2
    3. 3
    4. 4
    $filename_enc = urlencode($link);
    header("Content-Type: application/octet-stream");
    header("Content-Disposition: attachment; filename=kino.css");
    echo(file_get_contents("ftp://127.0.0.1/pub/films/06/1096/01/1096_01_01.mkv"));

    symbix, 11 Июня 2010

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

    +184

    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
    function reverse_string(str, len) {
    	if (len == 1) {
    		return str.charAt(0);
    	}
    	if (len == 2) {
    		return str.charAt(1) + str.charAt(0);
    	}
    	if (len == 3) {
    		return str.charAt(2) + str.charAt(1) + str.charAt(0);
    	}
    	if (len == 4) {
    		return str.charAt(3) + str.charAt(2) + str.charAt(1) + str.charAt(0);
    	}
    	if (len == 5) {
    		return str.charAt(4) + str.charAt(3) + str.charAt(2) + str.charAt(1) + str.charAt(0);
    	}
    	if (len == 6) {
    		return str.charAt(5) + str.charAt(5) + str.charAt(3) + str.charAt(2) + str.charAt(1) + str.charAt(0);
    	}
    	if (len == 7) {
    		return str.charAt(6) + str.charAt(5) + str.charAt(4) + str.charAt(3) + str.charAt(2) + str.charAt(1) + str.charAt(0);
    	}
    	if (len == 8) {
    		return str.charAt(7) + str.charAt(6) + str.charAt(5) + str.charAt(4) + str.charAt(3) + str.charAt(2) + str.charAt(1) + str.charAt(0);
    	}
    	if (len == 9) {
    		return str.charAt(8) + str.charAt(7) + str.charAt(6) + str.charAt(5) + str.charAt(4) + str.charAt(3) + str.charAt(2) + str.charAt(1) + str.charAt(0);
    	}
    	if (len == 10) {
    		return str.charAt(9) + str.charAt(8) + str.charAt(7) + str.charAt(6) + str.charAt(5) + str.charAt(4) + str.charAt(3) + str.charAt(2) + str.charAt(1) + str.charAt(0);
    	}
    };

    Переворачивание строки при помощи новейших технологий. Также ожидается движок (по содержанию конечно кусок говна, но по размерам похож), который позволит переворачивать строки любой длины (таким же методом). В-общем, прогноз неутешительный.

    eval, 11 Июня 2010

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