Sign in to follow this  
Lode

80 character width

Recommended Posts

Do you limit your code to 80 characters wide? I don't, and my code width goes over the 80 quite often, especially in mathematical formulas with long variable names.

Share this post


Link to post
Share on other sites
you mean something like:


// creation window properties
DWORD style_ex = WS_EX_APPWINDOW;
DWORD style = WS_OVERLAPPEDWINDOW | WS_CLIPSIBLINGS | WS_CLIPCHILDREN;
char* cname = "STDWINDOW";
char* title = "STDWINDOW";
int x = 0; int w = 1280;
int y = 0; int h = 1024;

// create window
HWND retval = CreateWindowEx(style_ex, cname, title, style, x, y, w, h, 0, 0, slGetInstance(), 0);
if(!retval) return 0;
ShowWindow(retval, SW_SHOW);
return retval;


to prevent this...?


HWND retval = CreateWindowEx(WS_EX_APPWINDOW, "STDWINDOW", "STDWINDOW", WS_OVERLAPPEDWINDOW | WS_CLIPSIBLINGS | WS_CLIPCHILDREN, 0, 0, 1280, 1024, 0, 0, slGetInstance(), 0);
if(!retval) return 0;
ShowWindow(retval, SW_SHOW);
return retval;


yes. sometimes :). if speed is critical though, no.

Share this post


Link to post
Share on other sites
I guess he means something like this:

HWND retval = CreateWindowEx(WS_EX_APPWINDOW, "STDWINDOW", "STDWINDOW",
WS_OVERLAPPEDWINDOW | WS_CLIPSIBLINGS | WS_CLIPCHILDREN, 0, 0, 1280,
1024, 0, 0, slGetInstance(), 0);
if(!retval) return 0;
ShowWindow(retval, SW_SHOW);
return retval;

Share this post


Link to post
Share on other sites
Quote:
Original post by KrazeIke
Ah, that is why I love high resolutions. Both of Dead Eye's examples fit on my screen just fine.


lol, last time i adjusted my screen to 1600x1200 it gave my eyes fits
trying to read shortcut names in explorer.

Share this post


Link to post
Share on other sites
I'm running at 1680x1050; it helps if your screen is naturally large, otherwise high resolutions are painful. As for code formatting, I avoid long lines anyway. When it comes to function calls with many parameters, sticking them all on one line makes it difficult to determine what parameters are what.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this