|
-
Apr 6th, 2006, 12:12 AM
#1
Thread Starter
Lively Member
length of source code line
dear friends,
There is a length of a source code line. For example i have a long sql command. If I want to write it in one line then there will be a constraint error.
I want to know thre maximum limit of a line and how I can devide one line into several lines in C#.NET.
Please help...
Rajib
Please Rate every reply if it is useful to u
-
Apr 6th, 2006, 12:24 AM
#2
Re: length of source code line
You can divide a string literal like this:
Code:
string sql =
"select field1, field2, field3, field4, field5 " +
"from table1 " +
"where field1=value1 and field2=value2"
;
The line length limit is 2046 characters - I think
-
Apr 7th, 2006, 12:35 PM
#3
Hyperactive Member
Re: length of source code line
you should really try to limit your lines of code to 80 chars. its just standard to do that.
-
Apr 7th, 2006, 01:19 PM
#4
Re: length of source code line
 Originally Posted by BrandonTurner
you should really try to limit your lines of code to 80 chars. its just standard to do that.
It is?
Not in any recent memory of mine.... the days of 80char wide screens is long gone. But on that note, I don't mind a little scrolling, but 200 would be pushing it for me.
-tg
-
Apr 7th, 2006, 02:13 PM
#5
Hyperactive Member
Re: length of source code line
 Originally Posted by techgnome
It is?
Not in any recent memory of mine.... the days of 80char wide screens is long gone. But on that note, I don't mind a little scrolling, but 200 would be pushing it for me.
-tg
Sure it is. I mean it isnt something that everyone follows. But in general people follow it. My university enforces it pretty strictly. My work asks it of all the employees. And most open source gnu programs follow. It doesnt appear that there is a offical number in the GNU C standards page, but they do talk about keeping your lines short by breaking them up. I did a quick run through some linux kernel code and I didnt see any non commented lines that were long there 80, most the big ones were ~75 chars long. I worked a little on 2 projects www.reactos.org and www.tinykrnl.org and both projects enforced 80 char limits.
-
Apr 7th, 2006, 02:21 PM
#6
Re: length of source code line
the only good reason for doing it is when you are writing code in the terminal. But this is not a terminal programming language, its inherently IDE based.
Last edited by wossname; Apr 7th, 2006 at 02:24 PM.
I don't live here any more.
-
Apr 7th, 2006, 04:20 PM
#7
Re: length of source code line
I don't know if there is a line length limit.. I know I once put an entire app on one line after removing comments, and it ran..
Bill
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|