473,386 Members | 1,706 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,386 software developers and data experts.

C++: why 80 charachters??

I write code as long as 250+ columns sometimes (when the code refers to
a single concept), and I don't understand why people complain about
that. Just use the word wrap, right?

People who write 80 columns force everybody else in the world to see
their code in a narrow stripe of screen, when almost every programmer
nowdays has 1280x1024+ screen resolution. Many have 1600+!

If the algorithm does not fit into one screen, you are going to make
mistakes when writing or reading it. Losing 2/3 of the screen to stay
into 80 charachters seems nonsense to me.
Jul 22 '05 #1
20 1928
Maybe such things are called 'portability'...
80 columns are quiet enough for me to code. :-)
I would rewrite the code if it exceeds..
Another reason (maybe the major) is to use text-mode screen!! :-)
I prefer to code in text-mode to the graphical mode...
"John Doe" <jo*****@nowhere.com> wrote in message
news:c4**********@news.vanderbilt.edu...
I write code as long as 250+ columns sometimes (when the code refers to
a single concept), and I don't understand why people complain about
that. Just use the word wrap, right?

People who write 80 columns force everybody else in the world to see
their code in a narrow stripe of screen, when almost every programmer
nowdays has 1280x1024+ screen resolution. Many have 1600+!

If the algorithm does not fit into one screen, you are going to make
mistakes when writing or reading it. Losing 2/3 of the screen to stay
into 80 charachters seems nonsense to me.

Jul 22 '05 #2
On Thu, 01 Apr 2004 09:36:28 -0600, John Doe <jo*****@nowhere.com> wrote:
I write code as long as 250+ columns sometimes (when the code refers to
a single concept), and I don't understand why people complain about
that. Just use the word wrap, right?
I guess if the result of your editor's word-wrapping algorithm is
acceptable to you, party down. Will that also be the case, though, with
everyone who may ever need to view your code?

People who write 80 columns force everybody else in the world to see
their code in a narrow stripe of screen, when almost every programmer
nowdays has 1280x1024+ screen resolution. Many have 1600+!
For me, to be able to fit more than about 130 characters on my
(1400-pixel-wide) screen would require reducing the font size to something
my 45-year-old eyes would not enjoy trying to read (I get enough headaches
as it is, thank you very much). Not to mention the fact that I may want to
fit another window next to my editor while editing (or at least be able to
see some portion of it)

If the algorithm does not fit into one screen, you are going to make
mistakes when writing or reading it. Losing 2/3 of the screen to stay
into 80 charachters seems nonsense to me.


Bah. If the algorithm doesn't fit on one (modern-length) screen, it's too
complicated (or uses trivial constructs like lots of switch cases).

What about printing? Are you pleased with the results of trying to print
your file with the 250+ columns? I guess you can customize some sort of a
print utility (like the ZLPR program I give away on my site) to do
intelligent things with those long lines, but I think sometime, somewhere,
someone is likely to curse you for them.
-leor
--
Leor Zolman --- BD Software --- www.bdsoft.com
On-Site Training in C/C++, Java, Perl and Unix
C++ users: Download BD Software's free STL Error Message Decryptor at:
www.bdsoft.com/tools/stlfilt.html
Jul 22 '05 #3

"John Doe" <jo*****@nowhere.com> wrote in message
news:c4**********@news.vanderbilt.edu...
I write code as long as 250+ columns sometimes (when the code refers to
a single concept), and I don't understand why people complain about
that. Just use the word wrap, right?

People who write 80 columns force everybody else in the world to see
their code in a narrow stripe of screen, when almost every programmer
nowdays has 1280x1024+ screen resolution. Many have 1600+!

If the algorithm does not fit into one screen, you are going to make
mistakes when writing or reading it. Losing 2/3 of the screen to stay
into 80 charachters seems nonsense to me.


Warning: Today is April 1.

-Mike
Jul 22 '05 #4
"John Doe" <jo*****@nowhere.com> wrote in message
news:c4**********@news.vanderbilt.edu
I write code as long as 250+ columns sometimes (when the code refers
to a single concept), and I don't understand why people complain about
that. Just use the word wrap, right?
Wordwrapped code is unreadable because it wrecks indentation.
People who write 80 columns force everybody else in the world to see
their code in a narrow stripe of screen, when almost every programmer
nowdays has 1280x1024+ screen resolution. Many have 1600+!
Many also use multi-window IDEs, so that the source code window is only a
fraction of the screen.
If the algorithm does not fit into one screen, you are going to make
mistakes when writing or reading it. Losing 2/3 of the screen to stay
into 80 charachters seems nonsense to me.


