Categories
Uncategorized

Java Leads To Great Libraries

Tim Bray wrote Having Done Java about how writing Java leads to better quality libraries. Needless to say, I disagree. I originally sent this by mail to Tim Bray, but I don’t think that there’s any reason to not publish it here as well.

I’m afraid that I’m going to have to disagree with you on this one. I’ve relatively little experience with Java, but I have been called upon to do some web things. And the standard library makes very, very angry when compared to CPAN[1]. There are a couple of aspects to this:

  • Firstly, everything seems to have been vastly overengineered. Simplicity got thrown out of the window from what I can see. I blogged about one incident (PUTting an URL), but there have been others, frequently involving the bizarre servlets API.
  • Secondly, the strong type system leads to weirdness. This isn’t necessarily Java’s fault, more the people who use it seeing no other way to do things. Again, I’m forced to compare with Perl here. I’m
    thinking in particular of URI.pm, which happily handles https, and http URLs. However, they’re completely different classes in Java. And if you try to feed in one to a method which expects the other, it’s no-go.

Ok, I’ll give in. I’m less moaning about the quality as to the bizarre design which I perceive. But it certainly feels like it should be a factor in any discussion of quality (nebulous as that might be).

1 I’ll admit, however, that there is a huge amount of crap in CPAN too. Anybody remember Meta.pm?

Categories
Uncategorized

XML::Genx 0.20

I pushed out a new release of XML::Genx last night. Nothing worth upgrading for, it just fixes a few compiler warnings under gcc 4.0. Thankfully, after some sage advice from Daniel Jalkut, I managed to get rid of the warnings I was complaining about. Unfortunately, there’s still one warning coming out. But it’s in code that is entirely generated by xsubpp, so there’s not a lot that I can do about it. Ah well.

Categories
Uncategorized

XML::Filter::Normalize 0.1

A couple of days ago, I released <a href="http://search.cpan.org/hdm/XML-Filter-Normalize-0.01/”>XML::Filter::Normalize, in order to clean up a SAX event stream where possible. Here’s Robin’s prodding. Anyway, it appears to work more or less as expected. I’m particularly pleased as it appears to have 100% test coverage. Now, I just need to make <a href="http://search.cpan.org/hdm/XML-Genx-0.19/lib/XML/Genx/SAXWriter.pm”>XML::Genx::SAXWriter depend upon it in order to make Aristotle’s original problem go away.

Categories
Uncategorized

new XML::Genx

XML::Genx 0.19 is now out. Changes include:

  • Allow namespace objects to be passed in to StartElementLiteral() and AddAttributeLiteral(). This makes it much easier to put things into the default namespace.
  • Add a missing “static” declaration to some XS helper functions.
  • Allow multiple different default namespaces inside XML::Genx::SAXWriter. Previously you would get a “Duplicate Prefix” error. Bug spotted by Aristotle Pagaltzis.
  • Make the tests work in perl 5.6.1. Not sure when I broke this.

I deliberately left out the SAX changes that Aristotle was talking about on the list, as I wanted some more feedback. I’ll do another new release in a few days if nobody has said anything.

Categories
Uncategorized

XML::Genx

Aristotle Pagaltzis has mentioned XML::Genx. Yay, it needs all the publicity that it can get. He highlighted some issues in XML::Genx::SAXWriter, which I need to address, although getting some consensus from the list first would be good.

He also mentions a problem with default namespaces a little further on. I’ll have to look into that one. I’m not sure if it’s a bug or Genx is supposed to work that way.

But it has made me realise that I need to upgrade the documentation that comes with Genx. The API usage is not always as clear as it could be, particularly when it comes to namespaces and optional function arguments. So a very good EXAMPLES section would do well I think.

Not only that, it’s also made realise that there’s some bad behaviour in there.

  1. Passing in a namespace object to StartElementLiteral() doesn’t work properly. It assumes that the stringification of the namespace object is the URL.
  2. The manner for using StartElementLiteral() to declare a default namespace sucks, badly. You have to declare the namespace object with the default prefix (ie: ””). Then, you have to call StartElementLiteral() passing in the URI yourself. And then you have to call AddNamespace() on the namespace object to switch from the genx created prefix back to the default. Very weird, but fixing the bug above would render this much simpler.

It’s really important to get this sort of thing fixed up so that the API is easy to use and works as expected.

Finally, I’ve also noticed that the last release had an unexpected failure (the Win32 stuff is at least expected failure). What’s irritating is that it’s nothing to do with my code. For some reason, version.xs is being picked up and mingled into my module. I blame the person submitting the CPAN tester report (for now, anyway). I’m sure I saw something about this on a use.perl.org journal recently…

Categories
Uncategorized

subatom 0.05

I’ve just released a new version of subatom, that now gets linking correct if you have viewcvs or similiar installed. Unfortunately, I’ve now realised that the amount of command line arguments are such that I’m going to have to start adding a configuration file to it. My crontab lines are looking a bit unwieldy.

Nonetheless, if you want to generate atom feeds of your subversion repository, give it a try. It seems to work quite well.

Categories
Uncategorized

New Releases

I released new versions of XML-Genx and Config-Setting last night. No particular reason to do so, apart from seeing that my kwalitee ratings could be improved by testing for valid pod…

In fairness, I do need to play with Devel::Cover a bit to see if my tests could be improved. And I need to carry on updating XML::Schematron. So much to do, so little time…

Categories
Uncategorized

subatom

Atom Enabled I released subatom last night. It’s a small tool to generate an Atom feed from subversion commit messages. It’s pretty simple right now, but now that the basics are there, I can improve on it.

Why not RSS? Well, basically I spotted XML::Atom first and it was dead easy to use. And Atom just happens to be new and shiny right now.

Categories
Uncategorized

XML::Genx Exceptions

I came across an interesting situation today. The exception thrown by XML::Genx showed up in completely the wrong place. I suspect that this is due to the fact that I’ve made it a dual valued scalar and Perl doesn’t want to overwrite by appending “at Foo.pm line 23” to the end of it. More investigation required.

Further investigation shows that it’s because I was using the “object” form of croak(), so Perl didn’t dare touch what I was doing. Doh. So I’ve now simplified things so that it works correctly. XML::Genx 0.12 is now up.

Categories
Uncategorized

Config::Setting

After picking up XML::Genx again, I reorganised my SVN repository and noticed all the other old projects in there. So I’ve started playing around with Config::Setting again. It was originally written to attempt to provide a “better solution” than a hard coded global hash for work. But it turned out that people liked having a hard coded global hash. Oh well. It may well yet turn out to be useful for some other purpose.

Regardless, it’s interesting to look inside it and see how my code has changed in the last few years. And looking back, I have this itch to change things, just make it a little better. So I’ve started working on it again. There’s no clear purpose in mind, I’m really just playing. But it’s fun! Hopefully, I’ll end up with something I can throw on CPAN.