Wednesday, 16 May 2007

A question...

...for my scant collection of readers.

What makes a good or bad Perl job advert? What key words or phrases get you going, above and beyond the response 'yes I know how to do that'?

[composed and posted with ecto]


Technorati Tags: ,

Performance Tests

Every now and then, it rears its head on one or other IRC channel. Someone trots out one of a number of web sites that purports to compare like with like, hammering the crap out of various implementations of a web app in Rails, various Perl frameworks and not-frameworks, J2EE, PHP, etc etc, and attempts to draw meaningful conclusions from the results.

Setting aside, for the moment, brian d. foy's tongue-in-cheek demolition of benchmarking as a valid tool, what do we learn from these?

Actually, mostly, we learn that a single instance of almost any web app written in just about any language on semi-decent hardware, pounded on by JMeter, ab or whatever will cough up well over 100 hits/second without actually breaking into much of a sweat.

Let's stop right there for our first remedial maths class, OK?

100 hits/second.

That's 6,000 hits a minute. 360,000 hits an hour.

Eight point six million hits a day. And change.

And that's page views - c'mon, you don't serve your static images out of of your webapp framework. That's a dickens of a lot of traffic. To give you an idea, CricInfo.com's record month while I was there was a quarter of a billion page views... that's about 8.3 million a day on the biggest single-sport website on the net.

You're expecting that amount of traffic? Man, do you have delusions of grandeur! Paying for the bandwidth is going to be a much bigger worry than whether your web app framework can cope.

Stick an ad on every page, from Y!, Google, whoever. A week's traffic, tops, and you can afford another server. Hell, you can afford two and a load-balancer. And quite frankly, your rate-determining step is almost certainly NOT how fast your underlying development framework can generate the pages, but how well-written your code and your DB are, how cacheable the pages are, how big they are, and how laggy your average client is. One missing database index can turn a 0.02s query into a 3s query.

Get over it, folks.

[composed and posted with ecto]


Technorati Tags: , ,

sleep(24*60*60*rand(200)); post();

OK - back now :) The management would like to apologise for the silence from this corner for 2007 to date - this has been mostly due to having way too much on my plate. Things have now settled down a bit, and my morning commute time seems to be available for blogging again, so, here we go.

Before we move back to looking at Perl in the enterprise, I'd like to take a look at a recent O'Reilly OnLamp posting, on the subject of the Perl job market here in London. The thread of the argument, and one which I'm seeing here working for Yahoo!, is that we're seeing fewer, and poorer, candidates applying for Perl jobs than in the past. He lists a number of explicit and implicit reasons, but I'm going to go out a little bit on a limb here, and flag a couple of my own reasons to do with the perception of Perl, a subject near and dear to the core of this blog. Implicit, I think, in the post, though it isn't actually said, is that it's looking at 'enterprise' level Perl jobs: things for big apps for big sites and companies.

I'm not going to go so far as to say Perl is actually dying as a language: you can't claim a language that holds up any number of the biggest sites on the 'net, and is pretty much a lingua franca among sysadmin and CGI programmers is going the way of the dodo. But as I've said several times before, it seems to me to be suffering from a perception issue, to do with the way it's marketed, and how its culture's evolved and is presented.

Marketing? Sure. Where's the glossy, media-friendly, Web 2.0-looking (you know what I mean - big, bold sans serif fonts and gradient-filled boxes in darkened primary colours) site that sells Perl as a solution? Ruby on Rails has one, that's been shoved in our faces with the growing rise of Rails as a rapid enterprise web development framework. And Perl's better than Rails[1] - it's more mature, better supported, has a vast library of excellent modules to handle just about any feature you could want to throw at it (too many, perhaps!). It just isn't sexy, and it's hard to sell it as such.

Perl has MVC frameworks[2] - it has, if anything, too many of them. The barrier to entry, though, is two-fold - first off, they are, by their very nature, that bit harder to assimilate than good old CGI.pm, which scares off the Perl scripters. Secondly, Perl's reputation scares off the suits.

What do we need to do, then?

Actually, I think it's twofold:
  • the BBC's free Perl training is a great idea, but as I've banged on before, we need to teach Perl folks to program properly, and understand OO concepts and good design patterns - that's, to a degree, independent of language, but Perl's history drags it down. And hell, if that means we have to throw away TWTOWDTI and aggressively promote something like Moose as The One Way to do OO in Perl, let's do it. With tutorials, examples, the works.
  • we need to sell Perl as MVC framework. Hard, slick, polished, finding all the good things that make Perl the right way to do it.
[1] Yes. Controversial statement. But if I didn't believe it, I'd a) not be writing this blog, and b) have learned to program in Ruby by now. :)
[2] More later. Oh my God, yes.


[composed and posted with
ecto]


Technorati Tags: , ,

Friday, 24 November 2006

Sometimes...

So... last night, one of the job agencies I fed my CV to, who knows I've actually accepted a position elsewhere, scattershot a plea for a 6 month PHP contract to a large list of people.

I dropped back a mostly polite note pointing out that this wasn't perhaps very smart. The reply:

"Unfortunatly you are included in the same file as PHP, along with every other perl developer."

Houston, we have a perception problem.

Thursday, 23 November 2006

"OO Perl"

A couple of people on the use Perl; version of this blog picked up on my use of 'OO Perl' as a term, and were less than complimentary about the language's OO features. I'm not here to defend that: however, it set me thinking about why I used that term, and whether it was what I actually meant.

It was, at least in part, prompted by my job search (more on that later, I promise). Look down jobs.perl.org, and you'll find that most of the well-paying jobs mention, in some roundabout way, LAMP or a variant thereof, and stipulate 'OO Perl'. The fact that I had 'OO Perl' (and legitimately so) on my CV (resumé for you transPondials) was welcomed with open arms by several recruiters who absolutely couldn't wait to get my details to their clients.

I think, in the end, this goes back to some of the comments I made about the Swiss Army Chainsaw, specifically, the distinction between Perl scripters and Perl programmers. How do you tell if someone's the latter, if their CV just says 'Perl'?

I don't think 'OO Perl' necessarily has to mean, literally, Perl in the Perl5 "bless {};" way. What the recruiters are trying to say, I'm pretty sure, is 'someone who treats Perl like a high-level programming language'. 'OO Perl' is, if you like, a shibboleth, to find the programmers amid the scripters, since a scripter's response will be either 'huh?' or 'no, that's scary'. (Joking a little, but you get the point.) It isn't, by any means, a perfect test, but it seems to me that if someone both uses OO Perl, and consciously self-identifies as doing so, they fall on the 'programmer' side of the divide.

And of course the problem, both for the recruiters and for our definition of LAMP++, is that Perl the language doesn't mandate it. Any more, actually, than Java the language does. You can quite happily write little Java ten-liners to do some mundane task that mangles a file, and never consciously touch an OO feature of the language. You can write really bad Java just as much as you can really bad Perl.

But... and here's the kicker... The frameworks that most Java enterprise projects are written in pretty much do mandate an OO approach, and what my Uni lecturers would call 'good software engineering principles'. And that means that folks raised in that environment have it as a similar shibboleth to 'OO Perl' to prove their credentials in the Java world. Now sure, once you start using Class::DBI, Rose::DB or DBIx::Class for your DBI abstraction layer, or a goodly number of the popular CPAN modules, you're at least required to talk to them in an OO way. But there's nothing to stop your actual application code being a Big Ball Of Mud, a God Object, or any number of other anti-pattern horrors.

Which reminds me. I should talk about Design Patterns.

Wednesday, 22 November 2006

So, what IS 'enterprise'?

Time to bite the bullet, I guess. What do we mean by 'enterprise'?

Consulting the Oracle, more formally known as Wikipedia, we find, in the Enterprise software entry:

Enterprise application software is application software that performs business functions such as accounting, production scheduling, customer information tracking, bank account maintenance, and the like. It is almost always hosted on servers, and is used by multiple employees of the same organisation. It can also be any software application hosted on a server which simultaneously provides services to a large number of users, typically over a computer network. This definition contrasts the more common single-user software applications which run on the user's own local computer, and serve only one user at a time.

Actually, y'know? That's not bad. The first half is the 'traditional' definition of 'enterprise', perhaps, but I want to zoom in on the bolded sentence: "It can be any software application hosted on a server which simultaneously provides services to a large number of users, typically over a computer network.". The main reason I'm aiming for that is that it then covers not only internal CMS's, publishing applications and the like, but also end-user facing systems (such as, for example, Amazon or Flickr).

Let's take that second sentence as our prototype definition, and dissect it to see what it implies. I'm very aware that I'm reaching, just a touch, with some of this, but it's a very good jumping off point to allow us to reach a definition of 'enterprise'.


"...software application..."

It may seem odd to pick this one out, but bear with me. Implicit in this is the concept that it's something you can point at and say "this was built to do X". In and of itself, that's perhaps not much, but what follows on from this is: its functionality is well defined, and from there, it's a very short leap to saying it is designed using good software engineering principles.

"... hosted on a server..."

Instantly this implies it has a client/server architecture of some sort. Maybe its true that most of such applications will have a web browser as their client, but let's not assume that: a mail server is just as clearly an enterprise application.

"...simultaneously provides services... "

I dunno about you, but to me that screams a requirement that the software is thread and transaction safe - no one user's changes should be able to overwrite another's.

"... to a large number of users..."

Following on from thread and transaction safety, that adds to our requirements the obvious one that it must be scalable.

"... over a computer network..."

Again, a little bit of a stretch, but that phrase should ring alarm bells in any sysadmin's head. It should be secure against unauthorised use.



How's that?

Monday, 20 November 2006

LAMP++?

Writing the previous post raised a number of thoughts while traversing the London Underground, which will keep me going in blog entries for a while, I think.

So... LAMP.

Linux, Apache, MySQL, and Perl (or PHP, but I kind of promised myself this blog would be mostly PHP-free. :) ). As characterised by O'Reilly's excellent OnLAMP section, in fact, which is recommended reading, and a champion of the cause.

Is this Enterprise Perl?

Interesting question. I think the answer is, sort of: it's its skeleton. It's the bones on which you can build an enterprise-level application in Perl. (Which reminds me - we still need to define exactly what we mean by that troublesome term 'enterprise', don't we?) But it doesn't actually define anything. A single CGI that uses the HTML generation methods and talks raw DBI to MySQL is as much LAMP as a fully OO MVC-style web application written in TT2 and DBIx::Class.

It clearly can work, though: Yahoo's internal CMS is written in Perl, so's IMDB, Amazon's publishing system, the entirety of CricInfo (trust me, I designed it - it's a TT2 fronted MVC web app, or at least it was when I left)... all these can be pointed at as examples of LAMP-done-well, and cover four of the biggest sites on the web (even CricInfo - a quarter of a billion page views a month on a single sport site). OK, so the 'L' occasionally stands for FreeBSD, but we'll draw a view over that - the spirit of the 'L' is 'Unix or Unix-alike on x86 commodity hardware', and we can let Yahoo off, just as we can excuse the folks who use Postgres. But there's really more to these than LAMP, or at least, we hope there is.

What we're looking at, from an enterprise point of view, is something I'm going to call LAMP++. I'm sure, with a bit of work, we might be able to come up with a better acronym, but by analogy with C++, LAMP++ is actually not that far off the mark. The '++' means we're talking adding, or rather mandating, an OO approach to Perl (including an OO DBI abstraction layer), some form of templating, be it TT2, Mason or whatever, and some form of Apache-embedded Perl interpreter (mod_perl). We're looking for Perl programmers, not scripters, and we'd probably really like test-driven development, too. We're taking as our bible not the Llama and the Camel, but Perl Best Practices and Intermediate Perl, and to guide our philosophy we keep handy Perl Testing: A Developer's Notebook, and Perl Design Patterns.

LAMP++. It's got legs, I reckon. More anon.