Daily Archives: December 11, 2006

The two-character guide to finding a bug in WordPress

The previous post in this series contains just two characters. It is supposed to summarize many of the lessons I have learned about how to write an effective blog post.

Unfortunately, as I was about to post it, I suspected it would also illustrate one of the lessions I learned in the several decades I spent writing code — look at the edge cases.

The post has title “?” and content “!,” by which I mean to show that to blog effectively you must choose titles the attract the reader’s attention and then write content that makes them want to come back to more.

Sad to say, my concerns about living on the edge proved warranted.

I could have ignored this, but programmers aren’t allowed to ignore bugs. So let’s put on our programmer’s caps and deal with this before moving on to the real purpose in writing that two-character post.

When you write a post you can enter any string in the title. But WordPress makes some operations on the string before generating the actual title used for the post. For example, WordPress will treat two or more successive blanks as though only one blank were written. [1]

WordPress also strips out certain characters from the title you write in generating the web address that will be used to access your post, both to respect certain web standards and to allow your posts to be displayed the same way in different browsers.

Among those characters are “?” and “.!”. This means that the posts

Title: ? X
Content: ! X

and

Title: ! X
Content: ? X

both generate a URL that ends in just “X.” The same URL results for any combination of “?” and “!” used within the title.

And if the title contains just such stripped characters, then WordPress generate a URL consisting of just the blog post “id,” a common term in programing that is a short way of writing “identifier,” by which is meant some convention for distinguishing one case from another. We also have id’s in everyday life, such as the use of Social Security Numbers, SSN’s, to distinguish individuals in the United States.

This example is an instance of an “edge case” or “boundary behavior.” For example, a word-processing system should be able to hande a book with an author, but no content’ a book with no author, and some content; or a book with both an author and content. Chapters should work even if they have no sections, paragraphs if they have no words, an so forth, all in a sensible manner.

Whether this is a bug in WordPress as “working as expected” is an open question. We’ll let you make the call, though I see some kind of unexpected behavior here, and so tend to come down on the side of this being a bug.

Our apologies for the programmer’s interruption. We’ll now resume our scheduled tutorial on effective blogging.

Notes.

1. If this isn’t the case, I wouldn’t be using WordPress; it would be insane to blog if spaces mattered in this way. But it is, and that’s one of the reasons I am a WordPress user.

?

!

On blogging: The two-character guide to writing a successful blog post

The next post in this series will consist of a two-character post.

It summarizes many of the lessons I have learned about blogging in the almost two hundred posts I have written in the last 90 or so days.

We’ll elaborate on more on those lessons after the short post.

  • Pages

  • December 2006
    M T W T F S S
     123
    45678910
    11121314151617
    18192021222324
    25262728293031
  • RSS The Wayward Word Press

  • Recent Comments

    daveshields on SPITBOL for OSX is now av…
    Russ Urquhart on SPITBOL for OSX is now av…
    Sahana’s Respo… on A brief history of Sahana by S…
    Sahana’s Respo… on A brief history of Sahana by S…
    James Murray on On being the maintainer, sole…
  • Archives

  • Blog Stats

  • Top Posts

  • Top Rated

  • Recent Posts

  • Archives

  • Top Rated