fREWdiculous!
28 Apr
I like to continually move towards perfection in my code. perlcritic is a tool based on the book Perl Best Practices by Damian Conway. It’s basically lint for perl.
perlcritic is fine as it is if you spend all day on the console, but I usually spend my whole day in Firefox and vim. The only use for my console is checking in source and using irssi. There are a few other things I use the console for, but the point remains, I spend more time in Firefox than I do in the shell. The same is true of my coworkers: we are a windows shop; without installing cygwin using the console is fairly painful. And if it’s a hassle for me there is no way I can convince my coworkers to use it.
So I developed WebCritic. At some point I’ll make a real website for it, but for now this will have to work. I have other things I want to work on more, but I am using this daily at work so I presume that people might use it
. Anyway, it depends on:
1 2 3 4 5 | IO::All Perl::Critic CGI::Application CGI::Application::Dispatch Moose |
After checking it out from github you’ll want to start the critic server. It’s just a tiny server that keeps criticisms around for files that haven’t changed. With a fairly small codebase that took the load time down by a factor of 10. It also means that you don’t have to give the world access to your code. Just have the user owning the code run the server and your real webserver will talk with the mini server.
Now as to how to set up the real webserver…
I’ve been using Apache for the whole thing, so it’s been fairly simple getting it all going. If you want help getting it going with IIS I can help. Just leave a comment. Anyway, the config that I use for apache is in the devdocs dir in the repo. Just Include it in your main apache conf file. In ubuntu you only have to make a symlink to it in /etc/apache/sites-enabled.
You also need to start my mini server. I haven’t set up any script to autostart it as I prefer to start it as a user. Basically all you need to do is cd into the repo dir and run
1 | perl bin/server.pl <directory-to-monitor> |
The first time that it checks through the code it will take a while (mine takes 15 seconds,) but after that it should be pretty quick.
After getting all this going you should just have to go to http://localhost:5000/critic and you’ll get a nice listing of all of the criticisms from perlcritic. You can put a .perlcriticrc file in the dir that the server monitors to customize perlcritic. Note that all the columns are sortable and there are more columns that are hidden by default. Most importantly, the javascript will automatically query the webserver for data every 30 seconds, but if you want to know now press Alt+R while the page has focus and the page should reload the data (but not the page itself!)
Enjoy!
23 Apr
Ok that article is really long. Here’s the breakdown. Basically Matthew S Trout, the main guy who makes DBIx::Class, made a similar observation as other people. More specifically, Perl people don’t blog enough. With that in mind Mr. Trout gives some compelling reasons to start! So read the article.
Also: lots of things are coming out lately! Ubuntu 9.04 just got pushed to my laptop, and my phone is gonna get updated from 1.1 to 1.5 (read: on screen keyboard!) in less than two weeks! Woo! WOO!
9 Feb
I watched this keynote from frozen perl this weekend and it was pretty great. There are plenty things to take from this presentation, but the thing I want to mention comes from slides 66-77. Consider that mandatory reading to understand this blog post.
Now read this, this, and almost any of these.
Caveat Lector: All of those links may be outliers. I am certainly not reading a statistically valid sample of The Webternet; so maybe just consider this some random observations from this random dude.
Also: All of the above linked people are smarter and more motivated than I am. I would not criticize their intelligence in the least and their technical skills has my respect for sure. What have I done? A job? Helped move some books to people that needed them at school? Some stuff at a hospital? Compared to Rails, Mongrel, and Archeo- whatever. Compared to those guys I am nothing. Keep that in mind.
I just think it is important that in the perl world we have keynotes where people say: “Be Excellent to Each Other.” People say that perl is dead. I disagree. You should see how many blog posts there are out there saying, “no, perl is not dead!” But I would much rather perl be dead than perl be a bunch of jerks.
Basically this boils down to the difference between me and those other programmers. I think that our priorities should be:
Even if you aren’t a Christian I still think that exactly that priority list matters: Code is useless without users. Maybe they think they are exceptions because they are the users. Fine. I just know that if I see Giles, Zed, or DHH in real life I will be like, “Wow, what a great coder! Probably don’t want to actually hang out with them for more than 10 minutes though…”
Maybe I’m wrong though. Maybe the internet is just not a place for being nice. I just know that I am going to try to do my best to “Be Excellent to Each Other.”