429 karma · joined December 6, 2008
Thanks for the comments about atomicity vs. thread-safety. Absolutely on point. The article started out demonstrating what happened with concurrent Array mutation, but then I put in that += operation and didn't address it. Sorry for not making the distinction. Atomicity is absolutely a different issue than a thread-safe collection. I'm publishing something new tomorrow that addresses this point.
To bring things back to code, the point I was originally trying to make is that this code is not thread-safe.
array = []
threads = []
10.times do
threads << Thread.new do
100.times { array.push(rand) }
end
end
threads.each(&:join)
# 10 threads each inserted 100 values, result should be 1000
puts array.size
Specifically, too many Ruby programmers won't think twice about this operation not being thread-safe: array.push(item)
But there's no such guarantee. This is demonstrated nicely when this code example is run on an implementation with no global lock, try it on JRuby. There are some very specific caveats that MRI makes for concurrent IO. If you have one thread that's waiting on IO (ie. waiting for a response from the DB or a web request), MRI will allow another thread to run in parallel.Given that MRI ships with a GIL, the only core classes that are intentionally aware of multi-threading concerns are Mutex, ConditionVariable, and Queue.
Because I've already learned so much from this articles, I was eager to buy this when I saw the announcement in my inbox.
In my mind it wasn't scientific. If I could put a sales page for a product that doesn't exist and even one person attempts to give me money, imagine what I could do if I had a real product and could even show a sample, testimonials, etc.
The fake sales page, for me, was just to test that I wasn't off my rocker with the idea and to get a little motivation to push forward.
I have spent a bit of money on advertising (<$200) and saw almost no returns from it.
If I were targeting the book at sysadmins, for instance, I would have had no idea how to get in front of them or talk to them at their level.
re: pricing, nope. I think the discounting works because it's intermittent and gets people sharing. If I were to lower the price permanently I wouldn't expect sales to remain that high.
I've seen success from releasing the content for free with a paid version for ereaders, or doing it like I did and just offering the paid version.
The other perspective here is that this took a lifetime of work. I've been learning about the source material for the past several years. Obviously it wasn't just to write this book, it has many practical applications besides. I've 'practiced' teaching people and writing for years before this, all of that certainly contributed. This quote sums it up nicely: http://www.marketingquoteoftheday.com/pablo-picasso-on-prici....
I don't think it's fair to try to trim down a project like this to an hourly rate because it simply doesn't work like that. I could stop putting time and effort into the project right now and I would still see some money come in, arbitrarily increasing that hourly rate.
Just to drive home this point having a book with my name on it opens up new opportunities. If I were to write another book and spend the exact same amount of time putting it together my 'hourly rate' would probably increase because I now have more people listening to what I have to say and trusting that I will provide something of value. So investing time now into this project is a long-term investment that I may not make back on the sales of this book, if you know what I mean.
I've no idea if it's feasible to write like this for a living. There are lots of people (even in the tech education space) who make a living selling their own products, but typically not just books. Look at people like Marc-Andre Cournoyer or Peter Cooper who have written books but make their living through some combination of teaching mediums (video, webinar, books, training, etc). For many of them their first product was an ebook.
Just to clean things up, this book was written out of love. I felt like I couldn't not write this book once the inspiration came. That being said, there was also a financial motive. I wanted to be compensated for my work, but also wanted other people to place value on the material. Too often free material is considered worthless because there was no exchange made for it. "If you don't give anything you don't get anything", so to speak.
I don't know exact sales volume for the discounted days but as you can see those days brought in the most revenue, so it was certainly powerful.
The royalty from the edition on the Kindle store is like 1/4 of the royalty from selling it on the website. I published it to the Kindle store more as an experiment than anything else to see if I could reach a wider audience there. I still make more sales on the book website than with Amazon.
I had < 250 twitter followers when I started, < 50 blog subscribers. I had some reputation as a Ruby developer from open source work and participating in different things but I would say I had a very small network to start from.
I kept the 'fake' sales page as simple as possible. It was static HTML (written with slim-lang) and pushed to heroku (free hosting). I spent $100 on Adwords to get traffic. That bought ~300 visits which led to ~15 people clicking my 'Buy' button. The page wasn't all that different from what I have now, list the benefits of the product, what buyers can expect, etc.
I didn't pay for Twitter ads. In the beginning people retweeted my announcement. Later on readers of the book would share the link to their followers.
I wrote the book using Markdown and styled the PDF with CSS using PrinceXML. The kitabu framework (http://github.com/jstorimer/kitabu) held it all together and automated the translation to different formats.
In the beginning I had to dive into the different formats to get them all working as I wanted but now I've got that automated.
These two articles on pricing nicely highlight some reasoning behind low vs. high: http://blog.asmartbear.com/perfect-pricing.html and http://blog.asmartbear.com/higher-pricing.html.