Tabs -vs- Spaces: Tabs should have won.

G

Gregory Ewing

Steven said:
Why 78? Because it's one less than 79, as mandated by PEP 8, and two less
than 80, the hoary old standard.

There's another possible reason for the number 78, although
hopefully it doesn't still apply today.

There's an application I work with that stores free text
in database records of 78 chars each. I suspect it's
because early versions go back to the MS-DOS era, when
it was common to make windows out of box-drawing characters.
80 columns minus two border chars equals 78!
 
T

tinnews

Roy Smith said:
Ian Kelly said:
the line width mandate [...] exists so that people using 80-column editors can open up
code without having line-wrapping problems.

Heh. I don't know how many other people on this group grew up with the
original(*) 80-column editor (http://tinyurl.com/3sj4mzb), but I did.
Unlike, well, any editor anybody is likely to use today, it was really,
really hard to make the window wider if you had to.

We don't have that problem any more. It truly boggles my mind that
we're still churning out people with 80 column minds. I'm willing to
entertain arguments about readability of long lines, but the idea that
there's something magic about 80 columns is hogwash.
The reason for an 80 column limit is not fundamentally down to screen
width (as was) it's that our eyes find it much easier to follow lines
with a limited length and 80 columns is somewhere around the right
line length to keep things easily readable.
 
T

Tim Chase

I agree! Which is why I set my line width to 78 columns.

Bah, when I started programming
on the Apple ][+, we had no
lower-case and a 40-column limit
on the TV display.
But you try and tell the young
people today that...
and they won't believe ya'.

-tkc

(expecting somebody to come back with a bit more retro-computing
Four Yorkshiremen bit..."spinning 360k 5.25" floppy drives? We
should be so lucky. I had to hand jump 2000-amp bits with only my
tongue, for a CPU architecture invented by Navajo code-talkers...")
 
P

python

Bah, when I started programming
on the Apple ][+, we had no
lower-case and a 40-column limit
on the TV display.

Keyboards??? That was a luxery!
We had mechanical switches that one
had to physically push and pull to
enter commands.

And a 40 column display???
Unheard of! We were happy with
several miniature flashlight bulbs!

But you try and tell the young
people today that...
and they won't believe ya'.

Fond memories!

Malcolm

Ref:

http://totallytrygve.com/computer.php?item=188&picture=0
http://www.logikus.info/english.htm
http://oldcomputermuseum.com/logix_kosmos.html
http://www.classiccmp.org/pipermail/cctech/2007-October/086682.html
http://www.computerhistory.org/collections/accession/102621921
http://www.classiccmp.org/dunfield/ (scanned manual)
 
G

gene heskett

I agree! Which is why I set my line width to 78 columns.

Bah, when I started programming
on the Apple ][+, we had no
lower-case and a 40-column limit
on the TV display.
But you try and tell the young
people today that...
and they won't believe ya'.

-tkc

(expecting somebody to come back with a bit more retro-computing
Four Yorkshiremen bit..."spinning 360k 5.25" floppy drives? We
should be so lucky. I had to hand jump 2000-amp bits with only my
tongue, for a CPU architecture invented by Navajo code-talkers...")

No, but my first computer was an RCA Cosmac Super Elf, with a 6 digit led
display. I added another 4k of static ram ($400 for the s100 board kit,
and about $100 for the S-100 4 slot backplane, and about $125 for a cash
register style cabinet that I hid the rest of the hardware, including a 6
volt gell cell for backup battery in) This had an RCA 1802 CPU which had a
very interesting architecture.

Writing, in machine code entered through its monitor, a program that drove
the rest of the hardware and connected to the remote controls of the U-
Matic tape machines of the day, including the display hardware I built from
scratch with mostly TTL parts, it was replacing the most labor intensive
step in preparing a commercial for use with an Automatic station break
machine by applying a new frame accurate academy leader and the tones to
control it directly to the finished commercial tape. That automated a very
timing critical step, and removed a dub cycle from commercial production at
KRCR in 1979, and was still in use in 1994 the last time I checked. How
many of our code projects can make that claim?

I still have a paper copy of the code in a bag on the top shelf.

Interesting sidelight here. In 1980, Microtime brought a much more
primative device to do that to the NAB show, which I stopped and looked at,
and when I could control my laughing, said I had already done that,
functionally far better than this attempt. Since they are as lawyer top
loaded as Apple, I guess they assumed I had also copyrighted and patented
it, so it was gone the next day & they wouldn't even admit they had had it
the day before.

In 1987 I made a better version of the EDISK that Grass Valley sold as an
accessory for the 300 series video production switchers, for $20,000.
Theirs had a 2 digit display for file names & ran at 1200 baud.
Mine had a whopping 32 column display and english filenames and ran at 4800
baud, running on a TRS-80 Color Computer, I had $245 in the hardware. It
was still in use when I retired in 2002, but when that forced a replacement
of the 300 because of custom parts availability, the new CE gave me back
the old machine. I still have it, and several more of them. The 6809 was
not the crippled, drain bamaged processor the 6502 was.

OS-9, the color computers multiuser/multitasking OS, has now grown to also
execute on the hitachi 6309 cpu chip, and is about 2x faster now than then,
and we now call it Nitros9. That is essentially todays linux, running on
an 8 bit bus, and was my teacher, causing me to only have one legal winderz
install in the house ever as it was on the laptop (XP) I bought quite a few
years back now. Long since history, that machine has had linux on it for
about 6 years now.

FWIW, I met one of the code talkers when I was the CE at KIVA-TV in the
late 70's. That was another example of how we have screwed the "First
Americans' and I had better not get started.

Cheers, gene
--
"There are four boxes to be used in defense of liberty:
soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Beneath this stone lies Murphy,
They buried him today,
He lived the life of Riley,
While Riley was away.
 
S

Steven D'Aprano

Tim said:
I agree! Which is why I set my line width to 78 columns.

Bah, when I started programming
on the Apple ][+, we had no
lower-case and a 40-column limit
on the TV display.
But you try and tell the young
people today that...
and they won't believe ya'.

40 columns? Luxury! My first computer was a Hewlett Packard 28S handheld
programmable calculator, with 22 columns[1] and 32 entire kilobytes of
memory!

(I don't include my previous programmable calculator, a Casio, or was it a
Canon, as the programming language included wasn't Turing Complete.)



[1] I think it was 22 columns -- that's what my HP 48GX has, and I'm sure
the 28S screen was no larger.
 
A

Anssi Saari

Thorsten Kampe said:
The "perfect programming font" is just the one that looks so good that
you would also use it for writing email. Dejavu Sans Mono is pretty
good. Consolas looks also looks good but it is Windows only.

How is Consolas Windows only? Not that I'd put it in my Windows-free
systems, but I don't see why you couldn't? Everything uses TrueType
fonts now.

I use a font called Dina on this laptop in Emacs. Not pretty but very
readable, has a slashed zero and the wide characters are clearly
separated, so something like www looks like three ws, not a block of
triangle wave.
 
T

Thorsten Kampe

* Anssi Saari (Mon, 18 Jul 2011 19:28:49 +0300)
How is Consolas Windows only? Not that I'd put it in my Windows-free
systems, but I don't see why you couldn't?

"Consolas ships with all versions of Windows Vista and Windows 7,
including Home Basic. If you’re using Visual Studio 2005, you can
download Consolas from Microsoft. If not, you still may be able to use
the font, though your mileage may vary. I was able to install it on a
Windows XP SP1 machine that doesn’t have any version of Visual Studio.
This PC does have the Microsoft .NET Framework SDK which creates various
“Microsoft Visual Studio†folders under “Program Filesâ€. These may cause
the Consolas installer to think I do have VS 2005. I got no error
messages, and the font was instantly available in all applications.

Another way to get Consolas is to download and install the free
PowerPoint Viewer 2007 from Microsoft. This works on any computer with
Windows 2000 SP4 or Windows XP SP1 or later. In addition to the
PowerPoint Viewer 2007 itself, the installer will install the following
fonts: Calibri, Cambria, Candara, Consolas, Constantia and Corbel. Only
the Consolas font is monospaced. All these fonts ship with Windows Vista
and Windows 7."

http://www.editpadpro.com/fonts.html
 
T

Thomas 'PointedEars' Lahn

Gregory said:
Most editors can be configured to do that.
True.

Where they fall down, in my experience, is that having inserted
those spaces, if you want to delete them you typically have to
backspace over them one at a time.

Now that's a BAD source code editor! Try one running on the Eclipse
platform, like PyDev (single plugin or in Aptana, also as Eclipse plugin).
But, even vim(1) has auto-indent *and* `<<', so …
I don't enjoy that experience, which is why I have BBEdit Lite
set up to use tab-only indentation. If I'm feeling conscientious,
I convert to spaces before sharing the code with others. But tabs
work better for me given the tools I use and the way I like to
work.

YMMV, of course.
 
M

MRAB

Tim Chase said:
Roy Smith wrote:
We don't have that problem any more. It truly boggles my
mind that we're still churning out people with 80 column
minds. I'm willing to entertain arguments about readability
of long lines, but the idea that there's something magic
about 80 columns is hogwash.

I agree! Which is why I set my line width to 78 columns.

Bah, when I started programming
on the Apple ][+, we had no
lower-case and a 40-column limit
on the TV display.
But you try and tell the young
people today that...
and they won't believe ya'.

Acorn System One: 9 character 7 segment led display and 25 key keypad, 1Kb
RAM, 512 bytes ROM.
1KB RAM? Wow!

Science of Cambridge Mk14, with extra RAM and I/O chip, total of 640
bytes (some reserved for monitor program).

Main RAM at 0xF00..0xFFF, extra RAM at 0xB00..0xBFF, I/O RAM somewhere
else...
 
T

Thomas 'PointedEars' Lahn

Anssi said:
How is Consolas Windows only? Not that I'd put it in my Windows-free
systems, but I don't see why you couldn't?

Consolas is _not_ free software, hence Inconsolata which is.
"Windows-only" is too strong a classification for Consolas, though.
Everything uses TrueType fonts now.

Rather OpenType, but that is beside the point.
 
A

Anders J. Munch

Thomas said:
I am getting the idea here that you mean the right thing, but that you
explain it wrong.

Feel free to write the much longer essay that explains it all unambiguously, I'm
not going to.

regards, Anders
 
D

Dotan Cohen

On Mon, Jul 18, 2011 at 02:55, Andrew Berg > I think the reason the
idea isn't dead is because of the emergence of
new devices with small displays (tablets/smartphones/etc.) and their
increasing popularity. When writing code that is meant to be run on
desktops or servers, the 80-column limit is mostly irrelevant, but
Python running on these small devices, especially with Python code being
interpreted rather than compiled, it's convenient to edit code on those
platforms, where there is a significant column limit.

Let me see if I understand: because there exists a possibility that
someone might want (not need) to edit code on a telephone to make a
quick edit to code being interpreted on that machine, _all_ Python
code should limit itself to a line width that may or may not wrap on a
telephone screen?

Is that the argument in favor of an 80-character line width?
 
A

Andrew Berg

-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160

Let me see if I understand: because there exists a possibility that
someone might want (not need) to edit code on a telephone to make a
quick edit to code being interpreted on that machine, _all_ Python
code should limit itself to a line width that may or may not wrap on
a telephone screen?

Is that the argument in favor of an 80-character line width?
I doubt that's /the/ argument. I speculated that it's one of the reasons
that a column limit still has relevance. I did not say that I thought
the argument had merit; I make no judgment either way. Also, I'm sure
more than quick edits are done on these phones. Depending on the focus
of the project, it may be best to do most, if not all testing on that
device.

Personally, I think that 80 is pretty arbitrary now, and not the best
limit. I'm more comfortable with 120-130 myself. In any case, Python
won't complain about how many characters are on a line, and that's the
way it should be.

- --
CPython 3.2.1 | Windows NT 6.1.7601.17592 | Thunderbird 5.0
PGP/GPG Public Key ID: 0xF88E034060A78FCB
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAwAGBQJOJIQ9AAoJEPiOA0Bgp4/LhgUH/iFWmSZXw9Rw0SyHpRZ4gPvb
WahJhf3j0bAnWnJWueAMgzgTMzuZv/6V6x8Yka/KewjBk5/coIsCNHgL+LR8rrat
YbN3FTQneuTlwtkj+2wQV+pQEQM6i2eVs50TEji98NW1jqtwW3UxhT/x4efaUHtc
9iHZRZTqmNMlXJWfRgfD6mC0bHGGAUTadyetGHicdZYy+AIo8Di7tObd5SwuQxIM
8U7aRkupiOpRaUj3YXXsIuWeio+SirpnJiVdWadBbgsdBSjI8jJl2MqXq52BieA6
5avnDGA+6575+1GNTaLXHNyFpgNkTUXCb5cOf3TP6zk0q9EtNxYY9dxQ8QJmdU8=
=sKG0
-----END PGP SIGNATURE-----
 
C

Chris Angelico

Personally, I think that 80 is pretty arbitrary now, and not the best
limit. I'm more comfortable with 120-130 myself. In any case, Python
won't complain about how many characters are on a line, and that's the
way it should be.

It's a question of policy, which is in the purview of the maintainer
of the codebase. But since Python itself has a lot of Python code, the
policy applied to its standard library is going to be looked at by
everyone as having special status.

ChrisA
 
R

Roy Smith

Duncan Booth said:
Tim Chase said:
Roy Smith wrote:
We don't have that problem any more. It truly boggles my
mind that we're still churning out people with 80 column
minds. I'm willing to entertain arguments about readability
of long lines, but the idea that there's something magic
about 80 columns is hogwash.

I agree! Which is why I set my line width to 78 columns.

Bah, when I started programming
on the Apple ][+, we had no
lower-case and a 40-column limit
on the TV display.
But you try and tell the young
people today that...
and they won't believe ya'.

Acorn System One: 9 character 7 segment led display and 25 key keypad, 1Kb
RAM, 512 bytes ROM.

HP-9810. http://www.hpmuseum.org/98xx/9810n3qs.jpg.

BTW, if anybody has one of these in working condition that they want to
get rid of, let me know. I'd love to play with one again.
 

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

Members online

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top