I find that I can only carefully check code on hardcopy. With a lot of
columns, the hardcopy will be wordwrapped and hence unreadable.
--
John Carson
1. To reply to email address, remove donald
2. Don't reply to email address (post here instead)

Jul 22 '05 #5
John Doe wrote:
I write code as long as 250+ columns sometimes (when the code refers to
a single concept), and I don't understand why people complain about
that. Just use the word wrap, right?

People who write 80 columns force everybody else in the world to see
their code in a narrow stripe of screen, when almost every programmer
nowdays has 1280x1024+ screen resolution. Many have 1600+!

If the algorithm does not fit into one screen, you are going to make
mistakes when writing or reading it. Losing 2/3 of the screen to stay
into 80 charachters seems nonsense to me.


Because some of us are old fashioned and like hard copy? And 12 point
courier is easier to read on standard letter size paper when it's 80
columns?

[RANT type="old-geezer"]
These darned kids and their newfangled screens! Why back in my day, we
had to punch our programs onto Hollerith cards! And we had to walk
fifteen miles to do it... In a raging snowstorm... Uphill... Both ways!
And we were glad to do it, too! And we didn't have no fancy "computers"
neither! We had to run them by hand! Darned kids... rassum fassum
mumble grumble.
[/RANT]

Jul 22 '05 #6
John Doe wrote:

I write code as long as 250+ columns sometimes (when the code refers to
a single concept), and I don't understand why people complain about
that. Just use the word wrap, right?

People who write 80 columns force everybody else in the world to see
their code in a narrow stripe of screen, when almost every programmer
nowdays has 1280x1024+ screen resolution. Many have 1600+!

If the algorithm does not fit into one screen, you are going to make
mistakes when writing or reading it. Losing 2/3 of the screen to stay
into 80 charachters seems nonsense to me.


You can't see all 250 cols at once, right?

Personally, I do not like horizontal scrolling and find that the editor word
wrap feature is pretty weak w/ no customizability (at least in the editor that
I use).

I try to keep it within the general confines of my displayed page, which is
pretty subjective, but usually around a 100-110 cols.
Jul 22 '05 #7
On Thu, 01 Apr 2004 16:09:19 GMT, "Mike Wahler" <mk******@mkwahler.net>
wrote:

"John Doe" <jo*****@nowhere.com> wrote in message
news:c4**********@news.vanderbilt.edu...
I write code as long as 250+ columns sometimes (when the code refers to
a single concept), and I don't understand why people complain about
that. Just use the word wrap, right?

People who write 80 columns force everybody else in the world to see
their code in a narrow stripe of screen, when almost every programmer
nowdays has 1280x1024+ screen resolution. Many have 1600+!

If the algorithm does not fit into one screen, you are going to make
mistakes when writing or reading it. Losing 2/3 of the screen to stay
into 80 charachters seems nonsense to me.
Warning: Today is April 1.


Damn, Mike, you just took all the wind out of the sails of my righteous
indignation ;-)
-leor

-Mike


--
Leor Zolman --- BD Software --- www.bdsoft.com
On-Site Training in C/C++, Java, Perl and Unix
C++ users: Download BD Software's free STL Error Message Decryptor at:
www.bdsoft.com/tools/stlfilt.html
Jul 22 '05 #8
red floyd wrote:
[rant deleted]
sorry, I thought I had turned on line wrapping but my reader (moz 1.6)
is showing it extended to 250 lines :-)
Kind of ironic, i guess...
Jul 22 '05 #9
On Thu, 01 Apr 2004 16:23:22 GMT, red floyd <no*****@here.dude> wrote:
[RANT type="old-geezer"]
These darned kids and their newfangled screens! Why back in my day, we
had to punch our programs onto Hollerith cards!
[RANT type="older-geezer?"]
But I bet you never had to pencil in your Hollerith codes onto bubble cards
and wait 4-5 days for them to travel to the computer and back...before you
could begin to fix your /bubbling/ errors ...
[/RANT]

And we had to walk
fifteen miles to do it... In a raging snowstorm... Uphill... Both ways!
And we were glad to do it, too! And we didn't have no fancy "computers"
neither! We had to run them by hand! Darned kids... rassum fassum
mumble grumble.
[/RANT]


