Our new addition

Our new addition
The Office of Marketing and Communications is pleased to welcome Gina Prodan, to our Web development team.

The Office of Marketing and Communications is pleased to welcome Gina Prodan, to our Web development team. Gina comes to us from Kent State University where, in her capacity as Senior Web/Editorial Specialist, she worked on—among other things—the award winning Kent State Magazine Web site.

Gina is just settling in right now, getting her computers configured and such, but we’ll soon have her busy building sites, answering questions, and sharing her insights here on the Web Development blog. (In fact I’ll be tagging her to follow up on a blog meme later today.)

Manipulating innerHTML removes events
Others have written about this before, but I thought I’d mention it again, just so you don’t miss it. Aleksandar Vacić found it while playing with tables and their cells. I found it when Robert and I played with nested lists. It works the same across browers. Let me show a quick example: You have a […]

Min-width and Max-width template
Some problems seem to appear again and again, and one of them is page width. How wide should a site be? Should you adapt to 800px resolution? 1024px? Fully fluid with percentages? Perhaps elastic using em-units? There are lots to choose from. What I’ve found is that there’s one solution that almost always works. You […]

Voice and Tone: Writing to reflect your personality as well as your message (Part 2)
When I first broached this topic in October, I wrote about tone. Today, I’ll focus on voice, that certain aspect of writing that conveys the personality and/or style of the writer. Unlike tone — which is geared to your goal and audience — voice is about you, the writer. Just as your speaking voice remains recognizable under different circumstances — whether you’re reading stories to small children or arguing about the gift return policy at the mall — so, too should your written voice.

waveform of my voice
This is a waveform of me reading the title of
this entry
. Our written voices can be as unique
as our spoken voices.

When I first broached this topic in October, I wrote about tone. Today, I’ll focus on voice, that certain aspect of writing that conveys the personality and/or style of the writer. Unlike tone—which is geared to your goal and audience—voice is about you, the writer. Just as your speaking voice remains recognizable under different circumstances—whether you’re reading stories to small children or arguing about the gift return policy at the mall—so, too should your written voice.

What exactly defines my voice or style?

Your voice and style reflect patterns you use in crafting sentences and paragraphs. Just as you recognize your handwriting by the shapes you make in lettering, you’ll recognize your written voice by sentence structure, vocabulary, punctuation and other ways you present ideas. My writing often includes examples, metaphors or analogies—especially my fiction. I also have a habit of using em dashes for parenthetical remarks. This is a habit I acquired back when I was writing ad copy. The passive tense is one for which I sometimes have a predilection, as is my frequent use of the word “one” in place of he or she—to avoid those pesky gender issues. I could go on, but I think you get the idea. The English language allows for a great deal of latitude when it comes to developing a voice. Yours can be as unique as your fingerprints.

Why should my voice remain constant? Shouldn’t I adapt it to circumstance as I would tone?

Your voice is part of your brand as a writer. As you use your voice it becomes familiar to your readers. This helps them know how to interpret your prose and what to expect from you in the future. The voice you use today can offer clues into how you should be read tomorrow. If you changed the nature of your voice with each blog entry or paper, readers could get confused and misinterpret both subtle nuances and seemingly obvious statements.

Your voice also guides the hands that type. If you’ve developed a comfortable style, the sentences will pass from brain to keyboard more smoothly. If you are constantly reinventing your style, this won’t happen. Instead you’ll spend more time reworking your sentences, forcing them to fit into the mold of the moment.

A well-developed voice serves both writer and reader.

What if I get a job that requires me to write in someone else’s voice?

There may be times when you have to write for someone else, for example as a speech writer, or to ghostwrite the autobiography of Thomas Pynchon. The latter will obviously never happen, but as you become familiar with the nuances that make up your own voice you can also learn to pick up on the traits of someone else’s. This will make it easier to craft that speech or memo for your boss or client. If you ever got caught forging a note from your mother in order to skip school, you’ll know this is a skill that takes time to develop.

How do I find my voice? Won’t it just come naturally?

One finds one’s voice through reading and writing. By reading omnivorously you are exposed to a variety of styles and will learn which you prefer. By writing frequently you can fine-tune how you adapt such styles for yourself. I think much of this does come naturally. Everything you’ve experienced—from the conversations you heard as a child to the classes you took in school—contributes to the way you arrange words—both orally and on the printed page. But developing constancy requires practice. Just as a chef must both taste and cook a variety of foods to learn how ingredients will interact, so must a writer read a diverse sampling of literature and practice putting words to paper to understand how words flow together.

Writer’s must also adapt to the well-intentioned comments of their readers, be they teachers, friends, publishers or others. Our readers all have styles of their own and will usually be happy to give us input when we ask. Sometimes their ideas will bring new light to a murky paragraph; other times they may suggest change for the sake of change. By reading enough to be familiar with many styles—and writing enough to be familiar with your own—you’ll be better able to judge which ideas are which.

While researching this I read a variety of conflicting opinions on how to develop one’s voice. Some suggest mimicking the styles of others, while others say to focus only on your own voice. You may have to experiment to find what method works best for you, but the following resources may give you some additional ideas.

Voice and Tone Resources

Howto: Write a plug-in
In my previous post, I listed 6 things that you should try in Rails. I also promised some example code to get you started. Since I have already covered installing and upgrading rails, the next cab off the rank is writing a plug-in. Plug-ins are fantastic - they allow you to abstract away common code into […]

In my previous post, I listed 6 things that you should try in Rails. I also promised some example code to get you started. Since I have already covered installing and upgrading rails, the next cab off the rank is writing a plug-in.

