View Full Version: How not to write a tutorial

C++ Learning Community > C++ Tips > How not to write a tutorial


Title: How not to write a tutorial
Description: check this site out....


ih8censorship - December 26, 2005 07:28 PM (GMT)
while looking for some winsock tutorials, i ran across this site http://www.vijaymukhi.com/vmis/wsockexp.htm . The introduction is quite humorous and i think thats great it makes it more fun, but when you run into the code you see stuff like this
CODE
        #include <windows.h>
        #include <stdio.h>
        void abc(char *p)
        {
                FILE *fp=fopen("c:\\z.txt","a+");
                fprintf(fp,"%s\n",p);
                fclose(fp);
        }
        WNDCLASS a;HWND b;MSG c;
        long _stdcall zzz (HWND,UINT,WPARAM,LPARAM);
        int _stdcall WinMain(HINSTANCE i,HINSTANCE j,char *k,int l)
        {
                a.lpszClassName="a1";
                a.hInstance=i;
                a.lpfnWndProc=zzz;
                a.hbrBackground=GetStockObject(WHITE_BRUSH);
                RegisterClass(&a);
                b=CreateWindow("a1","aaa",WS_OVERLAPPEDWINDOW,1,1,10,20,0,0,i,0 );
                ShowWindow(b,3);
                while ( GetMessage(&c,0,0,0) )
                        DispatchMessage(&c);
                return 1;
        }
        long _stdcall zzz (HWND w,UINT x,WPARAM y,LPARAM z)
        {
                if ( x == WM_LBUTTONDOWN)
                {
                 MessageBox(0,"end","end",0);
                }
                if ( x == WM_DESTROY)
                        PostQuitMessage(0);
                return DefWindowProc(w,x,y,z);
        }


does anyone knotice anything wrong there? how much more difficult is it to use a semi descriptive variable or function name anyway? id really hate to try to debug that if something was wrong... so moral of the story is if your going to write a tutorial at least explain well and use identifyers that make sense.

C-Man - December 26, 2005 07:36 PM (GMT)
this is allmost obfuscated lol

C00L - December 28, 2005 10:13 PM (GMT)
lmao they must be following this guide http://thc.org/root/phun/unmaintain.html

btw this http://www.hal-pc.org/~johnnie2/winsock.html is a fairly good winsock tutorial.

Consumed - December 29, 2005 01:40 AM (GMT)




Hosted for free by InvisionFree