Stories
Slash Boxes
Comments

SoylentNews is people

This discussion has been archived. No new comments can be posted.
Display Options Threshold/Breakthrough Mark All as Read Mark All as Unread
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
  • (Score: 2) by DannyB on Wednesday March 23 2022, @03:43PM (1 child)

    by DannyB (5839) Subscriber Badge on Wednesday March 23 2022, @03:43PM (#1231445) Journal

    What is the argument for spaces?

    Some programming languages have significant white space indentation.

    Being politically incorrect, they make no allowance for other colors of indentation space.

    I propose that curly brace languages should ALSO require proper whitespace indentation; lack of which is a fatal compile time error.

    What does it actually bring?

    More keystrokes to get same indentation as tabs.

    The ability to force others to read the code with your preferred indentation? If that is your motivation, you're kind of a control freak.

    Back in the early 1980s, using Pascal, we indented with spaces because it was the only option. Yes, really. (UCSD p-System) We didn't consider this to be a problem as we uncivilized primitive 20th century savages knew no better.

    When I began doing Macintosh development in 1984, using a Mac XL running on a Lisa computer, I was able to use Tabs. (Still using Pascal, but compiled directly to 68000 machine code.) I never looked back at spaces. Took a bit of getting used to. But it was a welcome change to tabs.

    --
    To transfer files: right-click on file, pick Copy. Unplug mouse, plug into other computer. Right-click paste.
    Starting Score:    1  point
    Karma-Bonus Modifier   +1  

    Total Score:   2  
  • (Score: 3, Interesting) by FatPhil on Friday March 25 2022, @10:06AM

    by FatPhil (863) <{pc-soylent} {at} {asdf.fi}> on Friday March 25 2022, @10:06AM (#1231996) Homepage
    > > What does it actually bring?
    >
    > More keystrokes to get same indentation as tabs.

    Nope. You've conflated the data entered and the mechanism for enterring that data. There's nothing to prevent a text editor from, like typewriters of yore, responding to a single 'tab' keystroke by inserting enough spaces to take it to the next tabulation mark. And in fact, that's not an uncommon feature in editors.

    Emacs:
    """
    If you prefer, all indentation can be made from spaces only. To request this, set the buffer-local variable indent-tabs-mode to nil.
    """ -- https://www.gnu.org/software/emacs/manual/html_node/emacs/Just-Spaces.html

    Vim:
    """
    expandtab and noexpandtab

    Enabling this option via the set command will insert the appropriate number of spaces when in insert mode.
    """ -- https://federico-lox.github.io/development/tabs-stop-the-truth-about-vim-tab-spaces.html
    --
    Great minds discuss ideas; average minds discuss events; small minds discuss people; the smallest discuss themselves