I’m Still Here!

I don’t know where the last two weeks went… well actually, I do, it just doesn’t feel like it’s been that long. I guess when life gets really busy, it is easy to lose track of the time. I wish I could say I was busy with programming; learning it, using it, thinking about it, anything, but that’s not the case. I did run most of a marathon (I wasn’t prepared for the distance and the heat). I also moved. Oh, and I made one and a half games using Game Maker Studio.

Neither of the games are great. I’m not sure it’s even fair to call them good, but they did help me explore Game Maker. The first one I started is something like a twin stick shooter, in the style of SmashTV, except no shooting. It’s still very early and very rough, but I’d like to keep refining the concept, because I feel like I have a good idea buried in there. The other one I’m calling “Catch You Some” (read it in Scooter’s voice, from Borderlands). Blocks fall from the top of the screen and you move a basket back and forth to catch them and score points. If the blocks hit the bottom, they stop. If a block lands on a stopped block, the game is over. It has a splash screen (technically two splash screens because Game Maker loads one too), a start screen, the game and, finally, an end screen.

“Catch You Some” is almost finished, i need to work on the end screen and work out a couple of kinks, but what I like most about it is, I spent about thirty minutes creating it. There is something to be said about using tools that let you focus your productive time wisely. Once I fix the last couple of things and figure out the best way to package it, I’ll post a link to it and do some kind of post-mortem on it. Game Maker is a neat tool, and it’s free. I highly recommend it, even if all you want to use it for is fast prototyping.

I also have been really trying to start some AngularJS development. I get the ideas, conceptually, but putting them into practice is stumping me a little. It can be disheartening to spend all my time trying to think through it and getting nowhere. Then, the next time I have a chance to program, I am more likely to choose another task. It’s a stupid cycle that I need to break out of. I feel like I am close though, so maybe that breakthrough is just one or two more brainstorming sessions away. I’ll keep plugging away!

Advertisements

Not Programming

I am feeling pretty energized by Code Camp, and I have lots of new ideas bouncing off the inside of my skull, but for some reason, I’m having a hard time taking any action. I haven’t coded at all, but I have done a lot of staring at the splash screen for WebStorm. Also, staring at the covers of several programming books. Instead of reading any of them, I picked up Neuromancer for the nth time.

I am a pretty avid reader. I started reading at a young age and never stopped. It is very easy for me to get engrossed in the written word. Carried off to whatever land has been created. I’m not picky either. I can recognize good writing and bad writing and abysmal writing, but most of the time I don’t really care. I am quality tolerant. This holds for most things I consume: food, coffee, scotch (but not beer), music, movies and books. It’s a rare book or movie that I actually have to walk away from.

In any case, Neuromancer is good reading. Especially for being the progenitor of an entire genre of creative fiction. Gibson hit on a perfect blend of setting, plot and character development. The mood is fantastic. The pacing is just right. It feels technical without being clunky. Most importantly, it feels of its time and yet also timeless. Reading it now, it is easy to see the influence it has had. It is a lot like listening to a Beatles record and recognizing how much modern music lifts ideas almost directly from their songs.

It has made a good distraction. I at least feel like I’m doing something, and I think it is giving my brain room to stretch out and digest and hopefully retain and integrate some of the knowledge that was being liberally blasted around at Code Camp. It’s tough though, because my most productive days are Saturday through Monday and I didn’t write a single line of code in that whole period. Worse, it seems to be a developing pattern. I should probably start setting aside specific blocs of time for coding instead of just coding “when I feel like it.”

In the next few days, I want to “dust off” my Angular and really try and wrap my brain around the guts. Directives especially. By this time next week, I want to have written a healthy chunk of code that does something. I’d really like to start working with APIs. I keep putting it off, but I think it is time to dive in. So, wish me luck and keep coding (and learning and writing about all of it)!

TDD Nitty Gritty

