473,320 Members | 1,884 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Number of characters per line of code

All,

I want to know how others deal with long lines of code. Do you care?
If so, what rule(s) do you follow? Is it important to you how it looks
on printed paper or displayed on the screen? Being able to keep all of
the code on the screen without scrolling horizontally is important to
me, but the 80 character rule is limiting and outdated and anything
else seems arbitrary considering that different developers use
different screen resolutions, fonts, IDE layouts, etc.

Brian

Nov 17 '05 #1
4 2789
Brian,

Well, you can't really go by character count because of the things you
said. All things considered, usually in VS.NET when developing, I have the
project explorer pinned, and I have the server explorer/toolbar hidden (in
fly-out mode). Once I have that setup, with the default font settings and a
system with a 1280x1024 resolution, I try and make sure that one line of
code does not wrap past the available real estate in the code editor.

I've found that placing the server explorer/toolbox window in fly-away
mode gives me a good amount of real estate to work with, and gives me good
boundaries for the code in the file.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Brian Gideon" <br*********@yahoo.com> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com...
All,

I want to know how others deal with long lines of code. Do you care?
If so, what rule(s) do you follow? Is it important to you how it looks
on printed paper or displayed on the screen? Being able to keep all of
the code on the screen without scrolling horizontally is important to
me, but the 80 character rule is limiting and outdated and anything
else seems arbitrary considering that different developers use
different screen resolutions, fonts, IDE layouts, etc.

Brian

Nov 17 '05 #2
I started out wrapping lines manually, but then ran into trouble. I
have two screens at two different resolutions (aging eyes), plus the
printed page, which is different again and can be portrait or
landscape. No matter how I chose my wrap points, the line wrapping
looked like a mess in some situations.

Now I don't wrap, except at very obvious wrap points (nested method
calls, etc). I let the line get as long as it wants to be, and I have
Tools -> Options -> Text Editor -> C# -> Word Wrap turned on, so that
Visual Studio wraps the lines for me.

That way, no matter where I move the VS window, or how I print the
text, VS wraps the lines as required.

Yes, you have to get used to reading wrapped lines, but there are no
horizontal scroll bars, and the source code looks equally good (or
equally bad) in all situations.

Nov 17 '05 #3
Bruce Wood <br*******@canada.com> wrote:
Yes, you have to get used to reading wrapped lines, but there are no
horizontal scroll bars


Minor point: you can hide the horizontal scroll bar even with word wrapping
turned off in VS.NET (2003 -- dunno whether or not this holds true for
other versions).
Nov 17 '05 #4
Yeah, 80 characters are really too limiting for the looong identifiers
in the CLR library, let alone XML comment tags... I've recently
converted my C# code to 100 CPL, that's a decent compromise between
not having to break too many lines vs not exceeding screen space.
--
http://www.kynosarges.de
Nov 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Ken Fine | last post by:
Suppose I have strString. I want to determine the length of strString in # of characters, and write that number of characters on a subsequent line as a dummy character, say a hypen. In other...
18
by: Vasilis Serghi | last post by:
Presently I define the number of lines to be expected in a file when defining the array size and the initialisation of this array. This works fine for now, but i'm sure that in the future this...
6
by: Scott Kilbourn | last post by:
Hi, I'm writing a control that inherits from TextBox. I need to adjust the width of this control based on the number of characters in the control. I'm having a hard time with this. The...
9
by: Nathan Sokalski | last post by:
I have several TextBoxes with TextMode="MultiLine" in which I want to limit the number of characters that can be entered using a RegularExpressionValidator. I have come up with the following...
9
by: Nathan Sokalski | last post by:
I have several TextBoxes with TextMode="MultiLine" in which I want to limit the number of characters that can be entered using a RegularExpressionValidator. I have come up with the following...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.