|
When I write in C, keeping the line length to 80 or even just 72 characters is a reasonable guideline. But when I write in C#, especially when I'm writing thread safe code, I don't concern myself with line length so much. The reason being that C# has several constructs that cause your code to be indented much farther than C. For example:
namespace MyLibrary
{
public class MyComponent : Component
{
public void DoSomething()
{
lock(lockObject)
{
context.Post(delegate(state dummy)
{
}, null);
}
}
}
}
This type of code isn't unusual for me. If I tried to limit myself to 80 columns, I'd go bonkers. So I try to keep things to a reasonable length but don't worry about it too much if a line gets to be fairly long.
|
|
|
|
|
On 1024x768 I tend to keep the lines in view, which for me is about 80. In 1260x1024 I let them get to 100 but then have trouble when working on my laptop.
But some lines still go longer, like SQL statements, for some reason when breaking them up in C# I get funky characters, so I let them just take one line.
This statement is false.
|
|
|
|
|
I try to keep it less that 100 because when it prints the auto wrap makes reading the code harder. Larger fonts are nice as I have trouble seeing the small ones.
djj 8)
|
|
|
|
|
1 to 6 ,7 ,8 to 11 ,12 to 72 characters. If you do not recognize these numbers find the bloke in the office with open toe sandals and ask him what COBOL is
|
|
|
|
|
I thought you were talking about Fortran for a moment.
ah - those were the days!
cheers,
Chris Maunder
CodeProject.com : C++ MVP
|
|
|
|
|
Chris Maunder wrote: I thought you were talking about Fortran for a moment.
Eh, in Fortran the first column is used to denote a comment (I was a 'C' guy, although some people prefer '*' - it is really a matter of religion ), then columns 2-5 for a label, column 6 for a line continuation mark, and column 7 is where the action begins.
Crazy as it sounds, but nothing beats Fortran when it comes to numerics
|
|
|
|
|
I think I remember those days. Numbering the CARDS so when the operator dropped the tray you could put it back together.
djj
|
|
|
|
|
Those were the days - hmm
Still writing more Fortran with Intel's compiler. Since it old f77 stuff, I stick to 72 wide for that stuff but in other languages, I may make a SQL statement that's larger.
I just wish VS2005 had a line going down the code at 72.
|
|
|
|
|
check out the post called "Guidelines for VS .NET" a few posts down. it turns out you can make some IDE's do this by playing with the registry.
zen is the art of being at one with the two'ness
|
|
|
|
|
I don't care how long my lines are because I keep word wrap turned on. I never have to scroll off the screen this way. Takes a few days to get used to, but I would not go back!
Hogan
|
|
|
|
|
word wrap is possibly the most evil invention of modern times!
undefined
|
|
|
|
|
|
Wrapping is a method to de-organize the organised one. Wrap is flip-flop combination with horizontal scrollbar.
// AKUR
|
|
|
|
|
|
IDE that I'm using because it seems to fit the most. What I would have actually voted for though was that it depends upon the language that I'm coding in. I develop source in C, C++, PL/SQL, SQL and various scripting languages each of which comes with it's own 'eccentricities'.
Chris Meech
I am Canadian. [heard in a local bar]
Nobody likes jerks. [espeir]
|
|
|
|
|
|
Excellent link
Thanks, I have set a line in VS at column 120.
You get my 5
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
|
Very cool. I changed the column lines to very light gray:
RGB(223,223,223) 4, 8, 12, 16, 20, 24, 80
Light enough so they don't get in the way, but very easy to see when I need them.
David Veeneman
www.veeneman.com
|
|
|
|
|
Is it possible to define the wide with visual studio ?
Thanks
|
|
|
|
|
Luncinda console is a great font to use for code. Fixed proportion, cleaner than Courier. You might even be able to drop a point size.
Ants
|
|
|
|
|
Gave it a try and did not like it at all.;)
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
Wingding is the best!
- Malhar
|
|
|
|
|
Only in VB of course;P
-- modified at 21:05 Tuesday 8th August, 2006
|
|
|
|
|
Well to me, VB by default looks like all typed using Wingding )
- Malhar
|
|
|
|
|
Try Consolas. A downloadable MS font designed specifically for VS. Monospaced and IMHO easier to read that CourierNew and Lucinda.
David Veeneman
www.veeneman.com
|
|
|
|