Last week I had a very nice exchange with two other developers (Valkyrea and Mark, thanks for the discussion!) about learning to code. We talked about the paths we’re taking and the progress we’ve made. I am fascinated by the breadth of available knowledge in this field and the multitude of ways that knowledge can be acquired. I think it’s fair to say that the three of us in that conversation are at roughly the same depth, but we have chosen to focus on different aspects. Hopefully, we continue meeting and talking about those things. It is incredibly important to share and support each other, and I think we would derive huge benefits from those kind of discussions.

One of the topics that came up was Test-Driven Development; what it is and how to get started with it. I initially sat down to start from scratch and talk about TDD as a philosophy and how to get it set up. That made me a little nervous, mostly because I am still very much a beginner, just scratching the surface of TDD. I also realized that I had covered most of what I know about TDD in my first article on the topic. Rereading the article, I could have inserted more detail, but it is still a pretty simple process. So here is some of that detail that was missing.

(I am running a Windows 7 desktop, a Windows 8.1 laptop, and using JetBrains’ WebStorm IDE, some steps and details may vary depending on how closely your environment matches mine.) First step is downloading and installing nodeJS. Pick your poison, I used the windows 64bit installer. The installer claims it will set up your PATH, and on my desktop, that seemed to work, on the laptop, it did not. So the next step was to set up PATH for npm. I did that right inside Webstorm’s terminal, although you cna use whatever CLI you feel comfortable with. The command I used was:

 set PATH=%PATH%;C:\Program Files\nodejs

Again, use whatever address you need to make it work. Once node is installed and pathed and ready to go, you can use npm to install mocha. It is also dead simple:

npm install -g mocha

That’s a global install so you can use it in any project from there on. At that point it should (might?) work. It was long enough ago that I forget if I had to do the next steps on the desktop, however, I did have one more step for WebStorm on the laptop. I opened up the settings (ctrl-alt-s), navigated down into Languages & Frameworks -> Node.js and NPM and set the path to the node interpreter:

C:\Program Files\nodejs\node.exe

and then double-clicked the mocha package and selected install. I don’t know why that was necessary, it is possible I missed a command or step that would have done that automatically. I do know that once that step was complete, I could drop into the terminal and type “mocha” and it ran.

 0 passing (4ms)

Perfect!

I am still running without a test runner, and in a few other … lightweight ways, for lack of a better term. This isn’t really from any desire to keep it light or an informed decision or anything, I just haven’t spent the time figuring out how to get a runner working. I would like to, and I should get on that soon. I am hoping it integrates as well in WebStorm as I saw in Visual Studio. Grain of salt time, my friend Chris is using the Ultimate Version, and so it could be that some of the features I saw are high-level. Things like live-updating test status (which sits in the gutter) as he typed and running tests on save, etc. I won’t know until I get it running, but I will certainly share my findings when that happens!

I also got to spend a little time talking to my brother, a veteran programmer and informal TDD evangelist about my test writing and process and he gave me a lot of good advice to chew on. I will be rewriting the testing in my blackjack program to be more granular and more verbose. I have been trying to keep things “readable,” but I worry sometimes that I might be tempted to go overboard. It was nice to hear him tell me to make it even more readable.

Questions, comments, criticism and requests for clarification are always welcome. If I skipped over some vital steps or you followed everything and it still isn’t working, let me know. If you want more detail about some aspect of the process or insight into how my brain works, I’d be happy to oblige.

Keep coding, keep learning and keep writing about it! Sharing your stories helps all of us grow as programmers and as people!

An Overdue Step

I have been aware of GitHub Pages for quite a while. Probably almost as long as I have been using GitHub. For whatever reason, it hadn’t really occurred to me to use it to show off my work. Maybe because I didn’t really consider it finished enough. Or because I wanted to strip out the extraneous code and who has time for that?! Well, I made the time. Now you can see my almost, somewhat mostly completed backgammon game, bugs, legacy green form (thanks Head First JavaScript!) and all. Just head over to mushiwulf.github.io and give it a whirl! You can look at the guts by digging around my GitHub page, or, if you’re as time starved as I am, this is the spot right here.

