Sign in to follow this  

80 character width

This topic is 4720 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Since I'm the only one that has to read my code, I usually limit mine to the width of the visual studio editor maximized at a 1600x1200 resolution. Most stuff fits.

Share this post


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

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
Sign in to follow this