I’m Writing a Book

I’m writing a book. It is a technical book on developing web applications using the Grails framework. I won’t get any more technical than that in this post because what I want to talk about is what I have learned so far from the experience of taking on a project of this scope. So all of my non-technical readers can read on without fear of your eyes glazing over.

It all started when I discovered that a new major version of the Grails software was being released. As I read the description of the new release I began to realize that it was quite different from the version that I  had been using. I did what I always do when confronted with new software, I looked for a tutorial book to read on it. This time there wasn’t one.

The books covering the previous release of the software had not been out for that long and I imagine the authors of those works were taking a much needed break before taking on such a substantial rewrite. It occurred to me that since I was going to have to learn the new software anyway, I should take it as an opportunity to write a tutorial book about it.

I have wanted to write, and publish, books for quite a while. Four years ago I started writing a daily journal entry at 750 Words. At first I spent a lot of time writing about how many words I had written and how hard I was finding it to sit and write seven hundred and fifty words at one sitting. But slowly, day after day, week after week, I started to write about more interesting things. I wrote about what happened the day before. I wrote about my plans for the day. I wrote snippets of stories, I like to call them sketches.

One year I took on the Nation Novel Writing Month challenge to write a 50,000 word novel during the month of November. The first time I tried I got the flue the second week and got hopelessly behind the 1,700 word/day pace necessary to complete the challenge. The next year I was too busy with other commitments but the year after I completed the first draft of a novel of the requisite size within the month allowed. It needs a lot of work before I would want anyone else to read it but I proved to myself that I could do it.

I follow the blog of Dave Winer, the creator of both blogging and podcasting. Dave often talks about how he goes about writing software. One of the things he recommends is that you Narrate Your Work. I have made a practice of doing that professionally for many years now. I have used several writing tools to keep my log. Everything from plain text editors like notepad to outline processors. Lately at work I have been using a small wiki similar to the software behind Wikipedia to keep my work log.

When I decided to write this book I had just discovered Michael Hartl’s book Ruby on Rails Tutorial (3rd Ed.). While reading the book I poked around Michael’s site and discovered that he was making his publishing software, Softcover, available free for other authors to use to write their books. And, to make a good deal better, he was offering to provide a bookstore framework with which to sell your product at a deal that is unheard of in the publishing business.

That was when I decided that I would write my book using the Softcover software. I would Narrate My Work by documenting my experience as I learned all of the details of the new version of Grails.

I did a quick estimation of how much work was involved. I looked at the tutorial books that I had read lately. They were all about twelve chapters long. I, naively, estimated that I could write a chapter a week. So, I estimated I could write the book in three months.

I have subsequently determined that there are a lot of factors that I didn’t take into account. It has taken me about a month to get everything set up and write the first chapter. I also neglected to include the time for learning how to do the things that I was writing about. My revised estimate is that it will take me about six months to write. That may still be optimistic but if I take much longer than that, I may face stiff competition from others who have been writing their own Grails tutorials.

I have learned a lot this last month. I have gained a lot of confidence in my ability both as a programmer and a writer. I am enjoying myself and learning a lot of interesting new things. Even if the book never sells a single copy, it will have been worth the effort.

News (and a Few Comments)

I haven’t been keeping up my blog lately. Lots of other things have been happening. I thought I’d take a moment to update everyone on a few of them.

I started off the new year with a plan. I had been camping out on Pam’s MacBook Pro for over a year and I decided that it was time that I got my own machine again. I looked at the bank account and like the responsible adult that I am (no snickers from the peanut gallery), I decided that there wasn’t an Apple computer in my near future.

I have my iPhone and my iPad. I have the use of Pam’s Macbook Pro if I really need a Mac. But for my everyday work horse I needed something less expensive.

Around that time the Raspberry Pi 3 was announced. I was impressed. Here was a computer with the horsepower of a high end cell phone. I mean that as a compliment. High end cell phones are more powerful in many ways than a lot of low end desktops.

Then, Pi day came (3/14/16, get it? Pi rounds to 3.1416.) and Western Digital, the disk drive manufacturer came out with a special product. It was a 314 GB hard drive for the Raspberry Pi that they were selling for $31.41. When I looked into it I discovered that they had a 1 TB model for around $80 and it came with cables, a power adapter, and a case.

Needless to say, I bought the Raspberry Pi 3, a new monitor for about $100, and the WD 1 TB Pi Drive. The Raspberry Pi and monitor came in rather quickly. WD backordered the disk drive and I ended up waiting a month for it. But for about three hundred dollars, I had a new computer.

When it finally came in, I installed the multi-boot software that they suggested for it and chose Fedora 23 ARM for the distribution that I wanted to run. To make a long story short, for technical reasons that I won’t go into right now, the Pi was not up to being used as a developer’s computer. It is fine for a hobby computer or for a student that is just learning to program. It is great to build Internet of Things projects around. It just doesn’t have the guts to be a developer’s main computer.

I was depressed. I thought I had discovered a cheap way to get my own computer up and running. I moped around for a few days and then I started looking around to see what I could find to solve my problem. I found a local store that had refurbished computers but they weren’t exactly what I needed. Besides, I didn’t have the money to buy what they had in stock.

Then, in a flash of inspiration I remembered that I had a $100 Amazon gift card that I  had forgotten about. I started shopping on Amazon and soon found a refurbished Dell with a 3.0GHz Core 2 Duo processor, a 500 GB hard drive, and 8 GB of RAM. It wasn’t perfect but it was adequate for a developer’s machine.

