David Czarnecki

Jan 01

Scaling Back

I played 28 video games in 2010.

I played 27 video games in 2011.

I’m scaling back in 2012 and limiting myself to playing 10 video games. These are the video games I’ll be playing in 2012.

Syndicate (XBOX)
Mass Effect 3 (XBOX)
Prototype 2 (XBOX)
Borderlands 2 (XBOX)
Assassin’s Creed III (XBOX)
BioShock Infinite (XBOX)
Grand Theft Auto V (XBOX)
The Last Guardian (PS3)
The Last of Us (PS3)
South Park: The Game (XBOX)

If by chance any of the games here get pushed into 2013, I may substitute in a game that didn’t make this list. I may also purchase, but not play, certain games to support the developers and new video game IP.

I also considered limiting myself to playing 5 video games in 2012. However, I know I couldn’t hold myself to that limit.

Dec 27

2011 Game of the Year

My 2011 Game of the Year goes to Dead Space 2. It was a tough choice to come up with a single video game that stood out among the many video games I played this year*. However, Dead Space 2 was a thrill ride that never let up from beginning to end.

Whenever I talked with people about Dead Space 2, I was usually met with, “I still haven’t finished the first Dead Space. It was too scary.” For me, that was one of the highlights of both Dead Space games, its immersive environment, both art and audio. I played both Dead Space games on my family room surround sound system, after dark and with all the lights off. Certainly on more than one occasion I found myself jumping back in my chair as I got caught off-guard by a necromorph breaking through a vent, hell-bent on tearing me limb from limb.

I played through Dead Space 2 a total of 6 times, beating it on Casual, Normal, Survivalist, Zealot and Hard Core difficulties. Hard Core mode presents a true test of skill to even the most seasoned gamer as the enemies are at their most difficult, ammo and supplies are scarce, there are no checkpoints and you only get 3 saves in total (3.5 saves if you count the disc swap as a “save”). Before the final battle on Hard Core mode, I paused the game and psyched myself up for a good 20 minutes. After I finished Hard Core mode the first time and I got the Hand Cannon weapon, I went back and played the game again on Hard Core mode, completing a speed run in roughly 7.5 hours. One shot kills with the Hand Cannon are a lot of fun and who doesn’t love a weapon that goes “bang bang” and “pew pew”.

The Dead Space games aren’t for everyone. If you don’t like shooters or survival horror, they’re probably not for you. But if you do decide to give either game a chance, you’re guaranteed a good time, or at the very least a good scare!

Dead Space 2 achievements

* Here are all the video games I played in 2011:

Dec 06

rake stats

rake stats is one of those less-oft used tasks when developing Rails applications, but it does provide a good breakdown of some code statistics. You’ll get total lines, lines of code, # of classes, # of methods, methods per class, lines of code per method and some ratios.

Here’s a breakdown of one project at work:

+———————————+———-+———-+————-+————-+——-+———-+
| Name                 | Lines |   LOC | Classes | Methods | M/C | LOC/M |
+———————————+———-+———-+————-+————-+——-+———-+
| Controllers          |  2414 |  1837 |      31 |     182 |   5 |     8 |
| Helpers              |   319 |   248 |       0 |      38 |   0 |     4 |
| Models               |  1576 |  1149 |      36 |     142 |   3 |     6 |
| Libraries            |  1275 |   832 |       5 |     109 |  21 |     5 |
| Integration tests    |   284 |   181 |       2 |       8 |   4 |    20 |
| Functional tests     |  4406 |  3364 |      27 |     268 |   9 |    10 |
| Unit tests           |  2287 |  1817 |      35 |     214 |   6 |     6 |
+———————————+———-+———-+————-+————-+——-+———-+
| Total                | 12561 |  9428 |     136 |     961 |   7 |     7 |
+———————————+———-+———-+————-+————-+——-+———-+
  Code LOC: 4066     Test LOC: 5362     Code to Test Ratio: 1:1.3

It is also aware of specs and higher-level testing tools like Cucumber. Here is the breakdown of another project:

