Activity

Class decomposition and a handy delegation pattern

There’s something satisfying about reaching the point when you can’t decompose an object any further and all your methods are tiny and do one thing - it’s especially gratifying when you learn something new in the process. Sadly, it doesn’t happen as often as I’d like, there’s usually annoying bits and pieces where you have to placate the language in some fashion that breaks the flow of what you’re writing.

  • 0 likes
  • 0 reposts
  • 0 replies
  • 0 mentions

Written by Piers Cawley , updated

Read more…

Twice now

In Ruby, when you’re doing division on integers, things can get a little counter intuitive. For instance, 6/4 is obviously 1. At least, it is until you decide that you’d rather have numbers that behave a little more like ‘real’ numbers and you do require ‘mathn’, a module in the Ruby standard library (ie, it comes as part of ruby). Then you enter a whole new world of rational maths, where 6 / 4 returns 3/2.

  • 0 likes
  • 0 reposts
  • 0 replies
  • 0 mentions

Written by Piers Cawley , updated

Read more…

Perl 5, version 10.1

At last! Start your compilers everybody.

  • 0 likes
  • 0 reposts
  • 0 replies
  • 0 mentions

Written by Piers Cawley , updated

Read more…

London.pm Presentation Video

Back in (crikey) February, I gave a talk at the London Perl Mongers’ technical meeting about Moose for Ruby Programmers and wrote it up here. Mike Whittaker was in the front row of the audience with his iPhone and, a couple of minutes in, started a voice recording and gave me a copy.

  • 0 likes
  • 0 reposts
  • 0 replies
  • 0 mentions

Written by Piers Cawley , updated

Read more…

Another conference season, another dumb sexist

Mum was often the only women [at British Leyland sales conferences]. In those days it was apparently common for presenters to slip the occasional naked lady into the slides “just to keep everyone awake”. When this happened, there’ be slightly embarrassed laughter and a few heads would turn to look at mum. Who ignored it. It doesn’t happen so often any more

  • 0 likes
  • 0 reposts
  • 0 replies
  • 0 mentions

Written by Piers Cawley , updated

Read more…

Freedom is in Peril

I’ve just written my first ‘real’ real post for the new Freedom is in Peril website. I’ll try and keep the political stuff on that blog from now on, but if you’re at all concerned about the erosion of what has traditionally, if cornily, been called “British Liberty”, then I hope you’ll swing by, and link to, the new site.

  • 0 likes
  • 0 reposts
  • 0 replies
  • 0 mentions

Written by Piers Cawley , updated

Read more…

Test::Class::Sugar released

I’ve just pushed the second version of Test::Class::Sugar (first discussed here). It’s pretty much as discussed in the original article, but after some discussion with David Wheeler, I’ve dropped the +uses clause from the testclass declaration in favour of less DWIMmy (and thus easier to explain behaviour).

  • 0 likes
  • 0 reposts
  • 0 replies
  • 0 mentions

Written by Piers Cawley , updated

Read more…

Thinking about the virtues

I got a bit of stick on IRC last night for some of the choices I’d made when I was writing Test::Class::Sugar, in particular because one of the prerequisites is chromatic’s handy and opinionated Modern::Perl module. The ‘controversial’ aspect of Modern::Perl is that, when you use it, your code won’t run on any Perl before Perl 5, version 10.

  • 0 likes
  • 0 reposts
  • 0 replies
  • 0 mentions

Written by Piers Cawley , updated

Read more…

Magic vs Mundane: Keeping them apart

In which your correspondent does magical battle with the guts of Perl and emerges bloodied, but unbowed with a useful principle to code by.

  • 0 likes
  • 0 reposts
  • 0 replies
  • 0 mentions

Written by Piers Cawley , updated

Read more…

Writing parsers for fun and convenience

One aspect of coming back to Perl for ‘recreational’ programming is that if, like me, you’ve declared war on @_ and boilerplate code, then testing can be somewhat trying. The Perl testing framework that best fits my head is Test::Class, which is an excellent Perlish implementation of xUnit style testing. If you’re unfamiliar with the, library, Ovid is writing what’s shaping up to be an excellent series of introductory articles about it at http://www.modernperlbooks.com/.

  • 0 likes
  • 0 reposts
  • 0 replies
  • 0 mentions

Written by Piers Cawley , updated

Read more…