I had to put $40 with the gift card to get it but a week later it arrived. It came with Windows 7 Professional. I am not a Windows fan. I have worked with Windows every day at work for the past twenty years or so, so it isn’t that I don’t know how to use it. I just don’t like it. But that’s a topic for another blog post.

I do know that Windows is useful on occasions so I went ahead and installed it. Then, I installed Fedora 23 x86_64 on it. I was impressed. The Fedora install program did a wonderful job of shrinking my Windows partition and creating the Linux partitions. Fedora booted up and has run like a dream ever since. It is not a Mac but it is a good solid developers machine. I have been very happy with it.

I’ll post more on what I am developing with it in another post. This post has gotten longer than I intended and I need to get to bed. I will hint that not only am I developing software with it but I am also writing a book on programming with it.

Exciting New Machine Learning Algorithm

The University of New York, the University of Toronto and MIT have made a breakthrough in machine learning. They’ve developed a technique they have termed Bayesian Program Learning (BPL) which uses an inductive approach to recognizing characters. (www.gizmag.com/artificial-intelligence-algorithm-learning/41448/) The researchers think the technique has potential applications to many other fields such as voice recognition, image recognition, and natural language processing.

On Writing, Programming, and Composing

I used to be daunted by a blank page. Now I am beckoned. It is an invitation to pour out whatever I am thinking about. I grew up in a time when you either laboriously wrote out your thoughts in long hand with pen and paper or you typed them with a typewriter. In either case erasing was complicated to the extent that it wasn’t really a good option. I think many writers just marked through their mistakes and kept writing.

I remember sitting in the spare bedroom of the trailer in Carbondale surrounded by a bunch of wadded up sheets of yellow paper containing discarded starts of the screen play I was attempting to write. I had no concept of how to write a draft. I was a perfectionist. If it wasn’t exactly what I meant to say, I ripped the page out of the typewriter, wadded it up, and loaded a clean page.

Even when I finally got a computer, I didn’t know how to write with it. I spent hours typing a few words and deleting them and then typing a few more. I had similar problems with programs. I have started many programs that never got much further than a skeleton and a few simple primitives. The important thing in both cases was that I didn’t quit trying.

For a while, I kept just starting over again doing the same thing each time. Then, I started varying my approach. I had some successes with programming at work. I eventually found The Artist’s Way and learned how to bootstrap my writing by sitting down every day at the same time and writing a minimum of 750 words. I eventually became confident enough in myself that I was able to write 50,000 words in a month.

I have learned that I must keep raising the bar, demanding more of myself. I recently increased my daily minimum to 1000 words. I decided that I would spend at least part of my words writing something that was more focused than a journal entry. Some days I find that I still spend the whole entry rambling. Others, I actually dive into a topical post as soon as I start writing. I feel the quality of my writing improve with practice. I notice my mindset while writing changing. It has become an exercise in organizing my thoughts instead of struggling with the mechanics of writing.

I have struggled off and on with integrating what I know to be good grammar with the conversational voice that often ignores such faux pas as dangling participles. I have also have had problems with sounding pedantic when I write. I am still struggling but I seem to be doing better with less struggle lately.

On the programming front, I have had similar experiences. I have learned that good tools are very important to being productive. They can help you be more productive so that you have more time to think about the code you are writing. This means that you don’t have to take the first thing that works as the final product. I am feeling the urge to rewrite more often. Too often in the commercial world the people that are paying for the software don’t appreciate the value of iterating a couple of times to improve the design of a piece of software.

I am to a point now that I am facing a common challenge in all of my endeavors. To finish. I suppose there is a corollary that has just occurred to me. Each time you iterate over a piece you should strive to finish that iteration. Each iteration should have as its primary goal to improve over the previous iteration. If you make the practice of finishing each iteration, it doesn’t matter if you have an iteration that is a regression. You can fall back to the last iteration and try again.

This is true of writing, programming, and my other artistic endeavor that I haven’t even discussed yet, composing music. In fact, it is even more applicable to composing music. So much so that there is a special name for it. It is called improvisation. There is improvisation in writing and programming but it is not as exposed to public scrutiny as musical improvisation is. It occurs to me that essay writing is literary improvisation though. And live coding is programming improvisation. So the paradigm does translate across all three fields.

A good essay would draw some conclusions at this point. I’m not claiming this is a good essay. It is certainly not a bad start though. So I’ll leave it at that.

So, Velikovsky May Have Been Right After All

Some scientists at Caltech think there might be nine planets (ten if you count poor Pluto). (www.gizmag.com/solar-system-nine-planets-caltech/41423/) Velikovsky spent most of his adult life insisting that there was a tenth planet and that the inhabitants of it had uplifted humankind from apes in order to mine gold for them back in ancient Babylon. Just watch Ancient Astronauts if you want to know more about that scenario.

UPDATE: As my friends Chuck Puckett and Shelley  Wilmoth pointed out on Facebook, I misremembered who it was that was hypothesizing the Ancient Aliens. It was Zecharia Sitchin that wrote about Nibiru, the twelfth planet. Immanuel Velikovsky wrote Worlds In Collision. That will teach me to do my research before I rip off a blog post.

Nielsen TV Ratings on Facebook?

I heard a news item on Marketplace last night (http://www.marketplace.org/2016/01/20/world/media-ratings-agency-pushes-new-ground) about Nielsen scanning Facebook and other social media for mention of TV shows. I immediately wondered how sophisticated their algorithms were and whether my mention of the Big Bang Theory in other contexts might add to the show’s already gargantuan ratings. Not that I’d mind.