A brief explanation of the controls: Reset Board starts the game by setting up the checkers and rolling the initial dice (one dark, one light, high die goes first). To move a checker, click on either die and the checker you want to move, in any order. There are some rudimentary alerts set up if you click the wrong things. The counters in the middle are the “jail” cells. The counters on the right are the “endgame” counters. First to 15 wins. To play from jail, pick a die and then click on one of your own checkers (it’s not intuitive and I would like to change that eventually).

I’m probably missing some details, ask me anything! Tell me if you run into any bugs (I know of at least one already). Thanks for giving it a look!

Branching Out

A quick recap of my progress so far. I started my journey at Codecademy and then quickly supplemented that with the Head First JavaScript book and lessons. Pretty soon I was flying solo, working on my own project, a backgammon game. For a long time (a long, long time… like 6 weeks?) after that, I mostly just plodded forward, skimming through books and looking up pieces of code and documentation online. Brute force programming. Andrea introduced me to freeCodeCamp which introduced me to Dash, and through several avenues at once I was made aware of Code School. And that’s pretty much where I am now.

Getting back into some kind of formalized learning via freeCodeCamp (which is mostly a very well put together aggregator) and Code School has jumped my understanding forward in leaps and bounds. I think through just slogging it out, some of the concepts and ideas of JavaScript and programming in general were becoming more and more apparent and ingrained. When I do the lessons at Code School, I feel ready. I feel like it makes sense and the knowledge is sticking. My biggest gains have been in understanding jQuery and Angular.

For me, they both make interacting with the DOM way easier and visually cleaner than vanilla JavaScript. I haven’t gotten as far with Angular, but from what I understand, it attempts to enforce an MVC architecture. I know I am at the edge of my understanding, so I have a hard time explaining the hows and whys, but I am starting to understand the flow of each of those technologies.

I am starting to get more specific advice and challenges from my programmer friends, so I will be narrowing my focus to cover the areas they think are most important. My motivation levels are pretty high right now, and I hope I can keep moving forward.

Along with Andrea (Part Timer), reading the blogs of Rails MamaTeacher Learns to Code, Tales of a Technophile, and Valkyrea Learns to Code has been inspirational to me. Thank you ladies!

Staying Power

I feel like I haven’t posted in too long. I guess it has been nearly a week! The holiday break spoiled me. Getting back into the grind has taken a toll on both my free time and my motivation to sit down and write, both code and posts… I did make some good progress over the weekend, and I wanted to ride that wave into finishing my backgammon project, but I stalled out once I was in total control of my two kids all day!

Even though I don’t get to (sometimes don’t want to) sit in front of the keyboard as much, I am still working out the logistics of the final steps of my program. The biggest chunk is working on a way to check the board for all valid moves and allow the player to end their turn if there are none left. Backgammon has some interesting ideas about when you can pass your turn and when you can’t that make is less than perfectly straightforward. I think my plan is to break it down into two distinct units. One will do the checking and the other will hold the rules. That way I can incrementally build a smarter and smarter validator, instead of trying to do it all in one shot.

My punchlist is around here somewhere, I wanted to update my progress on that, but I think it might be under one of my programming books, which itself has become a resting place for a baby bottle and a mostly empty and totally cold cup of coffee. Briefly, I figured out why my event handlers weren’t working (developer error) and wrote a few to handle clicks. It’s no very easy to use the dice to move the checkers around, although I need some UI/UX tweaks to make it more obvious what is going on.

One thing that has been a big boost to my motivation is reading the blogs of several other people in similar situations. Seeing what they are doing with their knowledge is really pretty inspiring. Thank you!

If you’re not following these blogs, you should:

Merry Christmas!

The Holidays have been fairly busy, and so I don’t have a lot of progress to report. I cleaned up the presentation some. Made a few strides with the mechanics of moving checkers. I have a little to do list that includes things like validating the input and adding mouse event handlers. I have some larger goals like incorporating unit testing and overhauling the “website” wrapper for my projects. But mostly I wanted to show you this:

xmasBackgammon

Merry Christmas everyone!