Saturday, August 25, 2012

Duck Typing and the Timeliness of Type Checking

Listen. You like duck typing (implicit typing). I get it. I kind of like it, too. At least, it's growing on me.

That doesn't mean you have to give up a compiler. Imagine this scenario. You have a language. That language allows you to define a class thusly:

class Runner
  method RunSynchronously(z)
    z.Start()
    return z.Stop();
  end
end


Then you have some other classes, of which instances are passed into the method defined above:


class A # null object pattern
  method Start()
  end

  method Stop()
    return true
  end
end

class B # normal implementation
  method Start()
    workReceipt = ThreadPool.StartWorking(someBehavior)
  end

  method Stop()
    return ThreadPool.WaitForComplete(workReceipt)
  end
end

class C # asynchronous no matter what implementation
  method Start()
    ThreadPool.StartWorking(someBehavior)
  end

  method Stop()
    return false;
  end
end
How could that be compiled? How could it be statically type checked? Nobody defined an abstraction, right? Wrong.

 An abstraction was defined implicitly and those objects do conform to it.  The Runner class expects its z parameter for RunSynchronously to have a Start method and a Stop method.  That is a de facto interface.  There is no reason it cannot be enforced by a compiler.  There are lots of reasons why it should.

Maybe when I get some more free time, I'll look into it.

Friday, August 24, 2012

Why Mystical Science Fiction? Part 2: I Like a Challenge

In Part 1 of this little trilogy, I outlined the three reasons why I chose mystical science fiction as the genre for the Sleight of Mind series instead of "just" science fiction and I expanded on the first reason.  In this segment, I'll explore reason #2: because interspersing mysticism and technology is more challenging for me.

Ordinary science fiction is about stuff that is easier for me to grasp and understand: technology, mechanisms, rules, and learning.

Of course, there are interesting decisions.  Do you extrapolate from modern scientific understanding or do you stipulate a paradigm shift?  Do you roll time forward, backward, or weave your story into history?  Are humans more advanced or less?  How has society changed as a result of these changes?  How much has society shaped technology?

Those are the same basic questions you have to answer in any book, story, or series.  They're good questions to answer and can produce a fun read.  I like to write at least as much as I like to read, though, so I want the story to be fun for me to create.

For me, a world in which things cannot always be codified scientifically is one that is far more challenging to imagine than one in which our species or another has just churned out another five thousand generations worth of improvements on various gizmos.

That challenge makes the story more fun to write.  How do I balance these two different kinds of forces?  That's hard.  How do I reconcile them?  That's even harder.

Like I said, I am not betting the farm on people buying this book.  I'm mostly writing it for me and I'm hoping other people enjoy it.   For that reason, I embrace the big challenge of this genre choice along with some other challenges that I have typically skirted; namely developing personal relationships between characters and exploring character's feelings.

Stay tuned, tomorrow is the first day you will be able to get Sleight of Mind for free on your kindle and also the day I explain why I think this subject is more challenging for you, the reader.

Thursday, August 23, 2012

Why Mystical Science Fiction? Part 1: It's a Big Universe

Why is Sleight of Mind a "mystical" science fiction series?  I could have done it as regular science fiction and probably tapped in to a wider audience.

There are three reasons:
  1. It's a big universe.
  2. I like a challenge.
  3. I like to challenge others.
In this segment, I'll start by exploring the first reason.  Tomorrow, the second and, on Saturday, I'll deal with the last one.

I like technology.  I also like the idea that the universe works in ways we haven't even begun to perceive, let alone measure and understand.

Science fiction is often about a distant time in which one of the key species has garnered an understanding of the universe that allows them to do things we cannot do today.  Not always, but pretty frequently.  What if the advanced understanding ends up actually being that we cannot possibly understand the universe? What if there's another way of doing things that our fairly scientific minds just tune out?

It's not like I think nobody has ever had an idea like this before.  It's more probable that my non-fiction writings are original than these works of fiction and, even then, the chances that someone, somewhere hasn't already at least toyed with my ideas are pretty slim.  Ideas are only original a maximum of one times and the probability that said time was inside any given person's head is almost nil.

It's just that I think the idea of technology and mystical forces interacting is interesting for me to explore.  If it's interesting for me to explore as an author, it might be interesting for you to explore as a reader too.  So, even though the oddness of the story might be off-putting for a lot of readers at first, I'm hoping that it will ultimately develop into more of an appeal than a detractor.

Since I make a good living as a software developer, I can afford to wait and find out.

Stay tuned.  In part 2, I'll tell you how I think this is a more challenging subject for me than ordinary science fiction.

Tuesday, August 21, 2012

Why Is "Crashing the Party" Only 53 Pages Long?

There are a lot of e-books out there.  A lot.  There are Kindle books that are six-hundred pages long that only cost 99 cents.  So why do I think I can make it with a book one tenth as long for the same price?

I'd like to think that part of it is because I can write.  Maybe I'm full of shit on that.  If so, the market will tell me.  There's another, deeper meaning to this trial for me.

Anyone who knows me - who really knows me - knows that Lean Thinking is really important to me.  Some have even called it my religion.  The core principal in lean thinking, as far as I interpret it, is value.  Understanding what value is to your customer is absolutely critical to the success of a product.

A tool we use to zero in on value is market feedback and that's the first place that the structure of Sleight of Mind series and lean thinking tie together: by releasing part of the story and getting feedback, I'll have a chance to improve the product before I release subsequent portions.

Shaping the product this way also ties in with the flow and pull principles as well.  I'm sure a particular friend will tell me that, if I think about it long enough, I'll be able to stretch the value stream and perfection principles over this idea as well.

That doesn't mean I'm a total douche bag - although it doesn't mean I am not either.  I don't intend to let the market tell me how the story should go, who should live or die, who should win or lose, or which characters should change their nature.  I'm already pretty confident in my abilities to make those decisions on my own.

What I do want to learn from the market is the weight it places on the following things:

  • Descriptions of people
  • Descriptions of scenery
  • Unveiling of motivations
  • Connecting the plot dots for you
  • Making you connect the dots on your own
  • Etc.
This is an experiment.  Maybe it will work.  Maybe it won't.  It only costs my time for me to find out at this point.

Sunday, August 19, 2012

Sleight of Mind #01: Crashing the Party


I've released my first work of fiction as a Kindle e-book.

Sleight of Mind is a series of short stories staring Daniel Vaughn.  In the first episode, he accompanies a group of soldiers on a mission to kill an enemy of the United States.  His role is to interpret cuneiform writings in which instructions on how to proceed are encoded.

As time passes, it becomes apparent that this is more than just a covert mission to kill a terrorist and the group realizes they are up against something they don't really understand.


The current plan is for it to be free every Saturday for the next five weeks and 0.99 USD the rest of the time.  It is also available for free to Amazon Prime users by way of the Kindle lending library.