People are different, aren't they?

Whenever I read old code I've written I find that my coding style seems to change continuously. Somewhat like the movement of an amoeba: I learn something (which isn't necessarily a new feature, but something I had not known), I like it and include it into my coding habits. Other habits die out, mostly because I don't need them for some time.

At one point in time I broke with several habits at once, that was after working through Perl Best Practices. I am using this book's layout conventions until today, and configured my editor to help me doing so. I am not (and never was) religious about it: I can not claim a single *NEVER* nor *ALWAYS* rule for anything I've written.

I guess this has to do with my personal history. I started working for mainframes, making small changes to huge amounts of code written by someone else. Being the beginner in the team, it seemed a good idea to keep the overall style. With Perl, my first job was to fix a broken CGI, again code written by someone else, I decided to keep its style. When I took part in the CPAN Pull Request Challenge, I found very different styles, and I found that all of them work.

I used to start my OO methods with my $self = shift; because I saw others do this. I can not claim I'm doing it *ALWAYS*: I have adopted the habit to use subroutine signatures, and recently I use Object::Pad which predeclares $self. Over the years I have used plain bless-style OO, Moose (which I consider a game changer), and MooseX::Declare (until it became frowned at because of too much magic). Panta rhei.

Habits I haven't changed in the last decades: I use Emacs, and I like the Perl debugger. Occasionally I work to improve these tools.


In reply to Re: How has your coding style changed over the years? by haj
in thread How has your coding style changed over the years? by stevieb

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.