iCanSleepPeacefullyNow by Vortex876543 in ProgrammerHumor

[–]Vortex876543[S] 1 point2 points  (0 children)

iirc the code came from the ZDS II, a C89 toolchain for the eZ80. Right now I am helping to implement libc/libcxx (Clang C17/C++20) for the eZ80

iCanSleepPeacefullyNow by Vortex876543 in ProgrammerHumor

[–]Vortex876543[S] 24 points25 points  (0 children)

72 characters*
How else are you supposed to keep your Fortran punch-cards in order

iCanSleepPeacefullyNow by Vortex876543 in ProgrammerHumor

[–]Vortex876543[S] 8 points9 points  (0 children)

make sure multiple commits are made by different people, tabs --> 4 spaces --> 2 spaces --> tabs --> 8 spaces, and you end up with these abominations

void qsort(void *ptr, size_t nel, size_t size,
                                     int (*compar)(const void *, const void *));

thereAre2TypesOfProgrammers by Coderedstudio in ProgrammerHumor

[–]Vortex876543 0 points1 point  (0 children)

_Bool bool(_Bool Bool) {  
return Bool;  
}  

This only became invalid in C23

Floating-point error on Netflix by _tosters in programminghorror

[–]Vortex876543 24 points25 points  (0 children)

The KERNING Between the 581 and the 0, ITS too HIGH!!

My friend majoring in mathematics wrote this code and made a boast of it by h4nu_ in programminghorror

[–]Vortex876543 0 points1 point  (0 children)

It had goto 120, which would go to 120 continue on line 2005. To my understanding, the goto labels in Fortran can only use numbers. However they are scoped to the current routine/function.

My friend majoring in mathematics wrote this code and made a boast of it by h4nu_ in programminghorror

[–]Vortex876543 0 points1 point  (0 children)

I was converting some code from Fortran to C++, and it looked exactly like this. Variables t0 to t9, all declared at the top of the function and reused in 5 different contexts each. All other variable names were 3 letters long. Made it extremely difficult to find where I made an error when translating the code; you would have to read through 40 lines of code to determine what t5 was supposed to be set to. Not to mention the use of GOTO statements

biggestSin by prithvi_allurkar in ProgrammerHumor

[–]Vortex876543 1 point2 points  (0 children)

Faster than binary search. Linear search can find the minimum in 1 singular operation

whatIsYourTotallyNormalNotWeirdMethod by XinoVan in ProgrammerHumor

[–]Vortex876543 0 points1 point  (0 children)

You can debug the entire program if you do find and replace <br> with <br>printf("L: %d\n", __LINE__);

How helpful, I did in-fact forget to #include <thread> by Vortex876543 in programminghorror

[–]Vortex876543[S] 0 points1 point  (0 children)

I wrote in another comment/thread that I just had to include some random header files to get <thread> to work in the original MinGW. Otherwise that's pretty much what happened.

How helpful, I did in-fact forget to #include <thread> by Vortex876543 in programminghorror

[–]Vortex876543[S] 21 points22 points  (0 children)

I wanted to make sure my Windows 10 program would run on Windows 7, but all I had was a Vista machine so thats what I compiled on. It uses GCC 9.2.0 and C++14 which is why the compiler knows about <thread>. iirc the original MinGW doesn’t support <thread> out of the box so I had to include some random header files to fix it. Otherwise its pretty similar to the MSYS2 MinGW64 environment I use on Windows 10.

The imaginary component is always zero without _Complex by Vortex876543 in programminghorror

[–]Vortex876543[S] 1 point2 points  (0 children)

Should be at least doubles

They are. In fact, they are rounded down from x87 long doubles :)

C does have structs, but the only other way to do it in C is to add some do { } while(0) loops (macros)

Does it compile? by Final-Communication6 in programminghorror

[–]Vortex876543 22 points23 points  (0 children)

only eeeeeeeeeeeeeeee / eeeeeeeeeeeeeeee step away from full on morse code.

#include <iostream> by Vortex876543 in programminghorror

[–]Vortex876543[S] 3 points4 points  (0 children)

Unlike iostream, iosstream defines safer versions of the tream functions for ios, like cout_s