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

    В номинации:
    За время:
  2. Куча / Говнокод #24583

    0

    1. 1
    2. 2
    3. 3
    4. 4
    https://skillbox.ru/php/
    
    Насчёт двенадцати месяцев этих доморощенных учителей занесло на повороте. Если отбросить всякую поеботню вроде ООП, "Laravel" и "Git", "PHP" можно выучить менее, чем за полгода.
    Да и нехуй им за что-то там платить - всё можно найти в бумажных учебниках и в Интернете.

    HighVoltageDick, 05 Августа 2018

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

    −3

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    #include <iostream>
    using namespace std;
    
    void wtf() {
     return 0;
    }
    int main() {
     return wtf();
     cout << wtf();
    }

    Решил нопейсать ватафак-код.
    Классика жанра. Ретурн в воидовской функции. Плюс действие после ретурна.

    shite, 03 Августа 2018

    Комментарии (47)
  4. Swift / Говнокод #23907

    +1

    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
    44. 44
    45. 45
    46. 46
    47. 47
    48. 48
    protocol Multi {
        associatedtype T
        associatedtype U
    
        func printSelf()
    }
    
    extension Multi where T == Int, U == Float {
        func printSelf() {
            print("Int & Float!")
        }
    }
    
    extension Multi where T == String, U == Int {
        func printSelf() {
            print("String & Int!")
        }
    }
    
    extension Multi {
        func printSelf() {
            print("Unknown")
        }
    }
    
    class MultiImplementationIntFloat: Multi {
        typealias T = Int
        typealias U = Float
    }
    
    class MultiImplementationStringInt: Multi {
        typealias T = String
        typealias U = Int
    }
    
    class MultiImplementationInvalid: Multi {
        typealias T = Float
        typealias U = String
    }
    
    let m1 = MultiImplementationIntFloat()
    m1.printSelf()
    
    let m2 = MultiImplementationStringInt()
    m2.printSelf()
    
    let m3 = MultiImplementationInvalid()
    m3.printSelf()

    Multimethods в Swift с проверкой в compile-time

    Desktop, 10 Марта 2018

    Комментарии (47)
  5. Си / Говнокод #23702

    0

    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
    #include <stdio.h>
    #include <string.h>
    #include <math.h>
    
    char *questions[] = {
        "Answer these questions please.",
        "I am HACTEHbKA. Do you know about me?",
        "Do you like my love stories?",
        "By the way, what is your name?",
        "Do you like C++?",
        "Do you like bormand?",
        "bormand is cool, isn't he?",
        "Do you know what does it mean?",
        0,
    };
    
    int main () {
        char answer[10], **question = questions, z[30] = {0}, Z = questions[0x04][0x10];
        
        while (*++question) {
            float x = 1, y = 7;
            char* a = answer;
            puts(*question);
            gets(answer);
            while (*a) {
                x *= 10;
                x += *a / 90;
                a ++;
            }
            y = (9/x - 120)/x/x/x;
            if (y > 170/x - 1263 - 437/x/x) {
                int U = **questions;
                for (U = 1/(x+1); U < ' '; U += 0x10) {
                    float bormand = 9*y-6*x*sqrt(y)-6*sqrt(y)+1.0*x*x*x*x-5.2*x*x*x+11.14*x*x-6.788*x+6;
                    z[Z|U] = questions[5-U/5+1/(int)bormand][(int)(Z + questions[0x06][0x10] / 2.6)];
                    if ((Z|U|7) * (int)question[1] < 30) puts(z + U);
                }
                Z++;
            }
        }
        
        return answer == questions[1];
    }

    https://ideone.com/zDcuG2

    HACTEHbKA, 03 Февраля 2018

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

    0

    1. 1
    2. 2
    Признавайтесь
    http://bash.im/quote/448842

    Недавно насрал туда анекдотом http://bash.im/quote/448781, зашёл покармадрочить, смотрю -- в стоке гк.

    vistefan, 31 Января 2018

    Комментарии (47)
  7. 1C / Говнокод #21762

    −104

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    //-------------------------------------
    Процедура ПриНачалеРаботыСистемы()    
    
    	//Ограничиваем цикл на пользователей...
    	Если (СокрЛП(ИмяПользователя())="Вася") тогда
    		//Делаем вызов процедуры "Оповещение" раз в 3600 секунд (1 час)...
    		ОбработкаОжидания("Оповещение",3600); 
    	КонецЕсли;
    	
    КонецПроцедуры

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

    Anonizmus, 01 Декабря 2016

    Комментарии (47)
  8. C++ / Говнокод #20409

    +3

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    #include <windows.h>
    int main() {
    	HDC dc = CreateCompatibleDC (NULL);
    	SetLayout (dc, LAYOUT_RTL);
    	ScaleWindowExtEx (dc, -2147483647 - 1, -1, 1, 1, NULL);
    }

    bsod

    laMer007, 22 Июля 2016

    Комментарии (47)
  9. C# / Говнокод #19174

    +8

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    public static class StringExtensions
        {
            public static bool IsNulldOrEmpty(this string str)
            {
                return string.IsNullOrEmpty(str);
            }
        }

    why

    antoanelenkov, 12 Декабря 2015

    Комментарии (47)
  10. Куча / Говнокод #19072

    +5

    1. 1
    2. 2
    WCT воскрес.
    http://habrahabr.ru/post/271519/

    Abbath, 24 Ноября 2015

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

    +142

    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
    void BloomPattern::process(GLuint rectangleVao, float blurRadius) const
    {
       sptrFrameBufferTwo->enable();
       glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
       sptrBrightPassShaderProgram->enable();
       glActiveTexture(GL_TEXTURE0);
       glBindTexture(GL_TEXTURE_2D, sptrFrameBufferThree->getColorTexture().getTexture());
       sptrBrightPassShaderProgram->setUniform("colorTexture", 0);
       glBindVertexArray(rectangleVao);
       glViewport(0, 0, windowWidth >> 1, windowHeight >> 1);
       glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_SHORT, nullptr);
       sptrFrameBufferOne->enable();
       glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
       sptrBlurShaderProgram->enable();
       glBindTexture(GL_TEXTURE_2D, sptrFrameBufferTwo->getColorTexture().getTexture());
       sptrBlurShaderProgram->setUniform("defaultTexture", 0);
       sptrBlurShaderProgram->setUniform("blurRadius", 1.0F / (windowWidth >> 1), 0.0F, blurRadius);
       glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_SHORT, nullptr);
       sptrFrameBufferTwo->enable();
       glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
       glBindTexture(GL_TEXTURE_2D, sptrFrameBufferOne->getColorTexture().getTexture());
       sptrBlurShaderProgram->setUniform("defaultTexture", 0);
       sptrBlurShaderProgram->setUniform("blurRadius", 0.0F, 1.0F / (windowHeight >> 1), blurRadius);
       glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_SHORT, nullptr);
       sptrFinalFrameBuffer->enable();
       glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
       sptrBloomShaderProgram->enable();
       glBindTexture(GL_TEXTURE_2D, sptrFrameBufferThree->getColorTexture().getTexture());
       glActiveTexture(GL_TEXTURE1);
       glBindTexture(GL_TEXTURE_2D, sptrFrameBufferTwo->getColorTexture().getTexture());
       sptrBloomShaderProgram->setUniform("defaultTexture", 0);
       sptrBloomShaderProgram->setUniform("brightpassTexture", 1);
       glViewport(0, 0, windowWidth, windowHeight);
       glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_SHORT, nullptr);
       glBindFramebuffer(GL_FRAMEBUFFER, 0);
    }

    jangolare, 07 Июля 2015

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