+———————————+———-+———-+————-+————-+——-+———-+
| Name                 | Lines |   LOC | Classes | Methods | M/C | LOC/M |
+———————————+———-+———-+————-+————-+——-+———-+
| Controllers          |   329 |   267 |      13 |      39 |   3 |     4 |
| Helpers              |   325 |   238 |       1 |      34 |  34 |     5 |
| Models               |  1275 |   904 |      20 |     114 |   5 |     5 |
| Libraries            |    85 |    68 |       3 |       8 |   2 |     6 |
| Model specs          |  1037 |   839 |       2 |       4 |   2 |   207 |
| View specs           |   406 |   337 |       0 |       1 |   0 |   335 |
| Controller specs     |   674 |   537 |       0 |       1 |   0 |   535 |
| Helper specs         |   103 |    84 |       0 |       0 |   0 |     0 |
| Mailer specs         |    65 |    52 |       0 |       1 |   0 |    50 |
| Cucumber features    |   338 |   192 |       0 |       3 |   0 |    62 |
+———————————+———-+———-+————-+————-+——-+———-+
| Total                |  4637 |  3518 |      39 |     205 |   5 |    15 |
+———————————+———-+———-+————-+————-+——-+———-+
  Code LOC: 1477     Test LOC: 2041     Code to Test Ratio: 1:1.4

A few times a year, I run rake stats for all our projects at work to get an idea of how our applications change over time at this level. I ran rake stats back in July and today I ran rake stats again. My summary was as follows: “Where we added code, we added tests, so our test coverage remained the same or improved. Good job.”

Dec 02

I Am Code and Coffee and So Can You

I’ve started doing code and coffee sessions around my area, the “Capital District” of NY (Albany, Troy, and Saratoga Springs). They’re informal gatherings where technology-minded folks can get together to share code or ideas. So, some initial thoughts after having done a number of sessions:

Are you holding code and coffee sessions in your area? I’d love to hear more about what is working (or not) for other folks.

Dec 01

Ruby and Rails Version Application Progression

I did a quick assessment of our applications at work to look at the Ruby and Rails versions that we have running in production.

Number of applications running under Ruby … :

1.8.7: 1

1.9.2: 0

1.9.3: 13

All versions of Ruby are MRI.

Number of applications running under Rails … :

2.x: 1

3.0.x: 10

3.1.x: 3

Overall I think that’s pretty good. Our applications serve millions of gamers every day and so we need to stay current with our technology stack.

Nov 30

Internal Consistency

I recently started using Sinatra again for a few projects and found that my approach to developing these projects had changed significantly in such a short period of time (a couple of days). Looking at the difference between 2 significant projects, I wanted to enumerate what I found to be my “best practices”.

I feel compelled now to go back and update past Sinatra projects to have internal consistency and that’s a good thing.

Do you have any Sinatra “best practices”?

Sep 12

Solid

What makes an API or a library “solid”?

All of the above? Some of the above? None of the above?

Sep 07

Unbalanced

It’s 2011.

Scenario:

Problems:

Solutions:

It’s 2011. Stop being stupid about that fact.

Sep 03

Rhetorical Question

If someone from thoughtbot asks if you’re willing to write a test (or tests) for a patch, that is a rhetorical question. Case and point, a pull request I opened on their airbrake project: https://github.com/thoughtbot/airbrake/pull/1 - Use the Capistrano logger for great justice.

It started off as an innocuous request to change the use of puts in a Capistrano task to use the Capistrano logger. I’m sure after the question “Was I willing to write tests for it?” was posed, I could’ve said “No thanks.” or “Does it really warrant a test?”

I chose the impossible. I chose … Rapture.

It’s not really impossible to test Capistrano tasks, but it’s also not as straightforward as I would have hoped. There are some projects like capistrano-spec that may have helped had airbrake been using RSpec, but no matter. In the end, the 2 line change resulted in a slight re-organization of the Capistrano task and a bunch of test code to assert that the Capistrano logger was doing its job.

Now that’s how you spend a few hours on a Saturday morning!

Sep 01

first.rb

The first Ruby I ever wrote was in December 2005. It was akismet.rb, a small class for interacting with the Akismet service. My post to the spam-stopper mailing list can be found here. I personally never did anything with the class and I didn’t touch Ruby again for another 3 years until I started working at Agora Games. However, if you google for akismet.rb, you’ll see it took on a life of its own by providing a seed for other Ruby libraries and Rails plugins.

One of those libraries is rakismet, written by Josh French, which provides Akismet integration for Rails. By whatever happenstance, I started following Josh on Twitter at some point. We also met up at RailsConf 2011. However, it wasn’t until today that I found rakismet and caught up with the first Ruby I had ever written, in a much different form then when it was originally written nearly 6 years ago. I can’t take any credit for its current form and function.

Open source is interesting. You write a bit of code, release it and it takes on a life of its own. “Life moves pretty fast. If you don’t stop and look around once in a while, you could miss it.”

UPDATE: 2011-09-02

I found what I believe to be the original Akismet.rb. Here’s the gist.

Let us count the ways of the n00b:

:)