-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Description
- - 1 file (which wouldn't be so bad if not for...)
- - 3 kLOC (should be ~500 SLOC per file at the most)
- - functions are hundreds of lines long (should be < 15)
- - functions each take 20+ arguments (should be < 5)
- - max nest depth averaging 7-8 tabs (cyclomatic complexity = fucked)
- - tons of global variables
- - using namespace (you clearly didn't care about naming collisions)
- - no cohesion
- - no encapsulation
- - ugly
- - repetitive
- - bleeds memory
- and many, many more...
This is some of the absolute worst, most irresponsibly written code I've ever read. No wonder the project's been dead for years. There was no way you would have been able to maintain this.
Also, just because the following was one of the first things I saw while speed-scrolling through the source file...
val[0] = *(((char*)&(xf))+7);
val[1] = *(((char*)&(xf))+6);
val[2] = *(((char*)&(xf))+5);
val[3] = *(((char*)&(xf))+4);
val[4] = *(((char*)&(xf))+3);
val[5] = *(((char*)&(xf))+2);
val[6] = *(((char*)&(xf))+1);
val[7] = *(((char*)&(xf))+0);
write(of,val,8);
val[0] = *(((char*)&(zf))+7);
val[1] = *(((char*)&(zf))+6);
val[2] = *(((char*)&(zf))+5);
val[3] = *(((char*)&(zf))+4);
val[4] = *(((char*)&(zf))+3);
val[5] = *(((char*)&(zf))+2);
val[6] = *(((char*)&(zf))+1);
val[7] = *(((char*)&(zf))+0);
write(of,val,8);
val[0] = *(((char*)&(yf))+7);
val[1] = *(((char*)&(yf))+6);
val[2] = *(((char*)&(yf))+5);
val[3] = *(((char*)&(yf))+4);
val[4] = *(((char*)&(yf))+3);
val[5] = *(((char*)&(yf))+2);
val[6] = *(((char*)&(yf))+1);
val[7] = *(((char*)&(yf))+0);
write(of,val,8);
There is a reason we have functions like memcpy and fwrite.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels