Tabs
-
Taking off from the tabs vs spaces post few threads below, I was wondering why they were talking about tab = 8 spaces. Does it not make the code unreadable as it is too spaced out? When tab is set to 8 spaces: if (true) { // Indent of 1 tab = 8 spaces if (true) { // some thing here } } When tab is set to 4 spaces: if (true) { // Indent of 1 tab = 4 spaces if (true) { // some thing here } }
"It is easy to decipher extraterrestrial signals after deciphering Javascript and VB6 themselves.", ISanti[^]
-
Dan Neely wrote:
Find a plugin that can be configured to have exceptions for makefiles and anything else that's tool generated?
We didn't have to find another tool, just to reconfigure the one we had. But the first decision, to deny tabs from anything that consisted of plain text, has to be revised.
-
Taking off from the tabs vs spaces post few threads below, I was wondering why they were talking about tab = 8 spaces. Does it not make the code unreadable as it is too spaced out? When tab is set to 8 spaces: if (true) { // Indent of 1 tab = 8 spaces if (true) { // some thing here } } When tab is set to 4 spaces: if (true) { // Indent of 1 tab = 4 spaces if (true) { // some thing here } }
"It is easy to decipher extraterrestrial signals after deciphering Javascript and VB6 themselves.", ISanti[^]
-
The 8 space idea was around from the early days of Unix, and the only the terminals were basic teletypes (electric typewriters). I Have never understood why anyone thought that was a good idea on a device that generally could only print 80 characters across the page.
The 8 space tab was around long before UNIX. Manual typewriters had a tab key. It was a means to quickly jump across the page and to line up columns. So for a manual typewriter, the 8 space tab made more sense than a 4 space one. Today, it is like using the floppy icon for the save function. Historically it makes sense, but it is rather obsolete.
-
No, count semicolons.
-
Taking off from the tabs vs spaces post few threads below, I was wondering why they were talking about tab = 8 spaces. Does it not make the code unreadable as it is too spaced out? When tab is set to 8 spaces: if (true) { // Indent of 1 tab = 8 spaces if (true) { // some thing here } } When tab is set to 4 spaces: if (true) { // Indent of 1 tab = 4 spaces if (true) { // some thing here } }
"It is easy to decipher extraterrestrial signals after deciphering Javascript and VB6 themselves.", ISanti[^]
Since "way back", I have always used a 4 spaces tab setting on all C (and Perl, C++, etc) languages, 8 spaces tabs or no tabs on everything else. And so did pretty much everyone else in those days.
-
Taking off from the tabs vs spaces post few threads below, I was wondering why they were talking about tab = 8 spaces. Does it not make the code unreadable as it is too spaced out? When tab is set to 8 spaces: if (true) { // Indent of 1 tab = 8 spaces if (true) { // some thing here } } When tab is set to 4 spaces: if (true) { // Indent of 1 tab = 4 spaces if (true) { // some thing here } }
"It is easy to decipher extraterrestrial signals after deciphering Javascript and VB6 themselves.", ISanti[^]
I believe the convention goes back typewriters, which may have picked it up from typesetting. Approximately 80 characters per typewritten line on a standard sheet of paper. If you break that into 10 columns (so you can make tables), you start a new column every 8 characters. So when typing a table, you would enter something, hit the tab key which would take you over the "remaining" amount of the 8 characters, then type your next column. If you just hit the tab key, you went over 8 characters to leave that entry in the column blank. Come on people - I'm not the only "old fart" around here. Surely I'm not the only one that learned to type on a typewriter rather than a teletype or PC keyboard!
-
The 8 space idea was around from the early days of Unix, and the only the terminals were basic teletypes (electric typewriters). I Have never understood why anyone thought that was a good idea on a device that generally could only print 80 characters across the page.
Okay, TABS existed because Word Processing was text based, and there were no common spreadsheets. The ONLY way to create stuff that LINED UP properly was to use tabs. Not as horrible with a FIXED font, but if you were using a regular font. I DARE you to try to line things up with spaces! And in this environment, 8 spaces was EXACTLY 10% of the row, which made the math easy to deal with. We used this to HAND TYPE The student Graduation Lists in High School. And amazingly enough, we had paper terminals, but created an adapter to connect a Brother typewriter and "print" to it like a terminal, and got the text to line up and look nice! (We were working on a PDP-11 and our paper terminals were dot-matrix, 300 baud, unidirectional LA36). FINALLY, a normal typewriter (where this all started) had the same thing, but I think the fancy ones would let you set the TABSTOPS (like you can in Word). Getting 4 columns of names out took planning (Some kids had LONG names, LOL). The NEXT level of Word Processing looked like Markdown does today! There was NO WYSIWYG.
-
Richard MacCutchan wrote:
C,C++ and C# it goes on the next line under the "i" character.
At least for C++--the others are irrelevant dreck--you are correct, and people should harken to someone so venerable. :)
If you use a laptop or desktop computer made in the past few years, your operating system likely relied on a UEFI BIOS written almost entirely in "C" to detect and program the hardware. I would hardly call that irrelevant dreck! ;)
FormerBIOSGuy
-
If you use a laptop or desktop computer made in the past few years, your operating system likely relied on a UEFI BIOS written almost entirely in "C" to detect and program the hardware. I would hardly call that irrelevant dreck! ;)
FormerBIOSGuy