If it's a longer sub or if block, and I'm at the closing }, I can hit % in vi, and it takes me to the matching one. If it's on the same line, I see the sub name or conditional on the screen, which is _exactly_ what I want. If it's on the next line, I have to then scroll up a line to see, and the next thing I'm usually going to want to do after seeing that is % back to the end brace (to go back to where I was.) So, it annoys me to no end when people put them on the next line.

Can't you just rebind the % key so that (in addition to what it usually does) it checks that the line it is on is not the first or last line in the buffer, scrolling one line if necessary to accomplish that? vim fans claim it's pretty customizable, so one would think that would be easy (though, not being a vi user myself, I'm speculating here).

(Of course, I prefer the behavior wherein the editor shows the line containing the opening brace in the status area when your cursor rests after the closing brace, so you don't have to hit a key in the first place, which brings us back to your argument, since there's not room in the status area for two lines without expanding it, which is a bit jarring.)

My own reason for preferring nestled braces in most cases is that it makes the code significantly more vertically compact, which allows a lot more context to fit on the screen at once, making the code easier to follow, since you can see more with less scrolling about.


"In adjectives, with the addition of inflectional endings, a changeable long vowel (Qamets or Tsere) in an open, propretonic syllable will reduce to Vocal Shewa. This type of change occurs when the open, pretonic syllable of the masculine singular adjective becomes propretonic with the addition of inflectional endings."  — Pratico & Van Pelt, BBHG, p68

In reply to Re: A Question of style. by jonadab
in thread A Question of style. by GrandFather

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.