--
Leor Zolman --- BD Software --- www.bdsoft.com
On-Site Training in C/C++, Java, Perl and Unix
C++ users: Download BD Software's free STL Error Message Decryptor at:
www.bdsoft.com/tools/stlfilt.html
Jul 22 '05 #10
Leor Zolman wrote:
On Thu, 01 Apr 2004 16:23:22 GMT, red floyd <no*****@here.dude> wrote:

[RANT type="old-geezer"]
These darned kids and their newfangled screens! Why back in my day, we
had to punch our programs onto Hollerith cards!

[RANT type="older-geezer?"]
But I bet you never had to pencil in your Hollerith codes onto bubble cards
and wait 4-5 days for them to travel to the computer and back...before you
could begin to fix your /bubbling/ errors ...
[/RANT]


Yeah! I did! Back in '75 my Jr. High sent out bubble cards! I wanted
to be '1337, though (OK, so back then we didn't use 1337-sp33k), and I
ran a job that created a bunch of custom $JOB cards, so I didn't have to
waste one bubble card with the $JOB bubble filled in!
Jul 22 '05 #11
On Thu, 01 Apr 2004 17:47:42 GMT, red floyd <no*****@here.dude> wrote:
Leor Zolman wrote:
On Thu, 01 Apr 2004 16:23:22 GMT, red floyd <no*****@here.dude> wrote:

[RANT type="old-geezer"]
These darned kids and their newfangled screens! Why back in my day, we
had to punch our programs onto Hollerith cards!

[RANT type="older-geezer?"]
But I bet you never had to pencil in your Hollerith codes onto bubble cards
and wait 4-5 days for them to travel to the computer and back...before you
could begin to fix your /bubbling/ errors ...
[/RANT]


Yeah! I did! Back in '75 my Jr. High sent out bubble cards! I wanted
to be '1337, though (OK, so back then we didn't use 1337-sp33k), and I
ran a job that created a bunch of custom $JOB cards, so I didn't have to
waste one bubble card with the $JOB bubble filled in!


