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

    В номинации:
    За время:
  2. Куча / Говнокод #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)
  3. Си / Говнокод #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)
  4. Куча / Говнокод #27638

    +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
    89. 89
    90. 90
    91. 91
    92. 92
    93. 93
    .chamfer { 
      display: table;
      border-collapse: separate;
      empty-cells: show;
      background: transparent;
      display: inline-block;
      margin-bottom: 25px;
      margin-right: 25px;
      vertical-align: top;}
    .chamfer .row { 
      display: table-row;}
    .chamfer .boxcontent {
      display: table-cell;
      background: #FFFFFF;
      font-size: 24px;
      vertical-align: middle;
      min-width: 200px;
      width: 200px;
      height: 173px;}
    .chamfer .transparentbox {
      display: table-cell; 
      background: transparent;
      font-size: 24px;
      vertical-align: middle;
      min-width: 200px;
      width: 200px;}
    .chamfer .row .north-west { 
      display: table-cell;
      border: 100px solid transparent;
      border-top-width: 0px;
      border-right-width: 0px;
      border-bottom: 173px solid #FFF;
      width: 0px;}
    .chamfer .row .north-east { 
      display: table-cell;
      border: 100px solid transparent;
      border-top-width: 0px;
      border-left-width: 0px;
      border-bottom: 173px solid #FFF;
      width: 0px;}
    .chamfer .row .south-west { 
      display: table-cell;
      border: 100px solid transparent;
      border-bottom-width: 0px;
      border-right-width: 0px;
      border-top: 173px solid #FFF;
      width: 0px;}
    .chamfer .row .south-east { 
      display: table-cell;
      border: 100px solid transparent;
      border-bottom-width: 0px;
      border-left-width: 0px;
      border-top: 173px solid #FFF;
      width: 0px;}
    .chamfer .row3 .north-west { 
      border: 100px solid yellow;
      border-top-width: 0px;
      border-right-width: 0px;
      border-bottom: 173px solid red;}
    .chamfer .row3 .north-east { 
      border: 100px solid yellow;
      border-top-width: 0px;
      border-left-width: 0px;
      border-bottom: 173px solid red;}
    .chamfer .row2 .south-west { 
      border: 100px solid yellow;
      border-bottom-width: 0px;
      border-right-width: 0px;
      border-top: 173px solid #FFF;}
    .chamfer .row2 .south-east { 
      border: 100px solid yellow;
      border-bottom-width: 0px;
      border-left-width: 0px;
      border-top: 173px solid #FFF;}
    .chamfer .row4 .south-west { 
      border: 100px solid transparent;
      border-bottom-width: 0px;
      border-right-width: 0px;
      border-top: 173px solid red;}
    .chamfer .row4 .south-east { 
      border: 100px solid transparent;
      border-bottom-width: 0px;
      border-left-width: 0px;
      border-top: 173px solid red;}
    .chamfer .row2 .transparentbox, .chamfer .row3 .transparentbox {
      background: yellow;
      height: 173px;}
    .chamfer .row3 .boxcontent, .chamfer .row4 .boxcontent {
      background: red;
      height: 173px;}
    body { 
      color: #3B3A37;
      background-color: olive;}

    Реальный пример шестиугольных блоков (в виде сот) на чистом CSS2.

    Страница в действии:
    https://output.jsbin.com/xewelufoda/

    CEHT9I6PbCKuu_nemyx, 01 Сентября 2021

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

    +1

    1. 1
    https://journal.tinkoff.ru/diary-it-zhena-ekb/

    Хорошо устроилась

    3_dar, 01 Сентября 2021

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

    +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
    https://benchmarksgame-team.pages.debian.net/benchmarksgame/performance/pidigits.html
    
    1.0 	C gcc #6	0.59 	2,444 	1090 	2.37 	100% 100% 100% 98%
    1.1 	C++ g++ #6	0.66 	5,152 	986 	2.63 	100% 100% 100% 100%
    1.2 	Rust #4	 	0.71 	2,672 	799 	0.73 	3% 0% 0% 100% 
    1.2 	Free Pascal #3	0.73 	2,268 	530 	0.73 	0% 0% 100% 0%
    1.4 	F# .NET #6	0.82 	34,428 	905 	0.83 	1% 2% 96% 1%
    1.4 	Haskell GHC #5	0.83 	6,056 	928 	0.84 	0% 99% 1% 1%
    1.5 	Ada 2012 GNAT   0.88 	4,704 	1130 	0.89 	0% 0% 100% 1%
    1.5 	Rust #2	 	0.88 	2,800 	1306 	0.89 	0% 1% 100% 0%
    1.5 	C++ g++ #4	0.89 	4,280 	513 	0.92 	0% 2% 1% 100%
    1.5 	OCaml #7	0.89 	5,968 	593 	0.90 	0% 0% 1% 100%
    1.5 	Swift #2	0.89 	9,256 	600 	0.91 	3% 0% 0% 99%
    1.5 	PHP #5	  	0.91 	13,196 	399 	0.96 	2% 0% 3% 100%
    1.5 	C# .NET #5	0.92 	35,404 	977 	0.96 	98% 3% 2% 1%
    1.6 	Java  #3	0.93 	36,552 	764 	0.98 	2% 3% 1% 99%

    However, Java is one of the fastest and most energy-efficient object-oriented language. Interpreted languages like Perl, Python, and Ruby were among the least energy efficient

    Using the Computer Benchmarks Game, the team of researchers tested these languages by compiling/executing such programs using the state-of-the-art compilers, virtual machines, interpreters, and libraries.

    They then analyzed the performance of the different implementation considering three variables: execution time, memory consumption and energy consumption.

    https://jaxenter.com/energy-efficient-programming-languages-137264.html

    https://jaxenter.com/wp-content/uploads/2017/09/energy-efficient-languages-768x689.png

    https://jaxenter.com/wp-content/uploads/2017/09/energy-efficient-languages-2-768x368.png

    3.14159265, 31 Августа 2021

    Комментарии (43)
  7. Си / Говнокод #27629

    +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
    // https://github.com/mailru/confetti/blob/63ed82c65a7fbcd2baf8a67f1b7410e044dfd1dd/h_dump.c#L44
    
    static void
    dumpParamDef(FILE *fh, char* name, ParamDef *def) {
    	
    	dumpComment(fh, def, 1);
    	
    	switch(def->paramType) {
    		case	int32Type:
    			fprintf(fh, "\tint32_t\t%s;\n", def->name);
    			break;
    		case	uint32Type:
    			fprintf(fh, "\tu_int32_t\t%s;\n", def->name);
    			break;
    		case	int64Type:
    			fprintf(fh, "\tint64_t\t%s;\n", def->name);
    			break;
    		case	uint64Type:
    			fprintf(fh, "\tu_int64_t\t%s;\n", def->name);
    			break;
    		case	doubleType:
    			fprintf(fh, "\tdouble\t%s;\n", def->name);
    			break;
    		case	stringType:
    			fprintf(fh, "\tchar*\t%s;\n", def->name);
    			break;
    		case	boolType:
    			fprintf(fh, "\tconfetti_bool_t\t%s;\n", def->name);
    			break;
    		case	commentType:
    			fprintf(stderr, "Unexpected comment"); 
    			break;
    		case	structType:
    			fprintf(fh, "\t%s", name);
    			dumpStructName(fh, def->paramValue.structval, "_");
    			fprintf(fh, "*\t%s;\n", def->name);
    			break;
    		case	arrayType:
    			fprintf(fh, "\t%s", name);
    			dumpStructName(fh, def->paramValue.arrayval->paramValue.structval, "_");
    			fprintf(fh, "**\t%s;\n", def->name);
    			break;
    		case 	builtinType:
    			break;
    		default:
    			fprintf(stderr,"Unknown paramType (%d)\n", def->paramType);
    			exit(1);
    	}
    }

    Какое же говно эта ваша сишка. А в крестоговне эта задача легко и элегантно решается, правда ведь?

    j123123, 30 Августа 2021

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

    +1

    1. 1
    Тестовый Оффтоп #4

    #1: https://govnokod.ru/26373 https://govnokod.xyz/_26373
    #1: https://govnokod.ru/26611 https://govnokod.xyz/_26611
    #1: https://govnokod.ru/26824 https://govnokod.xyz/_26824
    #1: https://govnokod.ru/26850 https://govnokod.xyz/_26850
    #2: https://govnokod.ru/27102 https://govnokod.xyz/_27102
    #3: https://govnokod.ru/27523 https://govnokod.xyz/_27523

    IIIyqpymuHckuu_nemyx, 29 Августа 2021

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

    +1

    1. 1
    Питушня #19

    #1: https://govnokod.ru/26692 https://govnokod.xyz/_26692
    #2: https://govnokod.ru/26891 https://govnokod.xyz/_26891
    #3: https://govnokod.ru/26893 https://govnokod.xyz/_26893
    #4: https://govnokod.ru/26935 https://govnokod.xyz/_26935
    #5: (vanished) https://govnokod.xyz/_26954
    #6: (vanished) https://govnokod.xyz/_26956
    #7: https://govnokod.ru/26964 https://govnokod.xyz/_26964
    #8: https://govnokod.ru/26966 https://govnokod.xyz/_26966
    #9: https://govnokod.ru/27017 https://govnokod.xyz/_27017
    #10: https://govnokod.ru/27045 https://govnokod.xyz/_27045
    #11: https://govnokod.ru/27058 https://govnokod.xyz/_27058
    #12: https://govnokod.ru/27182 https://govnokod.xyz/_27182
    #13: https://govnokod.ru/27260 https://govnokod.xyz/_27260
    #14: https://govnokod.ru/27343 https://govnokod.xyz/_27343
    #15: https://govnokod.ru/27353 https://govnokod.xyz/_27353
    #16: https://govnokod.ru/27384 https://govnokod.xyz/_27384
    #17: https://govnokod.ru/27482 https://govnokod.xyz/_27482
    #18: https://govnokod.ru/27514 https://govnokod.xyz/_27514

    nepeKamHblu_nemyx, 27 Августа 2021

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

    +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
    function *foo()
    {
       yield 1;
       yield 2;
       yield 3;
    }
    
    function main()
    {
        for (const o of foo())
        {
    	console.log (o);
        }
    
    }
    
    main();

    давайте посмотрим, как TS/JS имплементирует "елды". изначально код выглядит красиво. но заглянем под капот что генерит tsc для выполнение такого кода. мне придется разбить этот ужос

    ASD_77, 24 Августа 2021

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

    +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
    struct file_id
    {
        uint64_t        persistent;
        uint64_t        volatile_;
    
        static const size_t RAW_LENGTH  = 16;
        operator std::string() const
        { return std::string(reinterpret_cast<const char*>(&persistent), RAW_LENGTH); }
    
        // Операторы для использования file_id в качестве ключа map и 
        // unordered_map
        struct hash
        {
            std::size_t operator()(const ntdec_smb2_file_id& file_id) const
            {
                std::string s_file_id = file_id;
                std::hash<std::string> hasher;
                return hasher(s_file_id);
            }
        };
    
        bool operator == (const ntdec_smb2_file_id& other)
        {
            return std::string(*this) == std::string(other);
        }
    
        bool operator < (const ntdec_smb2_file_id& other)
        {
            return std::string(*this) < std::string(other);
        }
    
        bool operator > (const ntdec_smb2_file_id& other)
        {
            return std::string(*this) > std::string(other);
        }
    };

    operator std::string тоже UB?

    YpaHeLI_, 24 Августа 2021

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