The Funhouse Mirror of Perl Criticism

Circus infograhpic.

Last week's article got a great response on Hacker News, and this particular comment caught my eye:

I think this is the real point about Perl code readability: it gives you enough flexibility to do things however you like, and as a result many programmers are faced with a mirror that reflects their own bad practices back at them.

-orev, Hacker News

This is why Damian Conway's Perl Best Practices (2005) is one of my favorite books and perlcritic, the code analyzer is one of my favorite tools. Although, the former could do with an update and the latter includes policies that contradict Conway. Point perlcritic at your code, maybe add some other policies that agree with your house style, and gradually ratchet up the severity level from "gentle" to "brutal." All kinds of bad juju will come to light, from wastefully using grep to having too many subroutine arguments to catching private variable use from other packages. perlcritic offers a useful baseline of conduct and you can always customize its configuration to your own tastes.

Canada, LOL, and Randie

Every so often, I enjoy taking things into a different perspective. In this article, I want to talk about some experiences which have caused me to think about how I am communicating with others — not only in IT, but in my daily life.

But...I Am Not IN Canada!

About every six weeks, I place an online order for a container of liquid iron for my toddler son to take on a daily basis. From my home in the Midwest portion of the United States, I open up a browser, navigate to the website, and start my shopping experience. Where things get a little off track is when I start looking at the pricing — especially during the check-out phase of my online order experience.

React.js Context Tutorial: A Better Way to Store State?

While creating a component in a typical React app, we end up creating layers of functional components and class components. Much of the time, we end up following a pattern where we pass props to a functional or class component from Grand Parents to Great Grand Children (referring to the hierarchy shown below). There are cases when props are not required at a certain level but are there just to be passed to another component.

We can use React's context pattern to solve this problem. It's based on the Consumer Provider pattern, i.e. a producer stores the state and methods to manipulate the state and the consumer can access them whenever necessary.