I teach computer programming to beginners for a living, and I love the idea of a prose-like book aimed to be accessible to them. However, it's much, much harder than it sounds. You do an excellent job of addressing the programming concepts themselves in the text, but there's a lot more to it than that.
First, and foremost, I'm not sure who your target reader is. Judging by the jargon you use, I'm not sure he exists. Someone who has never programmed before is almost definitely not going to know how to "go back to [his] terminal [and] run the program with the command ruby closet.rb," or even how to "open up a new file called closet.rb in [his] text editor." If he's a Windows user, he probably don't even have Ruby installed. Further, a beginning programer probably does not understand why he cannot easily/should not use Microsoft Word as his text editor.
On the other hand, someone who knows how to do all of this probably understands the basics of programming. I'm not sure they'd want to read this chapter and wade through a few dozen paragraphs of prose to learn how to use the standard input, output, and string concatenation in Ruby. I doubt this is your target reader.
If you're aiming for the first programmer, you probably want a dedicated programming environment to start them off. It could be as simple as a "djinn package" that installs a basic text editor with Ruby syntactical highlights and the command line tools, but a big red "run this program" button on the editor is always nice. You can wean them off of the custom editor later.
Also, you'll almost definitely want to include the most basic an intro to debugging code. A book is non-interactive, and you have to prepare for the event that nobody can say, "Oh, 'Unterminated string meets end of file' means you forgot a double quote here on line 3," to the user. Perhaps have the narrator make a mistake, the genie correct him, and talk about why the computer wants strings to have double quotes. Or something.
It's a great start, but you just need to get past a few more pitfalls.
edit: Fixed a few grammar issues. Also, I'm Math/CS teacher and currently teach 8th through 12th graders.
Another issue that my programming students (university sophomores/juniors in a business school) often have trouble with is the concept of = being used for assignment rather than equality testing. It's as natural as breathing for programmers, but a weird shift from the type of math they're used to.
Definitely. In my experience, it gets a lot worse when you start re-assigning variables ("But x = 3, you can't say it equals 5"), and worse again when you have to start using == and = concurrently.
And then weak typing vs. strong typing vs. what the student expects, but at least that's easy to head off at the pass if you're anticpating it.
I'm not sure narrative is the best way to teach programming. Programming allows for non-linear exploration and dissemination. Teaching it should incorporate such techniques...which is why I'm a big fan of how Jeremy did his CoffeeScript documentation.
Trying to teach programming through narrative storytelling seems counterproductive.
You are exposing your Wordpress config in plain text, including DB password and various salts. Please make sure to change your DB password and the salts before you go back online.
First, and foremost, I'm not sure who your target reader is. Judging by the jargon you use, I'm not sure he exists. Someone who has never programmed before is almost definitely not going to know how to "go back to [his] terminal [and] run the program with the command ruby closet.rb," or even how to "open up a new file called closet.rb in [his] text editor." If he's a Windows user, he probably don't even have Ruby installed. Further, a beginning programer probably does not understand why he cannot easily/should not use Microsoft Word as his text editor.
On the other hand, someone who knows how to do all of this probably understands the basics of programming. I'm not sure they'd want to read this chapter and wade through a few dozen paragraphs of prose to learn how to use the standard input, output, and string concatenation in Ruby. I doubt this is your target reader.
If you're aiming for the first programmer, you probably want a dedicated programming environment to start them off. It could be as simple as a "djinn package" that installs a basic text editor with Ruby syntactical highlights and the command line tools, but a big red "run this program" button on the editor is always nice. You can wean them off of the custom editor later.
Also, you'll almost definitely want to include the most basic an intro to debugging code. A book is non-interactive, and you have to prepare for the event that nobody can say, "Oh, 'Unterminated string meets end of file' means you forgot a double quote here on line 3," to the user. Perhaps have the narrator make a mistake, the genie correct him, and talk about why the computer wants strings to have double quotes. Or something.
It's a great start, but you just need to get past a few more pitfalls.
edit: Fixed a few grammar issues. Also, I'm Math/CS teacher and currently teach 8th through 12th graders.