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

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

    +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
    function main() {
        let c = 0;
    
        try {
            c++;
            print("try");
            throw "except";
            c--;
            print("after catch");
        } finally {
            c++;
            print("finally");
        }
    
        assert(2 == c);
    }

    ну вот и все... проимплементил последний keyword в языке... (осталось только темплейты - ну и головняк меня ждем)

    ASD_77, 29 Сентября 2021

    Комментарии (16)
  3. Pascal / Говнокод #27689

    +1

    1. 1
    2. 2
    3. 3
    Ой, девачьки, я 5 лет не заходило. Почему нет говнокодов на Дульфи? Я десять страниц промотал! Неужели все дульфисты впали 
    в старческий маразм и не могут больше срать на этом недоязыке? Почему? Он же изначально создавался для даунов.
    Что стало с Тарасом? Что стало с поняшей-ассемблеристом?

    Только одфаги меня вспомнят.

    DelphiGovno, 28 Сентября 2021

    Комментарии (96)
  4. JavaScript / Говнокод #27688

    +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
    alex@ASD-PC:~/TypeScriptCompiler/3rdParty/llvm-wasm/debug/bin$ node mlir-translate.js --help
    OVERVIEW: MLIR Translation Testing Tool
    USAGE: mlir-translate.js [options] <input file>
    
    OPTIONS:
    
    Color Options:
    
      --color                                              - Use colors in output (default=autodetect)
    
    General options:
    
      --dot-cfg-mssa=<file name for generated dot file>    - file name for generated dot file
      --mlir-disable-threading                             - Disabling multi-threading within MLIR
      --mlir-elide-elementsattrs-if-larger=<uint>          - Elide ElementsAttrs with "..." that have more elements than the given upper limit
      --mlir-pretty-debuginfo                              - Print pretty debug info in MLIR output
      --mlir-print-debuginfo                               - Print debug info in MLIR output
      --mlir-print-elementsattrs-with-hex-if-larger=<long> - Print DenseElementsAttrs with a hex string that have more elements than the given upper limit (use -1 to disable)
      --mlir-print-op-on-diagnostic                        - When a diagnostic is emitted on an operation, also print the operation as an attached note
      --mlir-print-stacktrace-on-diagnostic                - When a diagnostic is emitted, also print the stack trace as an attached note
      -o=<filename>                                        - Output filename
      --split-input-file                                   - Split the input file into pieces and process each chunk independently
      Translation to perform
          --deserialize-spirv                                 - deserialize-spirv
          --import-llvm                                       - import-llvm
          --mlir-to-llvmir                                    - mlir-to-llvmir
          --serialize-spirv                                   - serialize-spirv
          --test-spirv-roundtrip                              - test-spirv-roundtrip
          --test-spirv-roundtrip-debug                        - test-spirv-roundtrip-debug
      --verify-diagnostics                                 - Check that emitted diagnostics match expected-* lines on the corresponding line
    
    Generic Options:
    
      --help                                               - Display available options (--help-hidden for more)
      --help-list                                          - Display list of available options (--help-list-hidden for more)
      --version                                            - Display the version of this program
    program exited (with status: 0), but EXIT_RUNTIME is not set, so halting execution but not exiting the runtime or preventing further async execution (build with EXIT_RUNTIME=1, if you want a true shutdown)
    alex@ASD-PC:~/TypeScriptCompiler/3rdParty/llvm-wasm/debug/bin$

    сказ о том как я LLVM на WASM компилял :)

    ASD_77, 28 Сентября 2021

    Комментарии (21)
  5. Куча / Говнокод #27682

    +1

    1. 1
    Давайте займёмся анальным сексом.

    .

    pdro11, 26 Сентября 2021

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

    +1

    1. 1
    for (double x = xn, p = 1, n = 0, y = 0; x > xk ? cout<<p<<' '<<n, false : true; x += dx, y = cos(x) + x*5. / 2, y > 0 ? p *= y : y < 0 ? n++ : n );

    Попросили помочь с задачей:
    > Определить произведение негативных и количество позитивных значений функции y=cos(x)+x*5./2, если значение x изменяется от xn до xk с шагом dx.
    Я постарался, как мог, всё-таки язык мне не очень близок (немного помогли). Возможно, ещё есть, куда "улучшить".

    MetallDoctor, 23 Сентября 2021

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

    +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
    private void LoadControlFile()
    {
        this.OFD2.Title = "Open an ORYZA Run Control File";
        this.OFD2.Filter = "Text Files|*.*";
        this.OFD2.ShowDialog();
        string path = this.OFD2.FileName.Trim();
        if (Path.GetExtension(path).ToUpper() != ".EXE")
        {
            this.TextBox2.Text = path;
        }
        else
        {
            string text = "Loading file is not a text file, RETRY!";
            MessageBox.Show(text, "Important Note", MessageBoxButtons.OK);
        }
    }

    Филипинская прога на Win Forms. Проверка на то что входной файл не исполняемый, а текстовый.

    contemporary_rapist, 17 Сентября 2021

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

    +1

    1. 1
    $bIsExpressDelivery = !empty($arDeliveryTariff["UF_EXPRESS_DELIVERY"]) ? true : false;

    Чтобы наверняка true или наверняка false...

    alexxrin, 11 Сентября 2021

    Комментарии (5)
  9. Куча / Говнокод #27643

    +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
    public class RegLocalityPK
      implements Serializable
    {
      private String countryNo;
      private String govNo;
      private String localityNo;
      
      public String getGovNo()
      {
        return this.govNo;
      }
      …

    IIIyqpymuHckuu_nemyx, 03 Сентября 2021

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

    +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
    49. 49
    50. 50
    51. 51
    52. 52
    53. 53
    54. 54
    55. 55
    56. 56
    57. 57
    58. 58
    59. 59
    60. 60
    61. 61
    62. 62
    63. 63
    64. 64
    65. 65
    66. 66
    67. 67
    68. 68
    69. 69
    70. 70
    71. 71
    72. 72
    73. 73
    74. 74
    75. 75
    76. 76
    77. 77
    78. 78
    79. 79
    80. 80
    81. 81
    82. 82
    83. 83
    84. 84
    85. 85
    86. 86
    87. 87
    88. 88
    package com.javarush.task.task10.task1013;
    
    /* 
    Конструкторы класса Human
    */
    
    public class Solution {
        public static void main(String[] args) {
        }
    
        public static class Human {
            // Напишите тут ваши переменные и конструкторы
            private String name;
            private int age;
            private int height;
            private String profession;
            private String sex;
            private String citizen;
    
            public Human(String name, int huy) {
                this.name = name;
                huy = huy;
            }
    
            public Human(String name, int huy, int pizda) {
                this.name = name;
                huy = huy;
                pizda = pizda;
            }
    
            public Human(String name) {
                this.name = name;
            }
    
            public Human(String name, int age, String sex) {
                this.name = name;
                this.age = age;
                this.sex = sex;
    
            }
    
            public Human(String name, int age, String sex, String profession) {
                this.name = name;
                this.age = age;
                this.sex = sex;
                this.profession = profession;
    
            }
    
            public Human(String name, int age, String sex, String profession, String citizen) {
                this.name = name;
                this.age = age;
                this.sex = sex;
                this.profession = profession;
                this.citizen = citizen;
    
            }
    
            public Human(String name, int age, int height, String sex, String profession, String citizen) {
                this.name = name;
                this.age = age;
                this.height = height;
                this.sex = sex;
                this.profession = profession;
                this.citizen = citizen;
    
            }
    
            public Human(String name, int age, int height, String sex, String profession, String citizen, boolean pidor) {
                this.name = name;
                this.age = age;
                this.height = height;
                this.sex = sex;
                this.profession = profession;
                this.citizen = citizen;
                pidor = pidor;
    
            }
    
            public Human(String name, int age, int height, String sex, String profession, String citizen, boolean pidor, boolean govno) {
                this.name = name;
                this.age = age;
                this.height = height;
                this.sex = sex;
                this.profession = profession;
                this.citizen = citizen;
                pidor = pidor;
                govno = govno;

    IIIyqpymuHckuu_nemyx, 03 Сентября 2021

    Комментарии (22)
  11. Си / Говнокод #27641

    +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
    49. 49
    50. 50
    51. 51
    52. 52
    53. 53
    54. 54
    55. 55
    56. 56
    57. 57
    58. 58
    59. 59
    60. 60
    61. 61
    62. 62
    63. 63
    64. 64
    65. 65
    66. 66
    67. 67
    68. 68
    69. 69
    70. 70
    71. 71
    72. 72
    73. 73
    74. 74
    75. 75
    76. 76
    77. 77
    78. 78
    79. 79
    80. 80
    81. 81
    82. 82
    83. 83
    84. 84
    85. 85
    86. 86
    87. 87
    88. 88
    // https://github.com/layerfsd/WorkPlatForm/blob/f14a8cdd2bc3772ea4bd37a0381f5f8305a0a2c2/Common/BuilDefine.h
    
    // source file build_defs.h
    
    #ifndef BUILD_DEFS_H
    
    #define BUILD_DEFS_H
    
    #define VERSION_MAJOR 1
    // Example of __DATE__ string: "Jul 27 2012"
    //                              01234567890
    
    #define BUILD_YEAR_CH0 (__DATE__[ 7])
    #define BUILD_YEAR_CH1 (__DATE__[ 8])
    #define BUILD_YEAR_CH2 (__DATE__[ 9])
    #define BUILD_YEAR_CH3 (__DATE__[10])
    
    
    #define BUILD_MONTH_IS_JAN (__DATE__[0] == 'J' && __DATE__[1] == 'a' && __DATE__[2] == 'n')
    #define BUILD_MONTH_IS_FEB (__DATE__[0] == 'F')
    #define BUILD_MONTH_IS_MAR (__DATE__[0] == 'M' && __DATE__[1] == 'a' && __DATE__[2] == 'r')
    #define BUILD_MONTH_IS_APR (__DATE__[0] == 'A' && __DATE__[1] == 'p')
    #define BUILD_MONTH_IS_MAY (__DATE__[0] == 'M' && __DATE__[1] == 'a' && __DATE__[2] == 'y')
    #define BUILD_MONTH_IS_JUN (__DATE__[0] == 'J' && __DATE__[1] == 'u' && __DATE__[2] == 'n')
    #define BUILD_MONTH_IS_JUL (__DATE__[0] == 'J' && __DATE__[1] == 'u' && __DATE__[2] == 'l')
    #define BUILD_MONTH_IS_AUG (__DATE__[0] == 'A' && __DATE__[1] == 'u')
    #define BUILD_MONTH_IS_SEP (__DATE__[0] == 'S')
    #define BUILD_MONTH_IS_OCT (__DATE__[0] == 'O')
    #define BUILD_MONTH_IS_NOV (__DATE__[0] == 'N')
    #define BUILD_MONTH_IS_DEC (__DATE__[0] == 'D')
    
    
    #define BUILD_MONTH_CH0 \
    	((BUILD_MONTH_IS_OCT || BUILD_MONTH_IS_NOV || BUILD_MONTH_IS_DEC) ? '1' : '0')
    
    #define BUILD_MONTH_CH1 \
    	( \
    	(BUILD_MONTH_IS_JAN) ? '1' : \
    	(BUILD_MONTH_IS_FEB) ? '2' : \
    	(BUILD_MONTH_IS_MAR) ? '3' : \
    	(BUILD_MONTH_IS_APR) ? '4' : \
    	(BUILD_MONTH_IS_MAY) ? '5' : \
    	(BUILD_MONTH_IS_JUN) ? '6' : \
    	(BUILD_MONTH_IS_JUL) ? '7' : \
    	(BUILD_MONTH_IS_AUG) ? '8' : \
    	(BUILD_MONTH_IS_SEP) ? '9' : \
    	(BUILD_MONTH_IS_OCT) ? '0' : \
    	(BUILD_MONTH_IS_NOV) ? '1' : \
    	(BUILD_MONTH_IS_DEC) ? '2' : \
    	/* error default */    '?' \
    	)
    
    #define BUILD_DAY_CH0 ((__DATE__[4] >= '0') ? (__DATE__[4]) : '0')
    #define BUILD_DAY_CH1 (__DATE__[ 5])
    
    
    #define BUILD_HOUR_CH0 (__TIME__[0])
    #define BUILD_HOUR_CH1 (__TIME__[1])
    
    #define BUILD_MIN_CH0 (__TIME__[3])
    #define BUILD_MIN_CH1 (__TIME__[4])
    
    #define BUILD_SEC_CH0 (__TIME__[6])
    #define BUILD_SEC_CH1 (__TIME__[7])
    
    
    #if VERSION_MAJOR > 100
    
    #define VERSION_MAJOR_INIT \
    	((VERSION_MAJOR / 100) + '0'), \
    	(((VERSION_MAJOR % 100) / 10) + '0'), \
    	((VERSION_MAJOR % 10) + '0')
    
    #elif VERSION_MAJOR > 10
    
    #define VERSION_MAJOR_INIT \
    	((VERSION_MAJOR / 10) + '0'), \
    	((VERSION_MAJOR % 10) + '0')
    
    #else
    
    #define VERSION_MAJOR_INIT \
    	(VERSION_MAJOR + '0')
    
    #endif
    
    
    #endif // BUILD_DEFS_H

    Генерация даты через разковыривание макроса __DATE__

    j123123, 03 Сентября 2021

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