C++: why 80 charachters??

J

John Doe

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.
 
M

Min,Lee

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...
 
L

Leor Zolman

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
 
M

Mike Wahler

John Doe said:
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
 
J

John Carson

John Doe said:
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.
 
R

red floyd

John said:
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]
 
J

Julie

John said:
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.
 
R

red floyd

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...
 
L

Leor Zolman

[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]
 
R

red floyd

Leor said:
[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!
 
L

Leor Zolman

Leor said:
[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
 
J

John Doe

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.
 
D

Derek

John said:
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.
 
J

John Doe

Leor said:
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?
 
L

Leor Zolman

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?)
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).
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
 
X

Xenos

John Doe said:
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?
 
P

PlasmaDragon

John Doe said:
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?
 
P

Perry S. Morris

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
 
C

Claudio Puviani

John Doe said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Short Questions on C++ 6
terminal designed for C 47
Why C? 33
Why replaceSelection in JTextPane is not behaving safely? 4
Why C? 33
Why Python 3? 5
c 0
untold truth about C++ 3

Members online

Forum statistics

Threads
474,164
Messages
2,570,898
Members
47,439
Latest member
shasuze

Latest Threads

Top