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.

Advertisements

2 Comments

  1. Posted December 11, 2006 at 14:12 | Permalink | Reply

    I think the spacing function is an HTML thing. No matter how many spaces you include in HTML, it’ll only read as one unless you use a blank character (& n b s p 😉

  2. Posted December 11, 2006 at 14:12 | Permalink | Reply

    That’s a semi-colon and a parenthesis at the end, not a wink…

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

  • Pages

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

  • Recent Comments

    russurquhart1 on SPITBOL for OSX is now av…
    dave porter on On being the maintainer, sole…
    daveshields on On being the maintainer, sole…
    Paul Tallett on On being the maintainer, sole…
    mrrdev on On being the maintainer, sole…
  • Archives

  • Blog Stats

  • Top Posts

  • Top Rated

  • Recent Posts

  • Archives

  • Top Rated

  • %d bloggers like this: