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

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

    −1

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    apt update
    apt upgrade
    
    brew upgrade
    brew update

    Постоянно их путаю

    3_dar, 11 Ноября 2022

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

    +1

    1. 1
    Яндекс сгнил :(

    hormand, 12 Сентября 2022

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

    0

    1. 1
    https://github.com/PlummersSoftwareLLC/Primes/blob/drag-race/PrimeChapel/solution_1/primes.chpl#L92

    Царские анроллы.

    CHayT, 06 Сентября 2022

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

    0

    1. 1
    2. 2
    3. 3
    4. 4
    try
    {
    }
    catch(...) { /*um, nice weather!*/}

    kcalbCube, 27 Мая 2022

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

    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
    #include <iostream>
    #include <string_view>
    #include <source_location>
     
    void log(const std::string_view message,
             const std::source_location location = 
                   std::source_location::current())
    {
        std::cout << "file: "
                  << location.file_name() << "("
                  << location.line() << ":"
                  << location.column() << ") `"
                  << location.function_name() << "`: "
                  << message << '\n';
    }
     
    template <typename T> void fun(T x)
    {
        log(x);
    }
     
    int main(int, char*[])
    {
        log("Hello world!");
        fun("Hello C++20!");
    }
    
    file: main.cpp(23:8) `int main(int, char**)`: Hello world!
    file: main.cpp(18:8) `void fun(T) [with T = const char*]`: Hello C++20!

    Previously, functions that desire to obtain this information about the call site (for logging, testing, or debugging purposes) must use macros so that predefined macros like __LINE__ and __FILE__ are expanded in the context of the caller. The source_location class provides a better alternative.

    kcalbCube, 27 Апреля 2022

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

    0

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    #define as ;while
    
    int main(int argc, char* argv[])
    {
        int n = atoi(argv[1]);
        do printf("n is %d\n", n) as ( n --> 0);
        return 0;
    }

    digitalEugene, 05 Февраля 2022

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

    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
    class Foo {
        std::atomic<bool> a{false};
        std::atomic<bool> b{false};
    public:
        Foo()
        {
            
        }
    
        void first(function<void()> printFirst) {
            printFirst();
            a.store(true, std::memory_order_release);
        }
    
        void second(function<void()> printSecond) {
            while (!a.load(std::memory_order_acquire))
                ;
    
            printSecond();
            b.store(true, std::memory_order_release);
        }
    
        void third(function<void()> printThird) {
            while (!b.load(std::memory_order_acquire))
                ;
    
            printThird();
        }
    };

    https://leetcode.com/problems/print-in-order/

    36 / 36 test cases passed.
    Runtime: 1697 ms
    Memory Usage: 7 MB

    Хочу, чтобы начался срач по поводу того, как достичь рантайма в 200мс

    Nyanwitt, 24 Января 2022

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

    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
    .org 80h
    fib:
    	push %b
    	push %d
    	push %c
    	mov %d [%sp + 8h]
    	mov %b 1h
    	mov %a 0h
    	
    	.loop:
    		add %b %a
    		mov %c %a
    		mov %a %b
    		sub %a %c
    		dec %d
    		jnz @.loop
    	
    	pop %c
    	pop %d
    	pop %b
    	ret
    
    start:
    	mov %sp 2000h
    	push Fh
    	call @fib
    	pop
    
    	int 0h

    один чел захотел написать для моей вмки компилятор лиспоподобного языка с некими S-выражениями и попросил пример вычисления ряда фибоначчи.
    пришлось накопипастить с вики.

    digitalEugene, 23 Января 2022

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

    0

    1. 1
    2. 2
    Be gone, malicious spirit from the anus!
    We don't say "amen", because we may step on the mines; we say "True"!

    Херня рулит.

    nPOnOBeDHuK, 01 Ноября 2021

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

    +1

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

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

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

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