Plug-ins are fantastic - they allow you to abstract away common code into nice little bundles that you can re-use on other projects. Rails even has a built-in system for downloading other peoples plug-ins straight from their SVN repository. With the change over to Rails 2.0, some used-to-be-core functionality has been moved into plug-ins, to clean up the core tree and to allow other developers to release new versions of the plug-ins outside of the regular Rails release cycles.

In this (very brief) tutorial, we will create a plug-in called acts_as_blabbermouth that will print out random quotes . Obviously this plug-in is of little use in the real world, but it should act as a nice demonstration of how plug-ins work.

It’s really easy to generate the boilerplate code thanks to the generate script. To start your plug-in, run the following command in the root of your Rails app:

   script/generate plugin acts_as_blabbermouth  

You should see an output similar to this:

   create  vendor/plugins/acts_as_blabbermouth/lib  create  vendor/plugins/acts_as_blabbermouth/tasks  create  vendor/plugins/acts_as_blabbermouth/test  create  vendor/plugins/acts_as_blabbermouth/README  create  vendor/plugins/acts_as_blabbermouth/MIT-LICENSE  create  vendor/plugins/acts_as_blabbermouth/Rakefile  create  vendor/plugins/acts_as_blabbermouth/init.rb  create  vendor/plugins/acts_as_blabbermouth/install.rb  create  vendor/plugins/acts_as_blabbermouth/uninstall.rb  create  vendor/plugins/acts_as_blabbermouth/lib/acts_as_blabbermouth.rb  create  vendor/plugins/acts_as_blabbermouth/tasks/acts_as_blabbermouth_tasks.rake  create  vendor/plugins/acts_as_blabbermouth/test/acts_as_blabbermouth_test.rb    

As you can see, all of the boilerplate code has been created in the vendor/plugins/acts_as_blabbermouth directory.

The README and MIT-LICENSE are just generic text files that you should fill out - generally, the README file is the first place a new user will look for instructions on the plug-in.

The lib directory will hold the guts of your plugiin. The tasks directory is a place where you can store any rake tasks that your plug-in might need. The tests directory is, well, pretty self explanatory - just as you can test your Rails app, you can test your plug-in too. The install.rb and uninstall.rb files are called when installing and uninstalling your plug-in - you can place code here to initialize your environment and to cleanup after yourself. Finally, init.rb is the file that Rails actually calls to load your plug-in.

The main file we have to worry about is /lib/acts_as_blabbermouth.rb - this is where our main code will go.

Firstly, we need to include the acts_as_blabbermouth.rb file into the environment. This is done by adding the following line to the init.rb file:

   require File.dirname(__FILE__) + '/lib/acts_as_blabbermouth'   

Next, we add the following code to lib/acts_as_blabbermouth.rb

   # ActsAsBlabbermouth  module ActiveRecord #:nodoc:    module Acts #:nodoc:      module Blabbermouth #:nodoc:        def self.included(base)          base.extend(ClassMethods)        end          module ClassMethods          def acts_as_blabbermouth            include ActiveRecord::Acts::Blabbermouth::InstanceMethods            extend ActiveRecord::Acts::Blabbermouth::SingletonMethods          end        end          module SingletonMethods          def quote_me            quotes = [              "When you come to a fork in the road, take it. -Yogi Berra",              "Every child is an artist. The problem is how to remain an artist once he grows up. -Pablo Picasso",              "What we anticipate seldom occurs; what we least expected generally happens. -Benjamin Disraeli",              "Drive-in banks were established so most of the cars today could see their real owners. -E. Joseph Cossman",              "The greatest pleasure in life is doing what people say you cannot do. -Walter Bagehot"            ]              quotes[rand(quotes.size)]          end        end          module InstanceMethods          def quote_me            self.class.quote_me          end        end      end    end  end    ActiveRecord::Base.send(:include, ActiveRecord::Acts::Blabbermouth)     

Now, create a model file called quote.rb by running

  script/generate model quote 

and add the following line after the class declaration and before the end declaration

   acts_as_blabbermouth   

Fire up the script/console and type:

 Quote.quote_me 

Voila! If all went to plan, you should see one of the random quotes. Congratulations! You just wrote a plug-in!

So how did we do it?

  1. We drilled down in to the ActiveRecord::Acts module and mixed in a module called Blabbermouth. This acts like a namespace in other languages, so we can create our own set of classes and methods without stomping on other peoples plug-ins.
  2. We override the included class method, which gets called when the plug-in gets mixed in to another module. Here, we include the ClassMethods module, which exposes the acts_as_blabbermouth method to the model class
  3. We define the acts_as_blabbermouth method. All this method does is include the InstanceMethods and SingletonMethods modules. The InstanceMethods module contains all of the methods available on an instantiated object and SingletonMethods contains all the methods available to the un-instantiated class.
  4. We create a SingletonMethod called quote_me, which returns the random quote. This can be called by calling Quote.quote_me. We also create a method called quote_me in the InstanceMethods module, which calls the SingletonMethod - this way both the class and the object can call the quote_me method.
  5. Finally, we call ActiveRecord::Base.send(:include, ActiveRecord::Acts::Blabbermouth) which tells the ActiveRecord::Base module to include the code we have written.

For those of you playing at home, I’ve attached the plug-in source in a tarball, so you can get a better idea of how it all fits together. So off you go, go and create a plug-in yourself!

This article provided by sitepoint.com.


Leave a Reply

You must be logged in to post a comment.