Several rants

Despite of what's expressed in this blog post, I am generally responsive (as can be seen from my RT track record) and willing to be cooperative (or rather, not really willing to be uncooperative). I even often do the opposite of what I wrote below. It's just that sometimes you need to vent.

On people suggesting to use File::Spec (or Path::Class) everytime... Have using hard-coded "/" failed these days (on platforms that I care about)? Why do I have to subject myself to the verbose file('a', 'b', 'c') or even the masochistic File::Spec->catfile('a', 'b', 'c'), when 'a/b/c' works? The platforms which do not use "/" path separator are either old, dying, rare, or all of those. And new platforms being written won't even dream of not obeying the /. It's already becoming the overwhelming majority that assuming it works everywhere is the best practical approach.

On the other hand, issues like case-sensitivity or encoding in filesystems are still very real and common...

On people telling me to support 5.8.x... Well, breaking news for you, even 5.10.x is ancient (no longer supported by p5p). Why do I have to sacrifice by refraining from using // and having to write $foo = defined($foo) ? $foo : 'default'? Why do I have to avoid using named captures in my long- and often-tweaked regexes, and thus have to deal with $1..$24 and track the number of parentheses, which is very error-prone? I want my say and state and ~~, dammit!

When all my servers and clients have upgraded to Wheezy and beyond, I'll expect to repeat this cycle and ditch 5.10 for 5.12, 5.14, ... Sorry, I don't can't afford to care for people that are too behind. If you want to be supported, be a client and cough up some dough >:-)

On Windows ... I hate dislike don't care about Windows and I'm quite glad of the so-called Microsoft's lost decade. They never try to play nice with others, so why should I play nice with them?

On people suggesting to 'use utf8' ... I almost never have to put non-ASCII characters in my source code. I only name my identifiers with [A-Za-z0-9_] and would like to keep it that way. I read Chinese and French for a bit, but I avoid Unicode until it's unavoidable. So, no thanks.

On those suggesting to moosify, mousify, mooify my modules... I'll decide when I need to go OO, thank you very much. That's currently only about 5-10% of the time. I regard OO as a non-necessary evil. It offers features but comes with a cost, just like everything else. I prefer to keep simple things simple.

13 Comments

I agree with your premises, especially the addition of OO or compatibility concerns to code that I have no desire to support on other systems. But if it's software I've released with the intention of other people using it, my opinion becomes: Patches welcome, as long as it's a real problem.

"No OO interface," doesn't sound like a problem. "Not using Moos?e?," doesn't sound like a problem. "Doesn't work on Windows," sounds like a problem I can mentor someone in fixing. "Doesn't work on my ancient version of Perl," sounds like a problem that, if solvable, I can mentor someone in fixing.

Mostly +1 to all. Just the Windows isn't that true for me. I need things working there. Oh, damn life.

I disagree on most points.

I still use File::Spec, and in fact some of the software I maintain really does have to be that portable. I don't find it all that much of a hassle, it has become a habit. File::Spec is useful for far more than just concatenating a relative path.

I do still support 5.8 in most of my modules. Not because I would want to touch it with a ten foot pole, but because my users are thankful of it. That's the thing that usually motivates me to write modules.

And yes, I try to support Windows too when it makes sense, for exactly the same reason.

I «use utf8» when it makes sense, and don't care either way otherwise. I'm not seeing the point of that rant.

I don't use Moose all that much, but Moo makes my object oriented code so much nicer without costing me much. I wouldn't want to go without that anymore.

> why should I play nice with them?

Because most Windows users are actually not Microsoft employees and as such have done you no harm or evil. In fact, they are a valuable source of fresh blood for the Perl community, but instead of welcoming them, you spit in their faces and then wonder why most new developers instead opt for languages like Python.

Luckily many Perl developers have a much better attitude towards people using Windows.

