Archive for the ‘Uncategorized’ Category

Gameplay of Sonic for 360

January 3, 2007

Let the hilarity ensue… This is absolutely insane!
Watch this clip.

Coding Glee

December 12, 2006

I just thought I would post how awesome it is to be a coder! Yeah I’m a big dork… I have been cooking up ideas left and right and it feels great! We currently have a generic way of creating the documentation necessary for promoting code, etc… Well, I am lazy of course, so I am designing a program that will generate the bulk of this information for you. With this application, you’ll never have to open Word again (well.. close to never).

Reading Good Code Rant

December 7, 2006

Over at my old job, I had an epiphany and I was wanting to share my thoughts on it to the readers.

Reading good code is like reading a good book.

As stated in the title, it’s called READING code not deciphering code. When you read a book, there’s nothing more annoying than having to jump back and forth between chapters to remember who killed who or who did what. A good book should have a smooth transition between chapters. The flow of it should be fairly straight forward, otherwise it becomes a nuisance to read and gets left on the bookshelf. Code should not be any different.

When I worked support, I hated jumping back and forth in code to figure what the “temp” variable was used for or the why the function “LoadData” was 400 lines long. Come on people! Code should flow.

If you need a temporary variable, then give it the value it actually holds, but try to keep the word “temp” out of the picture. This naming convention will keep you from writing any and everything to a single “temp” variable and will save your support people from pulling their hair out. Any variable declared in a function is considered “temporary” by definition.

Also, don’t forget about your counters and/or sentinels. Let’s say you’re looping through an array of employee names. Well, instead of saying the following:


for( int i = 0; i &lessthan len(employeeNames); ++i )
Print(employeeNames[i]);

Try saying this:

for( int employee = 0; employee &lessthan len(employeeNames); ++i )
Print(employeeNames[employee]);

Since you’re essentially going through a different employee to grab their name, why not state such? In .NET, there is the “foreach” construct that forces you to use a more object oriented approach to looping through collections.

Now for functions… Name your functions according to exactly what they do. If your function name is too long, chances are you need to break up your function into other smaller functions. If it’s too short, you’re probably not giving it a proper name. A function should only perform one operation. If you’re one of those types of people that like to write “bulk” functions, then at least make it readable. Keep the abstraction simple.

function void Cleanup()
{
ClearEmployeeNames();
ClearManagerNames();
//etc...
}

So, in closing, I hope I have saved at least one support person the headache that they already endure on a day to day basis. Their job is tough already, do not make it any harder on them by making your code impossible to read. Enjoy!

XBox 360

December 4, 2006

I have finally given up on PC gaming and have moved to console gaming.  I went ahead and bit the bullet to buy myself something nice – an XBox 360.  I picked up Gears of War and I would like to get a racing game, too… but for now… Gears of War will have to do.

I have to say that the 360 is an amazing machine with a HUGE power adapter.  It was well worth the money.  I decided against the PS3 for various reasons and also the Wii.  Besides, I wanted to get something that would last awhile and I figured that MS isn’t going anywhere for a long time. So, forgive me PC gaming community… alas, I will be enjoying my gaming experience without having to worry about downloading the latest patch and making sure my drivers are  up to date.

Source Control, VS 2005, and ASP.NET

December 1, 2006

For those who have not been able to figure out why they can’t get their solutions into Source Safe with a neat folder structure.. here’s your solution. Of course, everything works KINDA ok whenever you use all defaults for where your website is located at, but if you’re any kind of developer and you have source control, you will want to create the same directory structure as your source control delegates (for web apps anyways).

By default 2003 creates the correct folder heiarchy and defaults your web application location to your local machine’s inetpub directory (even though this is bad – *spank*). VS 2005, on the other hand, puts your solution two folders above your projects and puts those files all over your Documents and Settings/LocalUserName/ blah blah.

Well, let’s say you create your web application in C:\Dev\Websites. Open it in VS 2005 and you’ll notice there’s no solution.. hmmmm… Add another project and it instantly appears. Rather than blogging all the stuff that VS 2005 sets up that doesn’t play nice with SS… I’ll just post a solution.

Create your folder heiarchy as follows:

Solution Folder -> (.sln) -> Web Project Folder -> (.aspx, .cs, etc…)

If you have multiple projects, then create a new folder (VS 2005 should create one by default once you save your solution correctly) for your project and put it in the same branch as your Web Project Folder. Ridiculous? Wait until you try to create a .msi file. Of course, this process is great facilitated with the Web Deployment Projects download from MS…. but mum’s the word.

Test

November 28, 2006

I just thought I would test out my new blog site. Yeah.. I’m lazy… but enjoy the posts. I’ll try to update it as often as possible with lots of new coding stuff I find as I go along at the new job. Enjoy!