Longest line of code?
-
I've always tried to keep my lines under 80 characters long, but recently, with all .NET identing (
namespace
,class
,method
,using
,using
and so on) it's becoming harder and harder. My original reason for 80 characters was so lines would not be broken when the code was printed, but I don't print code anymore. Also, with a bigger screen and all panels (solution explorer and so on) in auto-hide mode, I can easily fit some 110 characers (even with a 12 point font, bigger than average). I was thinking of imposing a new limit of 90 characters or 95 characters. So what is your line-length limit? any reasons? -- LuisR P.S. I seem to recall a similar thread some months ago. But I really didn't care then, now I do! :)
Luis Alonso Ramos Intelectix - Chihuahua, Mexico Not much here: My CP Blog!
-
I've always tried to keep my lines under 80 characters long, but recently, with all .NET identing (
namespace
,class
,method
,using
,using
and so on) it's becoming harder and harder. My original reason for 80 characters was so lines would not be broken when the code was printed, but I don't print code anymore. Also, with a bigger screen and all panels (solution explorer and so on) in auto-hide mode, I can easily fit some 110 characers (even with a 12 point font, bigger than average). I was thinking of imposing a new limit of 90 characters or 95 characters. So what is your line-length limit? any reasons? -- LuisR P.S. I seem to recall a similar thread some months ago. But I really didn't care then, now I do! :)
Luis Alonso Ramos Intelectix - Chihuahua, Mexico Not much here: My CP Blog!
120 - I can get that to print out without having to go into "Micro Font" size. <update to my original response> I don't keep to this "standard", only if I'm thinking about it, or I'm coding something that I know I'll be printing out ...
:..::. Douglas H. Troy ::..
Fold with us|Development Blogging|viksoe.dk's site -
I've always tried to keep my lines under 80 characters long, but recently, with all .NET identing (
namespace
,class
,method
,using
,using
and so on) it's becoming harder and harder. My original reason for 80 characters was so lines would not be broken when the code was printed, but I don't print code anymore. Also, with a bigger screen and all panels (solution explorer and so on) in auto-hide mode, I can easily fit some 110 characers (even with a 12 point font, bigger than average). I was thinking of imposing a new limit of 90 characters or 95 characters. So what is your line-length limit? any reasons? -- LuisR P.S. I seem to recall a similar thread some months ago. But I really didn't care then, now I do! :)
Luis Alonso Ramos Intelectix - Chihuahua, Mexico Not much here: My CP Blog!
My limit is the display. I have 1280x1024 and when the code reaches the right border of the screen, I normally begin a new line. Don't try it, just do it! ;-)
-
I've always tried to keep my lines under 80 characters long, but recently, with all .NET identing (
namespace
,class
,method
,using
,using
and so on) it's becoming harder and harder. My original reason for 80 characters was so lines would not be broken when the code was printed, but I don't print code anymore. Also, with a bigger screen and all panels (solution explorer and so on) in auto-hide mode, I can easily fit some 110 characers (even with a 12 point font, bigger than average). I was thinking of imposing a new limit of 90 characters or 95 characters. So what is your line-length limit? any reasons? -- LuisR P.S. I seem to recall a similar thread some months ago. But I really didn't care then, now I do! :)
Luis Alonso Ramos Intelectix - Chihuahua, Mexico Not much here: My CP Blog!
Sometimes I keep it shorter sometimes longer.
It's fun to align the text like this text I'm
writing here. It's not very hard and it looks
compact and cool. Hope you get how I wrote it
It's not very cool but I couldnt think of any
thing else to write. When I'm coding I've got
a width of about two thirds of the screen.Niklas Ulvinge aka IDK
-
Sometimes I keep it shorter sometimes longer.
It's fun to align the text like this text I'm
writing here. It's not very hard and it looks
compact and cool. Hope you get how I wrote it
It's not very cool but I couldnt think of any
thing else to write. When I'm coding I've got
a width of about two thirds of the screen.Niklas Ulvinge aka IDK
Niklas Ulvinge wrote: Hope you get how I wrote it Yes, you missed a period there at the end. Niklas Ulvinge wrote: I couldnt and an apostrophe... Niklas Ulvinge wrote: shorter sometimes longer Oh, also a comma :) Wouldn't it be easier to insert extra spaces?? :) -- LuisR
Luis Alonso Ramos Intelectix - Chihuahua, Mexico Not much here: My CP Blog!
-
Niklas Ulvinge wrote: Hope you get how I wrote it Yes, you missed a period there at the end. Niklas Ulvinge wrote: I couldnt and an apostrophe... Niklas Ulvinge wrote: shorter sometimes longer Oh, also a comma :) Wouldn't it be easier to insert extra spaces?? :) -- LuisR
Luis Alonso Ramos Intelectix - Chihuahua, Mexico Not much here: My CP Blog!
I ment to do it like that. Maybe. But it's harder to read sometimes. I'm an assembler now and doing everything in assembler and there everying is very the same. The sytax is always like this:
Label: instr. parameters ;comment
Niklas Ulvinge aka IDK
-
I ment to do it like that. Maybe. But it's harder to read sometimes. I'm an assembler now and doing everything in assembler and there everying is very the same. The sytax is always like this:
Label: instr. parameters ;comment
Niklas Ulvinge aka IDK
Sometimes I keep it shorter sometimes longer.
It's fun to align the text like this text I'm
writing here. It's not very hard and it looks
compact and cool. Hope you get how I wrote it
It's not very cool but I couldnt think of any
thing else to write. When I'm coding I've got
a width of about two thirds of the screen.Niklas Ulvinge aka IDK yeah, we know exactly how you did it. David
-
I've always tried to keep my lines under 80 characters long, but recently, with all .NET identing (
namespace
,class
,method
,using
,using
and so on) it's becoming harder and harder. My original reason for 80 characters was so lines would not be broken when the code was printed, but I don't print code anymore. Also, with a bigger screen and all panels (solution explorer and so on) in auto-hide mode, I can easily fit some 110 characers (even with a 12 point font, bigger than average). I was thinking of imposing a new limit of 90 characters or 95 characters. So what is your line-length limit? any reasons? -- LuisR P.S. I seem to recall a similar thread some months ago. But I really didn't care then, now I do! :)
Luis Alonso Ramos Intelectix - Chihuahua, Mexico Not much here: My CP Blog!
I found out that the C# compiler only allows 2048 characters while writing a very long inline sql statement (later I found out that I could span it in several lines), but I try not to break any lines. I rather scroll than see the if condition all messed up
-
I've always tried to keep my lines under 80 characters long, but recently, with all .NET identing (
namespace
,class
,method
,using
,using
and so on) it's becoming harder and harder. My original reason for 80 characters was so lines would not be broken when the code was printed, but I don't print code anymore. Also, with a bigger screen and all panels (solution explorer and so on) in auto-hide mode, I can easily fit some 110 characers (even with a 12 point font, bigger than average). I was thinking of imposing a new limit of 90 characters or 95 characters. So what is your line-length limit? any reasons? -- LuisR P.S. I seem to recall a similar thread some months ago. But I really didn't care then, now I do! :)
Luis Alonso Ramos Intelectix - Chihuahua, Mexico Not much here: My CP Blog!
71 characters, because that's all the assemblers can handle. Though my C++/perl code is roughly what fits on the screen width, though it sometimes goes beyond that. BW
All the chickens get it.
And them singing canaries get it.
Even strawberries get it.[
Discovering BPI
-
I've always tried to keep my lines under 80 characters long, but recently, with all .NET identing (
namespace
,class
,method
,using
,using
and so on) it's becoming harder and harder. My original reason for 80 characters was so lines would not be broken when the code was printed, but I don't print code anymore. Also, with a bigger screen and all panels (solution explorer and so on) in auto-hide mode, I can easily fit some 110 characers (even with a 12 point font, bigger than average). I was thinking of imposing a new limit of 90 characters or 95 characters. So what is your line-length limit? any reasons? -- LuisR P.S. I seem to recall a similar thread some months ago. But I really didn't care then, now I do! :)
Luis Alonso Ramos Intelectix - Chihuahua, Mexico Not much here: My CP Blog!
Luis Alonso Ramos wrote: So what is your line-length limit? any reasons? 80 columns. Period. Yes, I admit it. I'm a column nazi... I like to print out a page and still have room to scribble notes on the right about what I'm gonna change next in the code. Screens are almost as hi res as printers now adays. But I guess I'm just an old geezer cuz I NEED to print stuff out to fully grasp it... ...Steve
-
I've always tried to keep my lines under 80 characters long, but recently, with all .NET identing (
namespace
,class
,method
,using
,using
and so on) it's becoming harder and harder. My original reason for 80 characters was so lines would not be broken when the code was printed, but I don't print code anymore. Also, with a bigger screen and all panels (solution explorer and so on) in auto-hide mode, I can easily fit some 110 characers (even with a 12 point font, bigger than average). I was thinking of imposing a new limit of 90 characters or 95 characters. So what is your line-length limit? any reasons? -- LuisR P.S. I seem to recall a similar thread some months ago. But I really didn't care then, now I do! :)
Luis Alonso Ramos Intelectix - Chihuahua, Mexico Not much here: My CP Blog!
I used to try to put as much into a line as I could, and think of ways to do that, because it was interesting and felt cool. Nowadays, I'm more interested in writing human readable code, I tend to keep lines as short as I can, and break things up for clarity where-ever possible. The exception would be that I don't put using statements for a namespace if I'm only going to use one object out of it, I will scope it explicitly rather than pollute the local namespace ( being I am in C#, there is no global namespace ). Christian Graus - Microsoft MVP - C++
-
I've always tried to keep my lines under 80 characters long, but recently, with all .NET identing (
namespace
,class
,method
,using
,using
and so on) it's becoming harder and harder. My original reason for 80 characters was so lines would not be broken when the code was printed, but I don't print code anymore. Also, with a bigger screen and all panels (solution explorer and so on) in auto-hide mode, I can easily fit some 110 characers (even with a 12 point font, bigger than average). I was thinking of imposing a new limit of 90 characters or 95 characters. So what is your line-length limit? any reasons? -- LuisR P.S. I seem to recall a similar thread some months ago. But I really didn't care then, now I do! :)
Luis Alonso Ramos Intelectix - Chihuahua, Mexico Not much here: My CP Blog!
To save paper I use to try for 80 on every line, and short variable names etc to save on ribbons. Things have changed now though. Regardz Colin J Davies The most LinkedIn CPian (that I know of anyhow) :-)
-
I've always tried to keep my lines under 80 characters long, but recently, with all .NET identing (
namespace
,class
,method
,using
,using
and so on) it's becoming harder and harder. My original reason for 80 characters was so lines would not be broken when the code was printed, but I don't print code anymore. Also, with a bigger screen and all panels (solution explorer and so on) in auto-hide mode, I can easily fit some 110 characers (even with a 12 point font, bigger than average). I was thinking of imposing a new limit of 90 characters or 95 characters. So what is your line-length limit? any reasons? -- LuisR P.S. I seem to recall a similar thread some months ago. But I really didn't care then, now I do! :)
Luis Alonso Ramos Intelectix - Chihuahua, Mexico Not much here: My CP Blog!
Why limit it at all? As long as you remember to stick in a ';' once in a while, the compiler will sort it all out. Nobody will ever have to read it, after all.;P [Tip] You can save a lot of storage space by eliminating spaces in comments, too. No one will ever see them either. [/Tip] "...putting all your eggs in one basket along with your bowling ball and gym clothes only gets you scrambled eggs and an extra laundry day... " - Jeffry J. Brickley
-
I've always tried to keep my lines under 80 characters long, but recently, with all .NET identing (
namespace
,class
,method
,using
,using
and so on) it's becoming harder and harder. My original reason for 80 characters was so lines would not be broken when the code was printed, but I don't print code anymore. Also, with a bigger screen and all panels (solution explorer and so on) in auto-hide mode, I can easily fit some 110 characers (even with a 12 point font, bigger than average). I was thinking of imposing a new limit of 90 characters or 95 characters. So what is your line-length limit? any reasons? -- LuisR P.S. I seem to recall a similar thread some months ago. But I really didn't care then, now I do! :)
Luis Alonso Ramos Intelectix - Chihuahua, Mexico Not much here: My CP Blog!
The shortest the better. And that extends naturally to the sizes of functions and source files. The more information you present at one time, the harder it is to understand it. Short lines are easier to debug and maintain (there are fewer risks of side effects). The fact that it's easier to maintain the same formatting across different setups (screen and/or paper) is an added bonus. By the way, this is one of the reasons why I tend to get violent when I see tabs in source code. Good communicators use short words, short phrases and short paragraphs. Take ads, all the good ones (the ones you, not me, like, remember and understand) are short. Search on Google for a science paper called "the magical number 7", or something similar. It explains some of the reasons why less is better. OGR