I mostly agree, though personally I like to use Path::Class as much as possible. Not for cross-platform path separators, but just because it's incredibly convenient. Path::Class::File and Path::Class::Dir objects have all kinds of useful methods. OK, so many of them are just wrappers around the various File::* modules of the core Perl distribution, but those all have interfaces which are very inconsistent with each other. (File::Spec uses a pseudo-OO calling convention; File::stat overrides Perl built-ins to return objects; File::Basename and File::Path are exporters.) Path::Class wraps them into a cohesive whole.

I fully agree with Mithaldu. Well put.

I don't use Windows, true, but some of my users do. I don't use OpenBSD either but if an OpenBSD user asked me to do a simple task to make it work there, I'd be inclined to do it.

I don't put stuff on Github or CPAN because I consider it my own personal storage. I do it because I want it to be out there for people. This is why I document stuff, this is why I blog about it once in a while, this is why I offer help and support (at least as much as I can allow myself).

And if you put something out there for others to use (and not just you), expect some to ask you for a few changes if it will help make it work for them. They don't always choose their situation...

When you see how many hoops event loop developers jump in order to make it work on various operating systems, complaining about File::Spec suddenly becomes... well... silly. :)

Seriously, we gotta stop attacking Windows users. Just because their operating system is very uncomfortable to us, it does not mean they're the scum of the earth. There are far worse crimes, like walking on the grass and spitting in the street.

Perl was at a standstill for such a long time in the 5.8 period that 5.10 still seems “new” relative to 5.8‘s interminable reign. I figure that is a big part of the persistence of 5.8.

Also in many cases each individual use of a 5.10 feature feels like it makes sufficiently small difference that it seems… well, frivolous. It is only over a large codebase that the difference piles up. (Or in oneliners, where the total code is so small that the frivolous difference isn’t.)

Personally I’m starting to settle in for 5.12, for no more than the nitpicky point of finally being able to write if (defined $foo and length $foo) as just if (length $foo) (which no longer warns if $foo is undefined). I had proposed this change years and years and years ago and only now am I finally getting to use it… The problem is not that this isn’t a huge win every time it comes up, it’s just that it only comes up once every so often – right between rare enough and frequent enough that it seems a fastidious desire.

I cannot wait until 5.14 becomes an option for wide use, because the s///r flag is a really huge deal to me. Unlike the 5.10 features or my extremely choosy reason to use 5.12, that one feels like a genuine huge win every time I use it.

(Of course also 5.12 started and 5.14 finished a huge clean-up of the string model. You really really want that. But it’s not the kind of sexy dazzling feature to bring people in, no matter how big a deal. More like a removed repellent.)

I hate Windows. It's horrible.


And that's one of the reasons that I specially make ack run on Windows without having to do any magic. That's why I make it so you can download it as a single file.


I want to make it so simple for Windows users to get a taste of Unix goodness that there's no reason you wouldn't. Windows people don't have any decent greplike tools. ack is a great greplike tool. I want ack to be an oasis in the desert.


Getting people hooked on Unix is a win for them. Getting people hooked on Perl is a win for Perl. Interest in Perl feeds interest in Unix and vice versa. Anything we can do to help encourage that helps Perl.

This is a great example of the conflicting views on tolerance and liberty :)

"Fork" and "pull request" are very helpful. Even just having a good attempt to add the feature and sending a pull request will often inspire the original author to tidy up and merger or implement in a way that suits them.

I wrote a module who's claim to fame is that it *doesn't* use moose (see NetAddr::MAC) but i also having an OO framework for larger projects.

When someone sent me a pull request that implemented mac address to ipv6 address conversion i was very pleased. I reworked it to suit how i like things, then was inspired to add token ring functions (which are totally pointless but are there for completeness).

Maybe someone will want to use ipv6 on their token ring network and now dont have to deal with the boring hex crunching when handling mac addresses.

File::Spec is really bulky and i typically implement it as an after thought. And i generally prefer qw( foo bar woka ) over ('foo','bar','woka') as i want punctuation to reinforce what i am doing - not obscure it.

Leave a comment

About Steven Haryanto

user-pic A programmer (mostly Perl 5 nowadays).