Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^4: [RFC] Review of module code and POD (tab)

by LanX (Saint)
on Apr 03, 2021 at 11:23 UTC ( [id://11130766]=note: print w/replies, xml ) Need Help??


in reply to Re^3: [RFC] Review of module code and POD
in thread [RFC] Review of module code and POD

> In both courses in the 1990's ... Is this a case of academia being out of touch

The problems of the tab character "\t" were not as apparent in the 1990s like they were later.

Different contexts have different indentation settings, while most people agree on 4 columns nowadays, do most apps default to 8 columns, which used to be standard.

The chaos starts if people mix tab with space and everything looks perfectly indented in their own editor, but once it's opened with another editor ... or posted to perlmonks, it becomes a mess (yes browsers default to 8).

I actually use the tab-key for indentation, but my editor has a setting to insert space. And a command to "untabify" foreign code.

One benefit of "\t" is that it can be easily reverted with one backspace instead of four. But again, this can be fixed with modern editors and I use automatic indentation anyway.

And I wasn't talking about semantic effects.

Perl code is thankfully resilient against "\t" vs " " confusion, and whitespace rarely matters.

But ask the Pythonistas what they think was Guido's biggest design error...

In short: Academics in the 2020 wouldn't say this anymore.

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

Replies are listed 'Best First'.
Re^5: [RFC] Review of module code and POD (tab)
by eyepopslikeamosquito (Archbishop) on Apr 03, 2021 at 23:02 UTC

    As described nicely in this blog, the pro-TABS camp (including golang) exhort you to use TABs for indentation only, never for alignment:

    It's very important to only use spaces for alignment. Never, ever, use tabs for alignment. Tabs may be used for indentation only.
    I suspect this important distinction was not widely known in the 1990s, at least I don't remember it being mentioned back then.

      I don’t know about programming but even in the 80s—and probably at least the 60s when the Selectric entered the game—tabs in typing and typesetting were format control signifiers without a predefinition; set by document, style declaration, or even a single line. They had no set spacing or even justification. These are all valid tabs and part of why I think tabs have no business in code.

      [one tab]Text… [one tab]Text… [one tab]Longer… [one tab]Text… [one tab]Longer text…
        They had no set spacing or even justification.

        That brings back memories of a school project whereby I typed up quite a bit of text fully justified - using my mother's manual Remington typewriter from the 1930's...IIRC each line was typed out once to work out where the extra spaces would be least noticeable and then typed again justified. Because of the tedium and probably frequency of mistakes, I think I did it a small amount at a time, cut the section out and glued it to a bigger sheet of paper...

      AFAIK does golang have a fixed opinionated formatting everybody must accept and the formatter is built-in.

      In this rigid case you are free to do this, and every body can decide which tab size he wants when reading golang code.

      In our case this would equate to force all code posted on PM thru perltidy with fixed settings.

      Cheers Rolf
      (addicted to the Perl Programming Language :)
      Wikisyntax for the Monastery

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11130766]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (4)
As of 2024-03-28 15:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found