Quantcast
Channel: Uncategorized – Elliot Loves Perl
Browsing latest articles
Browse All 40 View Live

Image may be NSFW.
Clik here to view.

Lesson of the day: Readonly, Exporter, and subroutine sigils

They don’t get along. As of the recent 1.07 release, Perl::Critic, has started using Readonly to be more more self-compliant with Perl Best Practices. We had been avoiding use of constant for the...

View Article



Image may be NSFW.
Clik here to view.

Writing configurable Perl::Critic Policies.

As of Perl::Critic 1.07, I would like to discourage the creation of constructors for Policies. Instead, I would encourage the use of P::C::Policy::initialize_if_enabled(). The reasoning is twofold....

View Article

Image may be NSFW.
Clik here to view.

The single most useful perlcritic command-line option.

For me, it’s --single-policy. Generally, Perl::Critic is being used indirectly via a test using Test::P::C or Test::P::C::Progressive, with a perlcriticrc file that is in the distribution’s t/...

View Article

Image may be NSFW.
Clik here to view.

Perl::Critic policies in the DarkPAN.

I’m curious about any people who’ve written custom Perl::Critic policies that aren’t on CPAN. What sorts of things are these for? Have you had a look at Perl::Critic 1.082? Have you read...

View Article

Image may be NSFW.
Clik here to view.

Crud. CPAN::Site is unfixably broken.

