Sunday, May 8, 2011

Cop? What the hell did I do wrong?

This document explains a little introduction on the StyleCop tool to check on code conventions of our .Net projects.

Style convention can be tedious if done manually. For .Net code convention I prefer the one set by Mike Kruger from SharpDevelop team. But as I've said, it is so much for a manual task, especially if you're taking a project previously done by lots of people and with no standards.

Then came StyleCop. I mean I just use StyleCop because I'm on .Net. Java has CheckStyle, so for other platform/languages you might want to check Google or Wiki.

Introduction to StyleCop

Hmmm. I'm not really a type of person that gives lots of introduction so let's move on...

Installation and Configuration

First off, download StyleCop here. Install it and you're done!

Ok you're not. Well, let's move on. Before using StyleCop, we need to have an IDE. Yepey! We're getting to code. Of course, we have that right? I use SharpDevelop and if you don't use it, nevermind, installing StyleCop with VisualStudio automatically gets VS to have Run StyleCop when right clicking on projects. But that's another issue. I'm with SharpDevelop so we're moving to getting started with it. No VisualStudio, please!

Open SharpDevelop and to to Tools->Options and click on Tools. Click on Source Analysis and find your StyleCop installation directory. Now, right click on your project and Check with StyleCop. That's it, you're done. Really, you're done!









































But, if you really have to edit the settings. Settings are usually bunch of those configurations set by Microsoft for C# code convention. Oh, didn't I tell you from the time of writing StyleCop only supports C#? Now you know. No VB, who cares? Anyway, you can find your global settings on your StyleCop installation directory. Double click on the Settings.StyleCop (usually in C:\Program Files\Microsoft StyleCop 4.3.3.0) and edit it the way you want it. Have fun!

Tuesday, February 1, 2011

Early Optimization Syndrome

I've always wanted to blog about political stuff but never got much time on it. But lately, I kinda observe lots of happenings in our land. Btw, if you don't know I'm a Filipino. We had lots of bad happenings. From the past, we don't have good image from outside the Philippines. Corruption, crime you name it. Anyway, I just notice something about our president. He has this sickness I call "Early Optimization Syndrome".

I'm what they call one of the developers. So basically an IT guy. I know IT guys experienced this kind of stuff. We optimize early in our development. And later on, things get worse because of the complexity. I notice this happens in the management of our administration. They optimize early.

Problems and Solutions
I just want to enumerate some things I notice about their management where they are solving problems (if it is) with optimized solutions.

No Wang-wang Policy
I remember upon taking a nation address speech, he had this. A solution to a non-problem. Maybe he is weird, maybe he is Steve Jobs in disguise. A visionary or some kind. But come on, we know it's never a solution to a problem. There is not even a problem.

Changes to Money
For what? Faking it? Who's faking it? And how? That might be the good questions they should start thinking over. It's like giving a system to a customer and the customer complains because of bugs and all you would do is say, "Nah, nevermind we'll create another one for you." It's expensive process. Instead work on why it doesn't work.

Again, I don't see a problem to the money we previously had. Aside from the people in there to have their pictures taken like they were 30 years old or above. And for Chr**t's sake they look cooler now taken when they were like adolescent ages. I can assure you they'll post it in their facebook accounts if they have that pics.

Receipt Printer for Taxis
I can't see a problem to this. Now, there maybe some kind of stuff like reimbursement by some call center agents having to ride a taxi in the middle of night to go home or office. But I really don't see it a problem, they have taxi allowance anyway. Now of 90 million Filipino people, not a single one of it thought of having a receipt printers for taxi. Again, as I said maybe he's a visionary but I don't see it as changing the world. Might as well have receipt printers or POS for tempura vendors eh?

Conclusion
Maybe I'm just dumb because I don't seem to understand the full of it. But I'm thinking practically. There are lots of problems that needs to be solved. These problems need to be solved immediately, effectively and efficiently. If they can't see it or just pretending to be blind I can at least name poverty as one of the problems. They need to focus to give a good solution. As the saying goes,
"No problem can withstand the assault of sustained thinking". 
they need to think over what the problems are and give solutions. They shouldn't waste time on optimizing early.

Again, maybe I just don't know politics and the science of it but in real world, IT guys act and we act fast. We don't optimize early, we tend to solve real problems. Being agile is a good thing in our industry and I think it still applies in politics.

Wednesday, January 19, 2011

Installing IIS and .Net Framework

This is a very simple steps in installing IIS and .Net Framework. Why do so? I just find it useful for reference when getting started with ASP.NET. This post will explain installation of the said tools in WinXP Pro.

What's IIS?
It's a web server. From Microsoft and included in the Pro version of Windows (at least from XP). It's used for hosting web services, like web pages/sites and other services. Before it was able to host classic ASP with VBScript on it. And when the dawn of the .Net era, .Net offers registration of the framework to this server. It has actually lots of benefits. You can easily port or create an application based on .Net and run on IIS.

You can easily get this application in your WinXP CD. I'm using WinXP Pro so you might refer to the documentation if you're using other windows operating system.

Open up Control Panel and go to Add/Remove Programs, click Add/Remove Windows Components. There should be a check box there that is unchecked when IIS is not installed. Please verify. Checked it and click next until it finishes installation.

Go to http://localhost/ to confirm if it's running.

.Net Framework
You've probably know how to install this one, but anyway here goes. You can download the framework from here. You must install this after you've installed the IIS. There's a portion of the installation that registers ASP.NET. If you've done this first, you might get annoying errors when trying to run ASPX pages from your IIS.