Guess I lost the bet ;-)
I think it was 1974 I did it first (Hollywood High School). I rapidly
discovered free keypunch facilities at LACC down the street, and USC's. At
USC's Keck Management school they'd let /anyone/ come in off the street and
hack their VDTs. One day I left a BASIC program running to calculate the
square root of 5 to a few hundred places for a project a math teacher was
doing on Chi, and when I returned (it had been running about four hours by
then), there was a crowd around the screen. I had to shove through with my
pad and paper to get to the front and copy down all the digits /very
carefully/ (I guess they either didn't have printers or I didn't want to
have to slither up to the pick-up window and identify myself as the user of
an account I'd peeked at someone typing the password to...)
-leor
--
Leor Zolman --- BD Software --- www.bdsoft.com
On-Site Training in C/C++, Java, Perl and Unix
C++ users: Download BD Software's free STL Error Message Decryptor at:
www.bdsoft.com/tools/stlfilt.html
Jul 22 '05 #12
John Doe wrote:
I write code as long as 250+ columns sometimes (when the
code refers to a single concept), and I don't understand
why people complain about that. Just use the word wrap,
right?

People who write 80 columns force everybody else in the
world to see their code in a narrow stripe of screen,
when almost every programmer nowdays has 1280x1024+
screen resolution. Many have 1600+!

If the algorithm does not fit into one screen, you are
going to make mistakes when writing or reading it. Losing
2/3 of the screen to stay into 80 charachters seems
nonsense to me.


I like to stay within 72 columns in case Fortran 77 makes a
comeback and I have to port all of my code.
Jul 22 '05 #13
> You can't see all 250 cols at once, right?

Personally, I do not like horizontal scrolling and find that the editor word
wrap feature is pretty weak w/ no customizability (at least in the editor that
I use).

I try to keep it within the general confines of my displayed page, which is
pretty subjective, but usually around a 100-110 cols.


I can see about 185 chars with Lucida Console size 9, 1600x1200
resolution, Visual Studio; but I can arrive at 250 with size 7 and
Lucida Console is still readable enough. It's just that I'm currently
with a 15" laptop so size 9 is ok.

Lucida console is THE font for programming!!
Seems a bit a strange font at first, but after a couple of days you will
never go back from Lucida Console.
Jul 22 '05 #14
Leor Zolman wrote:
I guess if the result of your editor's word-wrapping algorithm is
acceptable to you, party down. Will that also be the case, though, with
everyone who may ever need to view your code?
This might be a problem of the word wrapper not being smart enough with
aligning the indentation, but it's not a flaw in my reasoning.

You mean that the reason for which everybody in the world codes in 80
chars is because nobody spent a couple of hours for implementing the
indentation in the word wrappers?

Please don't say that! :-)

For me, to be able to fit more than about 130 characters on my
(1400-pixel-wide) screen would require reducing the font size to something
my 45-year-old eyes would not enjoy trying to read (I get enough headaches
as it is, thank you very much). Not to mention the fact that I may want to
fit another window next to my editor while editing (or at least be able to
see some portion of it)
Then please try the Lucida Console font for 2 days.
Looks a bit strange at first but after a couple of days you will never
leave that font anymore. It's THE font for programming.

It seems a font for doing OCR: crazily readable after your brain gets
used to it. I guess it can certainly improve your headache. It's
readable up to size 7. I use 9, you can try 10 if you have headaches...
even at size 10 you will definitely go over 130 chars per line even with
side windows
What about printing?


Yeah it's not intended for printing.
But... who prints the programs anymore anyway?
Jul 22 '05 #15
On Thu, 01 Apr 2004 12:59:59 -0600, John Doe <jo*****@nowhere.com> wrote:
Leor Zolman wrote:
I guess if the result of your editor's word-wrapping algorithm is
acceptable to you, party down. Will that also be the case, though, with
everyone who may ever need to view your code?
This might be a problem of the word wrapper not being smart enough with
aligning the indentation, but it's not a flaw in my reasoning.

You mean that the reason for which everybody in the world codes in 80
chars is because nobody spent a couple of hours for implementing the
indentation in the word wrappers?

Please don't say that! :-)


No, I wouldn't say that; I think folks code in 80 characters (or less!)
because it ends up being the least all evils. (Does this mean it /wasn't/
an April Fools post?)

For me, to be able to fit more than about 130 characters on my
(1400-pixel-wide) screen would require reducing the font size to something
my 45-year-old eyes would not enjoy trying to read (I get enough headaches
as it is, thank you very much). Not to mention the fact that I may want to
fit another window next to my editor while editing (or at least be able to
see some portion of it)
Then please try the Lucida Console font for 2 days.
Looks a bit strange at first but after a couple of days you will never
leave that font anymore. It's THE font for programming.


Heh. You're preaching to the choir. It's the one I already use, and tell
everyone else to every chance I get...if for no other reason than you can
tell '(' and ')' apart from '{' and '}' more easily than with most fonts at
lower font sizes.

It seems a font for doing OCR: crazily readable after your brain gets
used to it. I guess it can certainly improve your headache. It's
readable up to size 7. I use 9, you can try 10 if you have headaches...
even at size 10 you will definitely go over 130 chars per line even with
side windows
The numbers I quoted /were/ for Lucida font. YEMV (Your Eyesight May Vary).


What about printing?


Yeah it's not intended for printing.
But... who prints the programs anymore anyway?


Programmers? Actually, the thing I need to print the most is my STLFilt
package's Perl script...the one with 200+ character lines (don't ask) ;-)
-leor

--
Leor Zolman --- BD Software --- www.bdsoft.com
On-Site Training in C/C++, Java, Perl and Unix
C++ users: Download BD Software's free STL Error Message Decryptor at:
www.bdsoft.com/tools/stlfilt.html
Jul 22 '05 #16

"John Doe" <jo*****@nowhere.com> wrote in message
news:c4**********@news.vanderbilt.edu...
I write code as long as 250+ columns sometimes (when the code refers to
a single concept), and I don't understand why people complain about
that. Just use the word wrap, right?

People who write 80 columns force everybody else in the world to see
their code in a narrow stripe of screen, when almost every programmer
nowdays has 1280x1024+ screen resolution. Many have 1600+!

If the algorithm does not fit into one screen, you are going to make
mistakes when writing or reading it. Losing 2/3 of the screen to stay
into 80 charachters seems nonsense to me.

April fool's?
Jul 22 '05 #17
John Doe <jo*****@nowhere.com> wrote in message news:<c4**********@news.vanderbilt.edu>...
I write code as long as 250+ columns sometimes (when the code refers to
a single concept), and I don't understand why people complain about
that. Just use the word wrap, right?

People who write 80 columns force everybody else in the world to see
their code in a narrow stripe of screen, when almost every programmer
nowdays has 1280x1024+ screen resolution. Many have 1600+!

If the algorithm does not fit into one screen, you are going to make
mistakes when writing or reading it. Losing 2/3 of the screen to stay
into 80 charachters seems nonsense to me.