I’m setting up a DarkPAN at work. CPAN::Site does most of what I want with maintaining it. Unfortunately, it has some bugs with parsing module versions (in particular Test::Object, which is a blocker...

View Article


Image may be NSFW.
Clik here to view.

Names

A topic anyone who’s known my programming style for a while knows that this is one of my pet peeves. Why can’t people use understandable variable names? I just got though producing a set of constants...

View Article

Image may be NSFW.
Clik here to view.

Managing perl

(The lowercase “p” perl is what I mean in the title.) There’s a great new page on the Perl 5 wiki about administering your perl installation. It includes quite a number of things I believe in. Some of...

View Article

Image may be NSFW.
Clik here to view.

stackoverflow.com

I was planning on coming into the office early this morning, but just before I was going to leave, I read Spolsky’s post and in under a minute found a Perl::Critic related question I felt needed a good...

View Article


Image may be NSFW.
Clik here to view.

Optimizing for the developer, not the user.

Mr. Lester, as usual, with the good stuff. While the example he’s using is PHP, it seems people didn’t understand that the point was in general, so there’s a follow up. Tagged: bug reporting, development

View Article


Image may be NSFW.
Clik here to view.

Improbable vs Statistically Impossible

Schwern on git hashes. Every time this comes up someone says “but what if they collide?! Hashes sometimes collide!” I confess to being one of those who want things to be really impossible, not merely...

View Article

Image may be NSFW.
Clik here to view.

The most significant Perl::Critic release in a long while.

Perl::Critic 1.094 is on its way to a CPAN mirror near you. There are a number of changes in it, but there’s one in particular that I want to point out. A new policy called...

View Article

Image may be NSFW.
Clik here to view.

What kind of personality does Perl::Critic have?

Probably pedantic, but we’ll see what it says. Tagged: Perl::Critic, twitter

View Article

Image may be NSFW.
Clik here to view.

Communicating opinions via method implementation choices in class hierarchies.

Dealing with the differences in the ways that the CME and the ICE use FIX has been interesting. Some of the differences are simply, oh, this one does things this way and this other one does things...

View Article


Image may be NSFW.
Clik here to view.

Modern Perl

Tagged: modern perl

View Article

Image may be NSFW.
Clik here to view.

Someone’s built a GUI on top of my code!

I added the metadata functionality to Perl::Critic that allows this sort of thing a while back and now some one is finally using it. Woohoo! I’m quite chuffed. Tagged: using Perl::Critic

View Article


Image may be NSFW.
Clik here to view.

It really feels weird downloading your own code from a public website.

Downloading the Perl::Critic from work which I uploaded at home this morning. It’s a different feeling than downloading from private ‘net storage; it’s just a transfer mechanism in that case. But using...

View Article

Image may be NSFW.
Clik here to view.

Eliminating all inheritance from my code.

Moose Roles rock! I’m following Ovid‘s example and getting rid of inheritance in my code: nothing will inherit from anything. You’ll be able to tell what the code does without searching for a...

View Article


Image may be NSFW.
Clik here to view.

pmtools

pmtools is a set of little utilities for dealing with your installed modules. (Unfortunately, if you want to install these using CPAN.pm or CPANPLUS, you need to tell them to install “Devel::Loaded”.)...

View Article

Image may be NSFW.
Clik here to view.

The problem with Modern::Perl.

Modern::Perl has laudable goals. I agree with chromatic. This is why I use 5.10.0 at work. This is why I will be upgrading to 5.10.1 almost as soon as it is released. I even plan on testing our code...

View Article

Image may be NSFW.
Clik here to view.

DarkPAN setup

Gabor is looking at setting up corporate CPANs. While it doesn’t cover the web interfaces that he wants, brian d foy has been working on MyCPAN::Indexer and MyCPAN::App::DPAN. The former has been in...

View Article

Image may be NSFW.
Clik here to view.

Dealing with perl binary compatibility issues as a user of XS modules.

chromatic discusses binary compatibility with the perl executable. I’m someone who only uses XS modules and hopes to never have to write one. Yet, unlike what seems to be the prevailing fear, I don’t...

View Article


Image may be NSFW.
Clik here to view.

Using NYTProf to understand why not to do something.

Mr. Bunce is asking for examples of how NYTProf told you what to fix with poorly performing code. Instead, I’m going to give an example of how NYTProf told me why I shouldn’t fix something a particular...

View Article


Image may be NSFW.
Clik here to view.

What I want out of the Parrot Workshop.

I’m going to the Parrot virtual machine workshop next weekend. The suggestion has been made that “anyone who is coming from out of town to attend the Parrot talks is already involved with Parrot” and...

View Article

Image may be NSFW.
Clik here to view.

Moose as documentation.

Forgetting all the type constraint, role, and attribute handling that Moose does, I like it simply for what it’s contributed to documentation. I’ve been using the constraint syntax for describing...

View Article

Image may be NSFW.
Clik here to view.

What I got out of the Parrot Workshop.

I previously wrote about what I wanted out of the Parrot workshop. So, here’s what I actually got. There are some amazingly smart people working on Parrot/Rakudo who really believe in the promise of...

View Article


Image may be NSFW.
Clik here to view.

A reasonable approach for Modern::Perl.

At YAPC::NA this morning, chromatic answered my question about Modern::Perl, “What happens when perl 5.12 comes out?”, with what I think is a good solution. The proposed answer is for Modern::Perl to...

View Article

Image may be NSFW.
Clik here to view.

Perl::Critic supports autodie.

In chromatic’s session this morning, there was a comment that Perl::Critic didn’t support autodie. It actually has supported it since New Year’s day of this year. Let me say emphatically that one of...

View Article

Image may be NSFW.
Clik here to view.

Dear LazyCPAN, please create these documentation modules.

Ideas that I’ve got floating around, but which I haven’t gotten to yet: Pod::Coverage::PPI Like Pod::Coverage, but rather than looking at the symbol table, uses PPI to discover subs that need...

View Article

Image may be NSFW.
Clik here to view.

One thing I’ve never understood about the perl core: binary compatibility.

So, I was reading chromatic’s latest, wherein he links to a p5p post which mentions the whole bit about @INC including multiple point releases in it, which makes having them around expensive. In case...

View Article



Image may be NSFW.
Clik here to view.

How I use Perl::Critic.

Under regular development conditions, I rarely use perlcritic. Most of my Perl::Critic usage is via Test::Perl::Critic for new code and Test::Perl::Critic::Progressive for existing code. For code that...

View Article

Image may be NSFW.
Clik here to view.

Deprecation.

In the source repository, there are a number of changes to Perl::Critic that include deprecation of existing functions/methods. One Policy author has asked us to not do the deprecation because it will...

View Article

Image may be NSFW.
Clik here to view.

Thank you Tom Wyant.

From the Perl::Critic 1.104 Changes file: This release is dedicated to Tom Wyant in appreciation of the amount of effort he put into the enhancements and bug fixes in this release, for having the...

View Article

Image may be NSFW.
Clik here to view.

How to structure Perl programs.

Don’t put the implementation of your program in your program; put it in a module instead. There are at least three reasons for doing things this way: Your code is more testable. You can feed in...

View Article


Image may be NSFW.
Clik here to view.

Explicitly running author tests.

There are tests that you want to have around, but not be part of the standard test run prior to installation of a distribution. Probably the biggest set of these in publicly available Perl...

View Article

Image may be NSFW.
Clik here to view.

If it’s broken, fix it — dammit.

I was reminded of the epigram “If it’s broken, don’t fix it.”. My problem with this is that people don’t apply the contrapositive. So many just leave things that don’t work around, and that plain...

View Article

Image may be NSFW.
Clik here to view.

No Devel::Declare. Ever.

I think Devel::Declare is evil for the same reasons that Adam does. Even if PPI supports it, Perl::Critic will not be supporting any syntax that’s not part of the language core. Not only because it...

View Article


Image may be NSFW.
Clik here to view.

Don’t put Perl::Critic into source control pre-commit hooks.

Some people seem to like to put Perl::Critic tests into their VCS pre-commit hooks in order to prevent code with violations being checked in. I consider this to be a really bad idea. You should always...

View Article


Image may be NSFW.
Clik here to view.

Test Moose accessors? Hell, yes.

I’m sorry Dave, but you’re wrong, wrong, wrong! :] The purpose of testing “attributes” is not to test that Moose did its thing. The purpose of testing attributes’ accessors is that they are part of...

View Article

Cost of technical debt calculation via Perl::Critic

Tudor Constantin asked about extending Perl::Critic to calculate the total cost of violations. You can do this yourself without much work without any code changes to Perl::Critic. Perl::Critic has a...

View Article
Browsing latest articles
Browse All 40 View Live




Latest Images