Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • I must be the only person in the world who thinks it is absurd to see code formatting as a matter of personal preference.

    If

        I just ( you know , like this )
    format my English text in any old way,it
        gets awfully hard to read.There are standard grammatical conventions for written text,yet we try to reinvent them for programming
    . See how silly it is to break before the operator
    ?And what's the deal with braces being non-tight
    ? ( I mean, we don't have space after an opening paren ( and before the closing one ) in English
    . )

    True, not everything in programming has a parallel to written text, but bracket and brace tightness does, as does the trailing operator.

    Really, the only options perltidy needed was line-width and possibly indentation. Both of those really just translate into "our text editors suck" though, don't they?

    I'm sure I'll never convince anyone, but making "wrong code look wrong" would be a lot easier if "same code looked same" (ala http://www.joelonsoftware.com/articles/Wrong.html [joelonsoftware.com] -- though Joel's "real solution" seems a bit crack-fueled, the original goal was an honorable one.) What we're missing here is a logical argument as to why it should look one way vs another -- it gets dismissed as "preference", so we won't ever have that discussion and we'll continue to be babel'd on this very basic level.

    I also don't really see the point in composing a config file out of a bunch of abbreviated commands followed by comments which are longer than the unabbreviated commands would have been.
    • The problem is that while the big decisions are obvious, the little ones are not. And there are lots of little decisions to make while formatting. While you can get people to agree on some of them, you can't get them to agree on all of them.

      For example, based on your post you should not break before operators. However if you read Perl Best Practices, you'll find some excellent reasons given for why you should break before operators. Basically they have to do with how our eyes move when we skim through c
      • ...coding expertise is fragile. ... Suppose we take someone who is familiar with a particular formatting style. ... Well it turns out that the transition is a shock.

        Exactly. Like I said: babel. The conflict comes from the subtle differences.

        And that is what really drives these religious debates. ...

        I would rather than the debate be based in reason than religion (call it semantics, but "religious debate" is, by definition, a contradiction of terms.)

        Given one internally consistent system, which i

        • I would rather than the debate be based in reason than religion (call it semantics, but "religious debate" is, by definition, a contradiction of terms.)

          Actually it is not a contradiction of terms. It is a description.

          Debates happen. Both sides bring arguments to bear, and argue. But people wind up arguing past each other, and after a while it becomes apparent that the answers are hugely important to people, but they cannot logically justify that importance.

          Because this is so reminiscent of debates over r

    • I must be the only person in the world who thinks it is absurd to see code formatting as a matter of personal preference.

      In French, it's conventional to put a space before the question mark -- like this ? They also don't seem to indent new paragraphs. ¡In Spanish, they mark exclamations at the front too! In Czech, we can see, that they put commas before "that" when the independent clause comes first (as in this sentence, so "we can see" isn't parenthetical). In German, they capitalize Nouns and some

      • Though you could probably argue that those languages are consistent "internally", so picking a format for Perl would only be equivalent to picking it for one of those languages.

        Yes. And Perl is (quite arguably (on many levels)) linguistically based in English.

        Maybe programming languages each need a few hundred years to settle on formatting conventions.

        Maybe, but please name some French/ Spanish/ German/ Czech programming languages.

        (So I was trying to put one "phrase" per line, with continuations indented by one space.) They end up looking almost like poems, which I think makes them too flippant.

        Poems yes, but "poem" does not imply "flippant". Poetry has been quite influential throughout history (though we forget that thanks to technological advances like "fox news".) Poems are memorable because of the rhyme (or non-rhyme), beat, linebreaks, syntactical twists, etc. It's not much different than distending an array/hash decl

        • Maybe, but please name some French/ Spanish/ German/ Czech programming languages.

          Rasmus Lerdorf (Denmark) designed PHP.

          Bjarne Stroustrup (Denmark) designed C++.

          Guido van Rossum (Netherlands) designed Python.

          Yukihiro Matsumoto (Japan) designed Ruby.

          Niklaus Wirth (Switzerland, german part) designed ALGOL, Pascal, Modula.

          Jean David Ichbiah (France) designed Ada.

          The Ericsson company (Sweden) designed Erlang.

          French professors designed Prolog.

          Norwegian professors designed Simula.

          INRIA (France) designs OCAML.

          etc, etc.

          I could go through the thousands of programming languages listed

          --
          Close the world. txEn eht nepO