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

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

    −3

    1. 1
    https://discord.gg/qFGgdPas?event=982592329527492638

    Войсовый холивар на дискорд гк
    Основные темы: C++ лучший язык для всех платформ и целей, ржавчина не нужна, где борманд

    kcalbCube, 04 Июня 2022

    Комментарии (13)
  3. Куча / Говнокод #28190

    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
    44. 44
    45. 45
    46. 46
    47. 47
    48. 48
    49. 49
    50. 50
    51. 51
    52. 52
    with Ada.Unchecked_Conversion;
    with Interfaces.C;
    with System.Address_To_Access_Conversions;
    with System.Address_Operations; use System.Address_Operations;
    
    with VGA_Console; use VGA_Console;
    
    procedure Crash (Source_Location : System.Address; Line : Integer) is
       package C renames Interfaces.C;
    
       --  Get the length of the C NULL terminated string.
       function Length (Source_Location : System.Address) return C.size_t is
          use type C.size_t;
    
          function Convert is new Ada.Unchecked_Conversion (Source => C.size_t,
                                                            Target => System.Address);
    
          package To_Char is new System.Address_To_Access_Conversions (Object => C.char);
    
          Count : C.size_t               := 0;
          Char  : To_Char.Object_Pointer := To_Char.To_Pointer (AddA (Source_Location, Convert (Count)));
       begin
          while C.char'Pos (Char.all) /= 0 loop
             Count := Count + 1;
             Char  := To_Char.To_Pointer (AddA (Source_Location, Convert (Count)));
          end loop;
    
          return Count;
       end Length;
    
       --  This is really ugly, just to convert an address pointing to a C NULL terminated string to an Ada String!
       Source_Length : constant C.size_t := Length (Source_Location);
    
       type Source_Chars is new C.char_array (0 .. Source_Length);
    
       C_Str         : Source_Chars with
         Address => Source_Location;
       pragma Import (Convention => Ada, Entity => C_Str);
       Source_Str    : constant String := C.To_Ada (C.char_array (C_Str));
    begin
       Put (Str        => "** Kernel crashed at: " & Source_Str & ":" & Integer'Image (Line) & " **",
            X          => 1,
            Y          => 10,
            Foreground => White,
            Background => Red);
    
       --  TODO: Dump registers.
    
       Hang : loop
          null;
       end loop Hang;
    end Crash;

    3_dar, 25 Мая 2022

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

    −3

    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
    using System;
    using System.Linq;
    using System.Text;
    using AAAAA = System.Single;
    using AAAAAA = System.Boolean;
    using AAAAAAA = System.Int32;
    using AAAAAAAA = System.Char;
    using AAAAAAAAA = System.Byte;
    using AAAAAAAAAA = System.String;
    public interface IA<AAAA> where AAAA : AA<AAAA>, new()
    {
        AA<AAAA> A();
    }
    public class AAA : AA<AAA>
    {
        public AAA() { }
        public AAA(IA<AAA> AAAA) : base(AAAA) { }
    }
    public class AA<AAAAAAAAAAAAAAAAAAAA> : IA<AAAAAAAAAAAAAAAAAAAA> where AAAAAAAAAAAAAAAAAAAA : AA<AAAAAAAAAAAAAAAAAAAA>, new()
    {
        const AAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAA = 0;
        const AAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA = "AAAA";
        const AAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA = "UTF-8";
        public AA() { }
        AA<AAAAAAAAAAAAAAAAAAAA> IA<AAAAAAAAAAAAAAAAAAAA>.A() {
            return (AA<AAAAAAAAAAAAAAAAAAAA>)A((AAAAAA)new AA<AAAAAAAAAAAAAAAAAAAA>(this));
        }
        public AA(IA<AAAAAAAAAAAAAAAAAAAA> AAAA) {
            var AAAAAAAAAAAAAAAAAAAAAAAA = (AA<AAAAAAAAAAAAAAAAAAAA>)AAAA;
            AAAAAAAAAAAAAAAAAAAAAAAA.E();
        }
        public AA<AAAAAAAAAAAAAAAAAAAA> A(AAAAAA A) {
            if (true) return this;
        }
        public static AAA AAAA(string AAAAAAAAAA) {
            var AAAAAAAAAAAAAAA = AAAAAAAAAA.ToArray<AAAAAAAA>();
            return A(Encoding.GetEncoding(AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA).GetBytes(AAAAAAAAAAAAAAA));
        }
        private static AAA A(AAAAAAAAA[] AAA) {
            return A(BitConverter.ToSingle(AAA, AAAAAAAAAAAAAAAAAAAAAAAAAAAA));
        }
        private static AAA A(AAAAA A) {
            if (A == 12.078431f)
                return new AAA(new AA<AAA>());
            else
                throw new FUCKYOUException();
        }
        public static implicit operator AAAAAA(AA<AAAAAAAAAAAAAAAAAAAA> a) => true;
        private void E() => Console.WriteLine("E");
    }
    
    class FUCKYOUException : Exception { }

    kcalbCube, 19 Мая 2022

    Комментарии (13)
  5. C++ / Говнокод #28134

    0

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    template<typename Event>
    void bindEvent(auto function)
    {
        connectionGuards.emplace_back(
            std::make_unique<event::EventConnectionGuard<Event>>(
                std::forward(event::emitter().on<Event>(boost::bind(          
                    boost::mem_fn(function), static_cast<T*>(this), _1))                             
                )
            )
        );
    }

    kcalbCube, 23 Апреля 2022

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

    +3

    1. 1
    2. 2
    // remove "s" ending: minute/hour/day/week/month/year don't have "s" in the body
    const period = periodName.split("s").join(""); // days -> day

    И тут решили добавить секунды...

    dhilt, 19 Апреля 2022

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

    0

    1. 1
    #exclude <conio.h>

    конио

    3_dar, 29 Марта 2022

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

    −1

    1. 1
    https://github.com/tejdnk-2019-ShortNotes/

    CHayT, 14 Марта 2022

    Комментарии (13)
  9. Си / Говнокод #28058

    +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
    #include <stdio.h>
    
    int main(void)
    {
    	(
    		*********************
    		**  **     ** ***** *
    		* ** * **** ** *** **
    		* ** * **** *** * ***
    		* ** * **** **** ****
    		* ** * **** *** * ***
    		* ** **    *** *** **
    		*********************
    	printf)("pidor");
    }

    kcalbCube, 26 Февраля 2022

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

    −3

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    function test(p) {
      return p +' World';
    }
    var str = 'Hello ';
    console.log(str + test());
    
    // Hello undefined World

    ltmix-web, 17 Февраля 2022

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

    −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
    #include <cstdio>
    
    int main(void)
    {
        static char data[] = "sosu hui\n";
        __asm
        {
            mov eax, 0
            ploop:
                mov bl, [data + eax]
                push eax
                push bx
                call putchar
                pop bx
                pop eax
                inc eax
                cmp bl, 0
                jnz ploop
    
        }
    
        return 0;
    }

    digitalEugene, 05 Ноября 2021

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