Inside out objects

So a few weeks ago I stumbled across perlcritic. Which led to finding Module::Starter::PBP as a way to try to stop the carping my code was generating with missing perldoc, etc etc. I’ve been looking at Perl Best Practices on OReilly’s Safari, but I’ve never really sat down and read it online. So because perlcritic seems to hate lots of things about my code, and because each complaint is backed up by a page number in PBP, I decided to buy it.

Last night I was reading through it over my late dinner (Brooke recycled the newspaper) and I stumbled across Inside Out Objects. What a cool concept. I always feel like Perl is far more advanced than it is given credit for being, and I am also struck by its similarities with JavaScript, possibly because both of them can be pretty freewheeling, but also respond well to careful programming.

Anyway, one of the things I’ve noticed in JavaScript is that it is relatively easy to subvert an object. Even Google Maps objects, wrapped up in closures and all, can still be manipulated somewhat by using some of the inheritance methods described by Douglas Crockford.  So  I wonder if it is possible to use inside out objects in JavaScript?  I wonder if that would prevent unauthorized access to internal data and methods of an object.  I have to think about how to do it right, because JavaScript doesn’t have a bless mechanism, but maybe even though you still use a hash as an object, you can still invert the object’s methods to use the hash signature as a key to internal hashes/objects that do the real work.  I don’t know if there is an ident function, but I’m pretty sure one can hack up a UUID, even if it has to be generated server-side (either make a list of UUIDs at load time, or set up a service to spit out UUIDs, or both).

I guess I should try it and see.  Perhaps I should try the technique in Perl first.

The pin in my elbow is sore

Git, perlcritic, Eclipse, Javadoc and CPAN are all mishmashing together in my head.  I am beginning to get the hang of how to program and maintain a project.  But there are still nits to pick everywhere.  perlcritic wants revision control information in every file.  Git doesn’t appear to do that, and the git mode in Emacs doesn’t do that either.  Eclipse probably can stuff revision control information into java files, but it doesn’t seem to like producing package-info.java files to describe a package.  I think I can learn how to use git a little better, and perhaps I can work out a way to add tags and then ferret them out automatically in Emacs to populate a header, either in javadoc  or Perl POD.

But right now I have a couple of days of meetings.  Just got out of a corridor systems management and microsimulation training meeting, and about to head off to a symposium put on by the Econ department on Energy Policy in Society.  Then tomorrow is our monthly Testbed meeting.

And my elbow is sore.  Perhaps I need to get the pin taken out?

Horrible gloomy day

It was a sad morning on the bike, with Grace moaning and whimpering and carrying on.  It is a good thing we live in a warm climate, or we’d never hear the end of it.   I finally lost my temper when we hit the hill and my front derailleur refused to drop the chain down to the smallest chainring.  I rarely use it, and it’s gotten out of alignment.  But speaking sharply or speaking sweetly both had the same effect—Grace still whimpered.

Then there were workers spraying weed poison in the park near our photo tree, so no picture this morning.

Finally when we got to school Grace began to cheer up.  Mr. Brad was working there, and Grace got a little shy, so he teased her that she wasn’t looking at him and got her to smile.  Yay for Mr. Brad.   Grace was still trying to put on a sad face with all her might, but it was beginning to fade at the edges.  The bell rang and all the kids screamed and started running to class as we rolled up to the lower grades courtyard.  Grace pulled off her ankle straps and I traded them for her lunch, then I gave her a big hug and told her I loved her.  She still wasn’t quite happy, but did seem noticeably  less sad.  So I asked her –Do you want me to throw you up in the air?  She said –No! but I picked her up and threw her anyway.  Finally a smile!

Miss McKenna was clever enough to notice Grace was trying valiantly to be sad and cold, so instead of asking about that, she asked whether her tooth was out yet.  Yay Miss McKenna.  She said –Can I see your hand out please? and Grace popped it out of her jacket and shook hands, said –Good morning! and was off.

Still a horrible gloomy day out.  Hopefully Grace’s good mood had held on though.

B-17 saddle

More new stuff for my bike arrived yesterday (yay Rivendell’s shipping department).  New tires, because my old rear tire had a developing tear in the sidewall that was bulging every so slightly and making that dangerous whump whump sound.  A new saddle, Brooks B-17, because my old one, well, was old.  the girls liked my new brown saddle.  They kept saying it looked like wood.