Archive for the 'writing' Category

Editing made easy: 6 words to cut out

Saturday, April 26th, 2008

When you write something: a book, an article, an email… cut out needless words. The copy after editing should be shorter. Writing is not speaking, it must be tighter. (And, if you find an email is getting longer, just phone the person, he'll never read the email anyway)

I've read somewhere Mark Twain was saying that "very" should always be cut out. I started paying attention to my use of "very" and found that a sentence only wins after I un-very it.

Today I came across this article listing 5 more words to cut out. So here's the list of no-no words, should make any editing process much easier:

  • very
  • really
  • just
  • quite
  • perhaps/maybe
  • that

Check the comments too, there was an interesting insight about words we use to "temper" our speech which we should probably omit when writing, words such as "slightly", "a bit", "somewhat".

And here's another excellent piece on editing I just found:

there is no good writing, only good re-writing

 

A collection of writing tips

Saturday, April 19th, 2008

A collection of writing tips here, includes advise from Stephen King, Paul Graham, Scott Adams and others.

In the end, if you want to write well I believe it all boils down to:

  1. write - daily
  2. edit - cut out needless words
  3. read - everything you can lay your hands on

It's so simple and yet we keep looking for the "secret". Same with dieting: all boils down to a/don't eat junk and optionally b/exercise. But we keep looking for the shortcut, the miracle diet that will allow us to "take it off and keep it off" while lying on couch on front of the TV.

 

replace selected text (Firefox)

Thursday, March 6th, 2008

A quick function to replace the selected text (in Firefox). Accepts:

  • string to replace the selection, or
  • callback function that takes the selected text and returns a string to replace the selection
function replaceSelection(t) {
  if (typeof t === 'function') {
    t = t(window.getSelection().toString());
  }
  var range = window.getSelection().getRangeAt(0);
  range.deleteContents();
  range.insertNode(document.createTextNode(t));
}

Usage:

1. Replace selected text with "dude"
replaceSelection('dude');
2. Uppercase the selected text
replaceSelection(function(s){return s.toUpperCase()});
3. Lowercase the selected text
replaceSelection(function(s){return s.toLowerCase()});

Luckily I'm so close (and yet so far) to finishing this book, otherwise I won't be able to help myself but create a whole toolbar of bookmarklets for "power" Google doc users

 

There will be junk

Monday, February 18th, 2008

Tip #1 for writing better code - edit. With this book I write, I find I'm spending more time editing than writing. The first draft is usually bad. The first draft "works" in the sense that it covers the material, but not necessarily in the best possible way.

Same thing with writing code, it's one thing to have the code working and it's a separate thing to have the code easy to understand, efficient, maintainable, expandable. When you're working on a problem, sometimes you just try different things. One of them works. It's your job not to stop there but to edit this first draft. Don't commit first drafts.

There will be junk. It's up to you to make sure that junk doesn't find its way to the final product, only because "it works". It may work now, but how about tomorrow. Is your code fit for print?

 

Google docs bookmaklet to format code

Sunday, January 27th, 2008

Something has been annoying me for some time as I write this book in Google Docs: I want to be able to format text as code (Courier New) only using the keyboard. So I came up with this bookmarklet. It's one of those "works for me" so if it doesn't work for you feel free to modify and post here your version.

Code

Basically I attach an event (FF way, so won't work in IE) that listens to the keyboard combination ALT+x and then calls the appropriate editor command:

javascript:(
function(){
  window.frames[1].document.addEventListener(
    'keypress',
    function(e){
      if (e.altKey && e.charCode === 120){
        EditorCommand('fontname', 'Courier New');
        return false;
      }
    },
    false);
}
)()

Download

Right-click, bookmark:

Alt+X

 

Zlatina = 4

Saturday, January 26th, 2008

So close to being finished with 5 chapters and 1 appendix of the new book (hey, that's 50%+) and just after the n-th edit of chapter 3, I thought I might share this picture I have on my desk. It's an self-portrait of my 4yrs old daughter Zlatina, in front of a window. Once this book is out of the way, she's so getting her own blog :)

zlati-sun-sky.png

 

How to write computer books

Thursday, December 13th, 2007

book.png David Barnes, who works for my publisher Packt Publishing, has started a blog: "How to write computer books". Great stuff in there. If you write or intend to write a book, a blog or anything technical, it's a great addition to your RSS reader.

Inspired by this quote from Mark Twain, yesterday I went through the draft of chapter 3 of my new book and searched for all instances of the word "very". Then deleted most of them. Probably should've deleted 'em all, but I couldn't help myself. It's tough. Very.

Anyway, especially since "creating passionate users" is no longer updated, David's new blog is good news.

On a similar note, here are the slides from a presentation called "Writing engaging tutorials" by my fellow Yahoo, Christian Heilmann.

 

On Raymond Chandler's writing

Friday, October 26th, 2007

I've never been into crime fiction. I mean I've read The Hound of the Baskervilles, but that's about it. I like Douglas Adams, Terry Pratchett, looove Kurt Vonnegut, enjoyed On the Road, Catch-22… So it came as a surprise even to me when I started reading Raymond Chandler and actually enjoying it. The thing is I love to learn about the places I visit - culture, people, history, geography. Living and curious about LA now, I came across an article saying that Chandler wrote quite a few things about LA and California that stuck around. Anyway, I picked up a volume, read The Long Goodbye and loved it.

Just read an article about Chandler's writing process. Since I just started working on my new book, I found the article pretty interesting. The "normal" editing process I think is: you write a draft, you review it and scratch some parts, maybe replacing them with others, adding, removing. Chandler did the opposite - he underlined only the words that will stay in the next draft, everything else is to be rewritten or simply gone. This way he could tighten his sentences if not cut them in half. I like that a lot. Short is good, short is often clearer. It's so easy to be verbose, hoping this will clarify whatever you want to say. But often it isn't. I believe Mark Twain said something like "I would have written you a shorter letter, but I don't have the time"

That makes me think - it's so bad that most computer books today don't aim for brevity, but for volume instead. I've heard authors saying that their publishers love to ship big ass books on the market, because supposedly readers want big books. If it's big, there must be good stuff in there. Luckily my publisher is not like this, of course :) Although they would probably also agree that the overhead of publishing a 100 pages book is pretty much the same as a 1000 pages book. A tiny book still needs to go through the same process as the big one. So why not ship a bigger volume that will look more impressive. Imagine the dialog:

- Honey, how do you want to decorate this room?
- Hmm, I'd love to have a shelf of Java books right there, about four feet long. Yes, and right below it, gimme some design patterns and some .NET, half and half. Fabulous!