Stories
Slash Boxes
Comments

SoylentNews is people

SoylentNews is powered by your submissions, so send in your scoop. Only 14 submissions in the queue.

Idiosyncratic use of punctuation - which of these annoys you the most?

Displaying poll results.
Declarations and assignments that end with }; (C, C++, Javascript, etc.)
  4% 3 votes
(Parenthesis (pile-ups (at (the (end (of (Lisp (code))))))))
  11% 8 votes
Syntactically-significant whitespace (Python, Ruby, Haskell...)
  59% 43 votes
Perl sigils: @array, $array[index], %hash, $hash{key}
  9% 7 votes
Unnecessary sigils, like $variable in PHP
  4% 3 votes
macro!() in Rust
  1% 1 votes
Do you have any idea how much I spent on this Space Cadet keyboard, you insensitive clod?!
  1% 1 votes
Something even worse...
  8% 6 votes
72 total votes.
[ Voting Booth | Other Polls | Back Home ]
  • Don't complain about lack of options. You've got to pick a few when you do multiple choice. Those are the breaks.
  • Feel free to suggest poll ideas if you're feeling creative. I'd strongly suggest reading the past polls first.
  • This whole thing is wildly inaccurate. Rounding errors, ballot stuffers, dynamic IPs, firewalls. If you're using these numbers to do anything important, you're insane.
Display Options Threshold/Breakthrough Reply to Article 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.
(1)
  • (Score: 2, Interesting) by janrinok on Sunday October 13, @07:31AM (1 child)

    by janrinok (52) Subscriber Badge on Sunday October 13, @07:31AM (#1376786) Journal

    Unlike many here, I do not mind syntactic white space. In fact, I actually prefer languages that insist that they are laid out in a specific way. The reason for this is that we read code far more often than we write it. Looking at somebody else's code (or even one's own code sometime after it was written) can often be difficult until you get used to their style, and if the code has been worked on by several people that style can (but shouldn't ever) change part way through reading the file.

    Languages such as Python, Go and even .yml ensure that the style of the code changes as little as possible no matter who wrote it. Personally, that makes it much easier for me to get stuck in to groking someone else's code. Being able to pick up any Python or Go code and understand its structure is a great benefit to me. It saves me time.

    One complaint that I have heard against an enforced layout is that different companies have different requirements. However, modern day IDEs can cater for this and you can, within certain limits, modify the output slightly. They can also reformat any code you throw at them into a consistent specification. I know that some will now argue that their preferred editor does not support this or is more versatile, or whatever. Fine, you can carry on. I will probably not be looking at your code anyway so it will not affect me.

    YMMV.

    --
    I am not interested in knowing who people are or where they live. My interest starts and stops at our servers.
  • (Score: 5, Insightful) by VLM on Sunday October 13, @04:08PM (9 children)

    by VLM (445) on Sunday October 13, @04:08PM (#1376820)

    Syntactically-significant whitespace

    My main beef with syntactically significant whitespace is the annoyance when you inevitably experience bugs ranging from mere syntax errors up to serious control-flow issues because you hit the space bar only 7 times instead of 8 or you cut and pasted something with the "wrong" indentation and its just a PITA. Yeah yeah I heard it all about "use a better IDE" but its even MORE annoying when you're already using the better IDE and it epic fails anyway.

    Another serious annoyance is loser-style-IDEs where they surround a very small code window with crap that isn't code, and the feel you get when forced to edit while viewing the code thru a postage-stamp, the algo or code would be much clearer if you could see it all at the same time but now, you have to follow some stupid rule that makes the code harder to understand because you can't see it all.

    Finally some other languages can lint or format to highlight incorrect code. What I'm saying is you don't really gain anything by proper indentation of the wrong code. "Its the correct shape" isn't helpful if its the wrong thing. And I'm not sure "correct shape" is highlighting most important or most expensive to fix errors. I donno.. take your classic fencepost error; that can be beautifully indented, giving a false sense of security when the problem is you thought arrays start at index 0 instead of 1 or vice versa. "I got great news, I created a PITA to fix a problem you don't have via creating a problem you won't like"

    • (Score: 2) by turgid on Sunday October 13, @06:55PM (7 children)

      by turgid (4318) Subscriber Badge on Sunday October 13, @06:55PM (#1376835) Journal

      Another serious annoyance is loser-style-IDEs where they surround a very small code window with crap that isn't code, and the feel you get when forced to edit while viewing the code thru a postage-stamp, the algo or code would be much clearer if you could see it all at the same time but now, you have to follow some stupid rule that makes the code harder to understand because you can't see it all.

      Tell me about it.

      • (Score: 4, Informative) by janrinok on Sunday October 13, @07:14PM (6 children)

        by janrinok (52) Subscriber Badge on Sunday October 13, @07:14PM (#1376837) Journal

        I also agree.

        However, you can get good and bad IDEs for any language. Mine provides help when I want it but shows me just code when I tell it to. Literally just the code, and it is a single key-press to change between the two.

        --
        I am not interested in knowing who people are or where they live. My interest starts and stops at our servers.
        • (Score: 2) by turgid on Sunday October 13, @07:39PM

          by turgid (4318) Subscriber Badge on Sunday October 13, @07:39PM (#1376839) Journal

          I have had to start using VSCode and Visual Studio recently and I find them very unfriendly. I need to invest some time in learning how to configure them properly. The program source is full of lines and dots showing the indentation which I find and real pain in the neck. Then there are the incessant pop-ups offering to complete what I'm typing for me, interrupting my train of thought. By default, they only show one window of source. I usually have a minimum of three side-by-side and I can't stand having to fight with the IDE to get the layout of the windows I want.

          Finally, people who use these IDEs have some funny ideas about how to lay the source out on the disk. For example, having one directory ("folder") for the headers and another for the source regardless of what they're for.

          I am reminded of the Two Ronnies sketch where the books in the library are arranged by colour, not by title, author or content.

        • (Score: 2) by turgid on Sunday October 13, @07:43PM (4 children)

          by turgid (4318) Subscriber Badge on Sunday October 13, @07:43PM (#1376840) Journal

          Here it is. This is how people arrange source code nowadays [youtube.com]. I blame these IDEs.

    • (Score: 2) by Thexalon on Tuesday October 15, @10:12AM

      by Thexalon (636) on Tuesday October 15, @10:12AM (#1377075)

      For what it's worth, back when I was wrangling a lot of Python professionally, I found that a properly configured vim worked just fine for editing it: You just needed to set your tabs to = 4 spaces, and potentially add a check to convert any stray tab characters to spaces, and you were well on your way. So no need for really fancy stuff.

      --
      The only thing that stops a bad guy with a compiler is a good guy with a compiler.
  • (Score: 2) by VLM on Sunday October 13, @04:10PM (2 children)

    by VLM (445) on Sunday October 13, @04:10PM (#1376821)

    (Parenthesis (pile-ups (at (the (end (of (Lisp (code))))))))

    I'll give these people credit, you have to be a brave man to edit LISP code using vi or vim.

    If you use a real IDE like emacs or similar, there's parenthesis management modes to take care of it, if you're using an IDE and hitting shift-9 and shift-0 a lot you're probably using it wrong.

    • (Score: 0) by Anonymous Coward on Sunday October 13, @09:57PM

      by Anonymous Coward on Sunday October 13, @09:57PM (#1376857)

      And yet when people say the same thing about Python and other languages with syntactically-significant whitespace, all of a sudden those same arguments are just excuses.

    • (Score: 2) by RamiK on Tuesday October 15, @11:11AM

      by RamiK (1813) on Tuesday October 15, @11:11AM (#1377081)

      you have to be a brave man to edit LISP code using vi or vim

      Like emacs, Vim has distributions with extensions that integrate LSP support and tree-sitter to parenthesis issues and navigate by syntax.

      Regardless, new editors following tree-sitter* blur the lines between IDE and editors on this sorts of functionalities due to being able to understand the syntax trees and thus support navigation by tree elements (functions...) and open/close parenthesis automatically.

      * Zed, Lapce, Helix, Kakoune... Helix's keybindings in particular illustrate how tight tree-sitter integration leaves makes previous distinctions between IDEs and editors unclear: https://docs.helix-editor.com/keymap.html#unimpaired [helix-editor.com]

      --
      compiling...
  • (Score: 2, Insightful) by Opyros on Sunday October 13, @05:09PM (7 children)

    by Opyros (17611) on Sunday October 13, @05:09PM (#1376823)

    Does Ruby have syntactically significant whitespace? I hadn’t thought so.

    • (Score: 3, Touché) by janrinok on Sunday October 13, @06:09PM (2 children)

      by janrinok (52) Subscriber Badge on Sunday October 13, @06:09PM (#1376827) Journal

      Apparently not - but we cannot edit Polls unfortunately.

      I will ask the submitter to stand in the corner for 10 minutes facing the wall.

      --
      I am not interested in knowing who people are or where they live. My interest starts and stops at our servers.
      • (Score: 2) by Samantha Wright on Tuesday October 15, @03:23PM

        by Samantha Wright (4062) on Tuesday October 15, @03:23PM (#1377108)

        Guilty party here. I'm not sure why I thought Ruby had this. I have a vague inkling that I was thinking not just about indentation, but other forms of whitespace-sensitivity like whether or not you can put a space between a function name and its arguments list (e.g. function (arg), which is something some Java monkey might type intentionally).

    • (Score: 3, Informative) by janrinok on Sunday October 13, @06:15PM (1 child)

      by janrinok (52) Subscriber Badge on Sunday October 13, @06:15PM (#1376828) Journal

      Although I also found this:

      "According to the book Eloquent Ruby a sensible practice is to use two spaces per line for indentation since this is clearly an indent, but without using up too much room on the line. The book also advises not to use tabs since there is no universal length of a tab, so they can vary in length greatly."

      So it appears that there is a recommended spacing for the language.

      --
      I am not interested in knowing who people are or where they live. My interest starts and stops at our servers.
    • (Score: 3, Informative) by stormwyrm on Monday October 14, @03:10AM (1 child)

      by stormwyrm (717) on Monday October 14, @03:10AM (#1376884) Journal
      It doesn't, not really. Semicolons can be used to end statements but they are not mandatory the way they are in Perl and C: a newline can do so as well if the statement is syntactically complete, but if a statement is not complete, e.g. if a line ends with an operator like +, the statement is considered continued on the next line. So strictly speaking, while newlines can be syntactically significant in Ruby, it is fairly minimal, a very far cry from how languages like Python use whitespace to do block structuring. This means it is possible to write Ruby one-liners like Perl one-liners.
      --
      Numquam ponenda est pluralitas sine necessitate.
      • (Score: 0) by Anonymous Coward on Tuesday October 15, @04:32AM

        by Anonymous Coward on Tuesday October 15, @04:32AM (#1377045)

        With that sort of definition, Haskell doesn't either. Haskell allows you to use indentation in lieu of other block syntax. In fact, many languages that use the off-side rule either do so optionally (opt in or opt out) or only for a subset of statements. Most of the ones that don't are influenced, directly or indirectly, by ABC or ISWIM.

  • (Score: 2) by Zinho on Sunday October 13, @09:15PM (6 children)

    by Zinho (759) on Sunday October 13, @09:15PM (#1376851)

    For me the annoyance with Perl isn't the sigils, it's Leaning Toothpick Syndrome (TM) [wikipedia.org]. Behold the regex for matching URLs containing a specific subdirectory:
    m/ftp:\/\/[^\/]*\/pub\//

    Of course, other languages [wikipedia.org] aren't immune, either; here's another example from C++:
    std::regex re{ R"d(s/"\([^"]*\)"/'\1'/g)d" };

    ... so I guess my problem isn't with Perl so much as it is poorly written regular expressions.

    --
    "Space Exploration is not endless circles in low earth orbit." -Buzz Aldrin
    • (Score: 2, Interesting) by Anonymous Coward on Monday October 14, @02:38AM (1 child)

      by Anonymous Coward on Monday October 14, @02:38AM (#1376880)

      Most languages have a way around that problem. Perl and C++ both have ways to make it so the special characters aren't given special meaning. They can have other delimiters set, increase the "rawness" of strings, or use special operators or functions to get results.

      • (Score: 4, Funny) by Dr Spin on Monday October 14, @10:36AM

        by Dr Spin (5239) on Monday October 14, @10:36AM (#1376906)

        We have upped our standards, so UP YOURS!

        Taken from an advert for the "London Evening Standard".

        --
        Warning: Opening your mouth may invalidate your brain!
    • (Score: 2) by DannyB on Tuesday October 15, @03:16PM (2 children)

      by DannyB (5839) Subscriber Badge on Tuesday October 15, @03:16PM (#1377107) Journal

      When using a nice language [wikipedia.org] that is more gooder than Java, I don't mind any of the idiosyncrasies this pole is complaining about.

      [ This program prints "Hello World!" and a newline to the screen; its
      length is 106 active command characters. [It is not the shortest.]

      This loop is an "initial comment loop", a simple way of adding a comment
      to a BF program such that you don't have to worry about any command
      characters. Any ".", ",", "+", "-", "<" and ">" characters are simply
      ignored, the "[" and "]" characters just have to be balanced. This
      loop and the commands it contains are ignored because the current cell
      defaults to a value of 0; the 0 value causes this loop to be skipped.
      ]
      ++++++++ Set Cell #0 to 8
      [
      >++++ Add 4 to Cell #1; this will always set Cell #1 to 4
      [ as the cell will be cleared by the loop
      >++ Add 2 to Cell #2
      >+++ Add 3 to Cell #3
      >+++ Add 3 to Cell #4
      >+ Add 1 to Cell #5
      <<<<- Decrement the loop counter in Cell #1
      ] Loop until Cell #1 is zero; number of iterations is 4
      >+ Add 1 to Cell #2
      >+ Add 1 to Cell #3
      >- Subtract 1 from Cell #4
      >>+ Add 1 to Cell #6
      [<] Move back to the first zero cell you find; this will
      be Cell #1 which was cleared by the previous loop
      <- Decrement the loop Counter in Cell #0
      ] Loop until Cell #0 is zero; number of iterations is 8

      The result of this is:
      Cell no : 0 1 2 3 4 5 6
      Contents: 0 0 72 104 88 32 8
      Pointer : ^

      >>. Cell #2 has value 72 which is 'H'
      >---. Subtract 3 from Cell #3 to get 101 which is 'e'
      +++++++..+++. Likewise for 'llo' from Cell #3
      >>. Cell #5 is 32 for the space
      <-. Subtract 1 from Cell #4 for 87 to give a 'W'
      <. Cell #3 was set to 'o' from the end of 'Hello'
      +++.------.--------. Cell #3 for 'rl' and 'd'
      >>+. Add 1 to Cell #5 gives us an exclamation point
      >++. And finally a newline from Cell #6

      --
      One thing British schools lack that American schools have is active shooter drills so we are prepared.
      • (Score: 2) by Samantha Wright on Tuesday October 15, @03:26PM (1 child)

        by Samantha Wright (4062) on Tuesday October 15, @03:26PM (#1377109)

        Straight to jail!

        • (Score: 0) by Anonymous Coward on Wednesday October 16, @05:33AM

          by Anonymous Coward on Wednesday October 16, @05:33AM (#1377210)

          Then do yourself a favor and don't look up Malbolge. Another fun one is JSFuck, where people are teaching themselves that language because it has some interesting uses.

    • (Score: 2) by Thexalon on Wednesday October 16, @12:12AM

      by Thexalon (636) on Wednesday October 16, @12:12AM (#1377180)

      While Perl "line noise" reg-exes are certainly a problem, the sigils changing regularly can also be a problem, because it means that you have an extra hurdle looking for all instances where something is accessed or modified, and don't make it any simpler to understand the data structure in use.

      --
      The only thing that stops a bad guy with a compiler is a good guy with a compiler.
  • (Score: 1) by pTamok on Monday October 14, @03:52PM

    by pTamok (3042) on Monday October 14, @03:52PM (#1376931)

    People who don't know how to use colons, semi-colons, and commas in written English, and anyone who eschews use of the Oxford comma.

    Of course, anyone whose usage differs to mine is, without doubt, wrong.

    There are also heathens who omit apostrophes where they should be present, and insert them where they should not.

    Besides a mathematical inclination, an exceptionally good mastery of one's native tongue is the most vital asset of a competent programmer.

    Edsger Dijkstra, EWD498 How do we tell truths that might hurt? (1975)

  • (Score: 1, Redundant) by Mojibake Tengu on Monday October 14, @09:36PM (1 child)

    by Mojibake Tengu (8598) on Monday October 14, @09:36PM (#1376996) Journal

    Meaning of any code to a programmer is irrelevant, it's mere illusion.

    In consistent reality, the only relevant meaning of any code is that one to the machine.

    --
    Rust programming language offends both my Intelligence and my Spirit.
    • (Score: 2) by DannyB on Tuesday October 15, @03:26PM

      by DannyB (5839) Subscriber Badge on Tuesday October 15, @03:26PM (#1377111) Journal

      the only relevant meaning of any code is that one to the machine

      While it is true that the code must compile (or interpret) and run successfully; as a programmer your PRIMARY audience is not the computer, but rather it is another human being who will come along later, perhaps much later, who will need to be able to understand your code.

      --
      One thing British schools lack that American schools have is active shooter drills so we are prepared.
  • (Score: 4, Interesting) by hendrikboom on Tuesday October 15, @12:09AM

    by hendrikboom (1125) on Tuesday October 15, @12:09AM (#1377008) Homepage Journal

    Worse is to refuse to use any techniques to obviate these syntactic infundibula.
    For example,parenthesis pileup is easily dealt with using a trick like Racket's parendown [racket-lang.org]

(1)