True, but exactly how long of a line do you need? And maybe stuff is
broken up on more than one line to make it readable?
Jul 22 '05 #18
Aye, you convey my thoughts nicely. As per hard copy, I do like to print
out sections of code that I need to go back and work on optimizing or adding
new functionality to it. So on paper, non-wrapped works well and is easy to
read. I do a lot of high-lighting on paper where I need to make changes.

Perry

"John Carson" <do***********@datafast.net.au> wrote in message
news:40******@usenet.per.paradox.net.au...
"John Doe" <jo*****@nowhere.com> wrote in message
news:c4**********@news.vanderbilt.edu
I write code as long as 250+ columns sometimes (when the code refers
to a single concept), and I don't understand why people complain about
that. Just use the word wrap, right?


Wordwrapped code is unreadable because it wrecks indentation.
People who write 80 columns force everybody else in the world to see
their code in a narrow stripe of screen, when almost every programmer
nowdays has 1280x1024+ screen resolution. Many have 1600+!


Many also use multi-window IDEs, so that the source code window is only a
fraction of the screen.
If the algorithm does not fit into one screen, you are going to make
mistakes when writing or reading it. Losing 2/3 of the screen to stay
into 80 charachters seems nonsense to me.


I find that I can only carefully check code on hardcopy. With a lot of
columns, the hardcopy will be wordwrapped and hence unreadable.
--
John Carson
1. To reply to email address, remove donald
2. Don't reply to email address (post here instead)

Jul 22 '05 #19
"John Doe" <jo*****@nowhere.com> wrote
I write code as long as 250+ columns sometimes
(when the code refers to a single concept), and
I don't understand why people complain about
that.
Be thankful they just complain. There are many places that would give you a
warning once and send you word-wrapping elsewhere on the second offense. :-)
Just use the word wrap, right?
Wrong.
People who write 80 columns force everybody else
in the world to see their code in a narrow stripe of
screen, when almost every programmer nowdays has
1280x1024+ screen resolution. Many have 1600+!
A lot of people still take printouts on their commute in to and out of work.
Many of these people like large fonts and sign the checks of the people with
the 1600+ screens. In order to continue getting their checks, the people
with the 1600+ screens often make an effort to satisfy their paper-toting
intransigent bosses.
If the algorithm does not fit into one screen, you are
going to make mistakes when writing or reading it.
Most editors have a line merge function. If word-wrapping is good enough for
the next guy, line-merging should be good enough for you.
Losing 2/3 of the screen to stay into 80 charachters
seems nonsense to me.


Not being able to compare two 500-column files side by side because someone
thought that everyone should edit code on a giant screen high-definition TV
is what's nonsense. Two 80-column files can be viewed/diff'ed comfortably
side-by-side on most screens and most programmers who do non-trivial work
end up doing that fairly often. When they do find lines that the can't
compare that way, you know what they do? They split them.

Reality is rude. It almost always intrudes on well-meaning daydreams.

Claudio Puviani
Jul 22 '05 #20
John Doe wrote:
I write code as long as 250+ columns sometimes (when the code refers to
a single concept), and I don't understand why people complain about
that. Just use the word wrap, right?

People who write 80 columns force everybody else in the world to see
their code in a narrow stripe of screen, when almost every programmer
nowdays has 1280x1024+ screen resolution. Many have 1600+!

If the algorithm does not fit into one screen, you are going to make
mistakes when writing or reading it. Losing 2/3 of the screen to stay
into 80 charachters seems nonsense to me.


Many people actually code to 70 columns or less. As Claudio pointed
out, this is for printing purposes. When we hold code reviews, we
send out hard-copies with line numbers so that everybody can refer
to the same line number. Reviews are very hard to conduct when the
code is truncated off of the right margin.

Why not the shorter width? A lot more lines (hmmm, improves those
Lines Of Code metrics) but compilers ignore all that whitespace.
One of the major tenets of programming is to make your program
readable, especially to people who don't have the exact same
workstation as you do.

--
Thomas Matthews

C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq: http://www.parashift.com/c++-faq-lite
C Faq: http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
http://www.raos.demon.uk/acllc-c++/faq.html
Other sites:
http://www.josuttis.com -- C++ STL Library book

Jul 22 '05 #21

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

Similar topics

20
by: John Doe | last post by:
I write code as long as 250+ columns sometimes (when the code refers to a single concept), and I don't understand why people complain about that. Just use the word wrap, right? People who write...
3
by: Nightcrawler | last post by:
I have a website that does the following: 1. it accepts a keyword through a textbox in the UI 2. once the submit button is clicked it goes out and spiders a few websites using the keyword...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.