Stories
Slash Boxes
Comments

SoylentNews is people

posted by n1 on Sunday June 18 2017, @12:22AM   Printer-friendly
from the not-your-bar-tab dept.

Submitted via IRC for TheMightyBuzzard

The annual Stack Overflow developer surveys often include lots of bad news. "People still use PHP," for example, is a recurring and distressing theme. "Perl exists" is another.

But never before has the survey revealed something as devastatingly terrible as the 2017 survey. Using PHP and Perl are matters of taste. Extremely masochistic taste, certainly, but nobody is wrong for using those languages; it's just the programming equivalent of enjoying Adam Sandler movies. But the 2017 survey goes beyond taste; it goes into deep philosophical questions of right and wrong, and it turns out that being wrong pays more than being right.

Developers who use tabs to indent their code, developers who fight for truth and justice and all that is good in the world, those developers have a median salary of $43,750.

But developers who use spaces to indent their code, developers who side with evil and probably spend all day kicking kittens and punching puppies? Their median salary is $59,140.

Source: ArsTechnica


Original Submission

 
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: 0) by Anonymous Coward on Sunday June 18 2017, @03:32AM (7 children)

    by Anonymous Coward on Sunday June 18 2017, @03:32AM (#527308)

    Is there actually a good reason to use spaces

    If you ever use whitespace to align things not at the start of the line, varying tab stops will break shit.

    Examples of this include right-side comments:

    void function(int arg) {
        int a=1;          //These initial guesses are selected to
        int b=99;         //minimize worst-case error at 3rd iteration.
        int c=5;          //Don't mess with them!
        ...
    }

    Or aligned arguments:

        printf("Great %s string that would make this line too %s long.\n",
               vulgarity ? fucking[rn2(fucking_max+1)] : bleeping[rn2(bleeping_max+1)],
               vulgarity ? fucking[rn2(fucking_max+1)] : bleeping[rn2(bleeping_max+1)]);

    Now you can argue either of those is a bad practice in itself, but even if so, using tabs makes them worse, while using spaces doesn't compound the problem. And of course, you could address these by using tabs (for initial indentation) + spaces (anywhere else), but to me any form of tabs+spaces is the worst of all options.

  • (Score: 2) by The Mighty Buzzard on Sunday June 18 2017, @03:57AM (6 children)

    but to me any form of tabs+spaces is the worst of all options

    Exactly, so use each where they belong. Tabs indent, spaces separate. If you're using either for the purpose of the other, you are wrong.

    --
    My rights don't end where your fear begins.
    • (Score: 2) by deimtee on Sunday June 18 2017, @06:09AM (2 children)

      by deimtee (3272) on Sunday June 18 2017, @06:09AM (#527368) Journal

      You need a law that says "No text editor or IDE will allow the combination of characters {Carriage Return}{Space} or {Carriage Return}{LineFeed}{Space}".

      --
      If you cough while drinking cheap red wine it really cleans out your sinuses.
      • (Score: 2) by The Mighty Buzzard on Sunday June 18 2017, @10:23AM

        Nah, not a law. Just an exemption in the law to allow battering anyone caught inserting such into code about the head and shoulders.

        --
        My rights don't end where your fear begins.
      • (Score: 2) by FatPhil on Monday June 19 2017, @05:27AM

        by FatPhil (863) <pc-soylentNO@SPAMasdf.fi> on Monday June 19 2017, @05:27AM (#527743) Homepage
        That you have such a visceral hate for
        /**
         * This is a long comment, the * at the beginning of the text
         * on these lines is optional.
         */
        is perverse. (And I hope that comes out as intended, preview was showing that slash is reformatting things.
        --
        Great minds discuss ideas; average minds discuss events; small minds discuss people; the smallest discuss themselves
    • (Score: 2) by romlok on Sunday June 18 2017, @12:38PM (1 child)

      by romlok (1241) on Sunday June 18 2017, @12:38PM (#527436)

      I wonder if it might help people grasp the concept, if we started calling the "hard tab" character an "indent" instead.

      As in: "I press my Tab key, and it outputs a single indent character".

    • (Score: 0) by Anonymous Coward on Sunday June 18 2017, @03:10PM

      by Anonymous Coward on Sunday June 18 2017, @03:10PM (#527479)

      Exactly, so use each where they belong. Tabs indent, spaces separate.

      Tabs to indent and spaces to format and separate. The only way this works is if you have visible whitespace. But with this setup you can have any number of spaces for tabs and formatting will work in ALL cases.

      Then again, emacs lovers do not like any tabs :/