Mocking Should Not Require Interfaces

Exploring the ecosystem outside Perl, I have found multiple examples of languages and frameworks that require you to implement your classes as an interface + an underlying engine class when you want to mock that class during testing. This is all fine and dandy if the interface can be used as part of multiple classes. However, if the only reason you have an interface is so you can mock this class during testing, then I would call that a language-runtime smell.

If you are never going to use the interface for anything other than mocking, then you are violating both DRY (Don't Repeat You…

Simple (Date) Range Overlap Detection

I started down this particular rabbit hole when (a) I had to check for date range overlaps when worrying about scheduling appraisals; and (b) my attempts to use SQL BETWEEN resulted in complicated, hard-to-read SQL.

Now you would think that BETWEEN should give you easy-to-understand SQL for date ranges. Maybe in the hands of others BETWEEN does, but for me by the time I accounted for all of the cases the BETWEEN-based SQL date range overlap detection got more complicated than I thought it needed to be. So I drew up some diagrams, which eventually led me to the realization that this:…

Stack Overflow Considered as a Grimoire or Trove

Back in the day, when I came upon a particularly juicy tip/hint/trick/kludge/etc. I would write it down somewhere (way back -- in a paper notebook; more recently, somewhere like TiddlyWiki). But I don't do that anymore -- why?

The answer is Stack Overflow. When I have a question, a web search often has 1 or more Stack Overflow answers at the top - answers that usually help me fix (or work around) the problem I have. It really is impressive how often Stack Overflow has just the answer I need and in just enough detail. (Disclosure: I answer questions on Stack Overflow on a semi-regular …

The Seven Steps to Perl Mastery by Tom Christiansen

(Reposted - originally by Tom Christiansen, preserved by Ilya Chelpanov at http://i72.narod.ru/perl-mastery.html, reposted here for convenience and posterity.)

The Seven Steps to Perl Mastery
by Tom Christiansen.

A Perl Novice ...
- Thinks CGI and Perl are interchangeable terms.
- Still thinks Perl looks like bad C code viewed over a noisy modem.
- Is insecure about the concept of dollar signs and at signs.
- Thinks Perl should be more like sh or tcl.
- Has heard of the `` Unix mindset '', but hopes it's a treatable condition.

Way OT: James Mickens - The Funniest Person in Computer Science?

Read The Night Watch and tell me that I'm wrong...

(The syntactically-correct Perl script mentioned in the article is indeed syntactically-correct. (Extra points if you can tell me what it does.))