Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

mugwumpjism

by mugwumpjism (Hermit)
on Jun 07, 2001 at 18:14 UTC ( [id://86555]=user: print w/replies, xml ) Need Help??

After two bad experiences with UK employers, I've come to the firm conclusion that there is some wisdom in the saying "be picky about who you marry, and even more picky about who you enter into business with". So, I've been working for Catalyst for over a year, and am enjoying it thoroughly. They sent me to YAPC::Europe 2006! I was the furthest travelled attendee.

Recommended Reading

Perl 6 and Parrot Essentials I picked up at YAPC::Europe 2006, and am enjoying thoroughly.

Types and Programming Languages I'm still not through this book, but I will feel much better when I am!

The Art of Objects: Object-Oriented Design and Architecture, by Yun-Tung Lau. An excellent book on advanced OO concepts, and how to work with UML modelling. Not up to date in terms of Traits etc, but still an excellent read for refactoring object heirarchies.

Fiction: Zelazny's Amber series is my favourite fictional work, closely followed by Asimov's Foundation.

Health: The TAI CHI Book: Refining and Enjoying a Lifetime of Practice, by Robert Chuckrow, Ph.D. The author's doctorate is actually in Physics, and he covers many of the fundamentals of Tai Chi in a manner very well suited to educated westerners. Of course it's better to get it from the horse's mouth, Chan's Martial Arts is where I go, myself.

Philosophy: A Brief History of Everything, by Ken Wilber. Much better than the drivel I recommended on here before like "The Holographic Universe" and "What the Bleep do we know" ;-). They're fun, but it's nicer reading something that actually has good research behind it etc.

How to Lose Friends and Infuriate People: Leadership in the Networked World, by Jonar C. Nader, is an excellent book that rejects the status-quo enforcing patterns in the world. A fun series

Perl feng shui

The editor and programming environment are extremely important. To have a desktop that looks pleasing to the eye and works the way you want makes coding a pleasure.

If you use emacs as your editor, make sure you have `cperl-mode' from CPAN. If you're a VI nut, consider using emacs in VI emulation mode - you get the keystroke efficiency of VI (its real power) plus the flexibility and power of emacs, at the expense of always being on the wrong side of the classic Emacs vs. VI flamewar.

A small configuration change will make your POD headings use the same typeface as `info' headings, which under emacs 21 is usually a nice proportional sans serif font like Arial or Helvetica:

(custom-set-variables '(cperl-pod-head-face (quote Info-title-1-face)) )

Now, POD headings will clearly stand out as you scan over the document. This is a HUGE advantage.

Colour is also very important; ensure global-font-lock-mode is switched on. Your choice of colours affects your programming mood, and hence style. The background should be too bright, or your eyes will tire. It should also not be darker than most of the text. Whilst the exact colour choices are a personal issue, here are my settings:

(custom-set-faces '(font-lock-constant-face ((t (:foreground "Gold3")))) '(fringe ((t (:stipple "gray3" :background "#ddddbb" :foreground "#99 +9970")))) '(mmm-code-submode-face ((t (:background "wheat2")))) '(mmm-default-submode-face ((t (:background "wheat1")))))

Not many have been changed - all I did was set the background colour, then looked at code and decided which colours were displeasing to my taste.

Shape has a similar effect - the indentation settings you use will affect your code. Always wrap your code nicely, pick a width - 70, 78 or 120 characters are good choices. Remember, whitespace is pretty much free and can make code much more readable. Too many run on lines, or misaligned text makes your code look confused and hurried.

For the sake of completion, here are my indentation settings:

(custom-set-variables '(cperl-brace-offset 0) '(cperl-continued-brace-offset 0) '(cperl-continued-statement-offset 4) '(cperl-extra-newline-before-brace nil) '(cperl-indent-level 4) '(cperl-label-offset -4) '(cperl-merge-trailing-else t)

Turning on perl abbrevs is also a big win - start a new document in cperl-mode, M-x abbrev-mode, then type `=head1 ' and see what happens. If you like what you see, set this in your ~/.emacs:

(condition-case () (quietly-read-abbrev-file) (file-error nil)) (add-hook 'cperl-mode-hook (lambda () (setq abbrev-mode t)))

I also find these keyboard shortcuts useful; If you have seperate `alt' and `meta' keys, then they will bind Alt-F to rehighlight the current buffer (it seems to miss conditions where it needs to re-colourize text sometimes), and Alt-M to show you the current Perl s‎crip‎t as a manual page.

(global-set-key [?\A-f] 'font-lock-fontify-buffer) (global-set-key [?\A-m] 'cperl-pod-to-manpage)

Code

More to come, but for now I leave you with an ode to Morris Dancing,

my @ARSE = (map{[split//,$_]}split"[SCV]",join"",sort {($_%=3)-1}map{$_^"\a"}split/\s*/,join"",<DATA>);push @ARSE,["\n"];for my $ARSE (@ARSE) {ARSE($ARSE)};print (map{join"",@$_} @ARSE)# . ___., ;sub# =-, _,=$^%$*=$!;; ARSE(\@ ){my($ arse)=( @_); my(% ARSe ,$ ARSe ,$ ARse ); for my$ ARSE (@{$ arse }) {(exists$ ARSe {$ ARSE }) ||do{$ ARSe {$ ARSE }=$ ARse ;if($ ARSe !=$ ARse ){$ arse ->[$ ARSe ]=$ ARSE;}++$ ARSe };++$ ARse}$#{$ arse }=$ ARSe-1;} #ARSE!!! __DATA__ h h i F' s t M r t r M r M M M s W 'u b u s o b b s o o s s T o d 'O f u k O'ubkububDl++u +buubbuu+bubQ

If the above isn't funny, then perhaps you've not seen much of the Fast Show.

<IMG SRC="http://www.pilpre.com/briac/cheesering2.gif">

[ previous $] - [ next $] - [ random $] - [ list $] - [ next5 $] - [ prev5 $] - [ first $] - [ last $]

don't blame me for this idea, it's ar0n's fault!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2024-03-19 04:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found