I’ve been playing with .Net on one of my projects now and we’re using C#. Other teams are in the enterprise. Or the so called Java. You know what I mean, “the IMPLS”. Now I’m diverting. Anyway, Java people on the other teams have check styles. Ok, let’s just call them jTeam for now. Checking styles are one way to set rules on your codes. Some people usually think it’s useless but I have my liking to it. I think codes should be beautiful as oppose to fanciness. I don’t like fancy, simple is useful and should be at least beautiful. What I mean with beautiful is that code shouldn’t be messy. One example is spacing. Having code like x = y+z; and in another code there’s z=y + x * 2; There’s not much of a problem here. It’s just that the spacing is inconsistent. And I think it shouldn’t be that way. I think it’s irritating to look at.
Checking all of these inconsistencies in about 2000 lines of code is awful. Horrible if you’ve got tens of thousands of lines or hundreds. But do not fear. Then came check styles. jTeam has all these and I think most of them don’t quite get that .Net has also this. It’s because some teams don’t even unit test. Now I’m not saying unit testing is fun. Sometimes it’s time consuming but sometimes it pays to get testing done. What I’m saying is I think some (teams) don’t even know unit testing. Especially in our .Net colleagues. I for one, is not good with unit testing but not knowing it or whatever it is, is I think dangerous. It’s like sticking your noses to things you only knew. And to think they’re here about 5 years working, with no unit tests at all. Peligroso. Our .Net teams are bound to be discriminated. Sad.
Anyway as I said, we have check styles and it’s called StyleCop. I tried implementing it in one of the projects I’m managing as a development lead. We use SharpDevelop 3.2 and 4.2 for 2008 and 2010 project formats. Style cop is fun. All you got to do is set rules. You can do this by opening the style configuration file. Usually SharpDevelop has some default value in the Source Analysis project tabs. StyleCop has also some default configuration file in the installation directory. Usualy I just copy the default and put it to the src directory of our project and modify it to fit our needs. In SharpDevelop, point the style configuration file to where we paste the modified default. That’s it. It’s fun and not so difficult too.
But wait you would say. SharpDevelop didn’t find the task? We need to tell SharpDevelop to find StyleCop. Go to Options and in the Tools tree view, click Source Analysis, find the StyleCop installation directory and choose Microsoft.StyleCop.dll. Clik OK and we’re done.
Checking all of these inconsistencies in about 2000 lines of code is awful. Horrible if you’ve got tens of thousands of lines or hundreds. But do not fear. Then came check styles. jTeam has all these and I think most of them don’t quite get that .Net has also this. It’s because some teams don’t even unit test. Now I’m not saying unit testing is fun. Sometimes it’s time consuming but sometimes it pays to get testing done. What I’m saying is I think some (teams) don’t even know unit testing. Especially in our .Net colleagues. I for one, is not good with unit testing but not knowing it or whatever it is, is I think dangerous. It’s like sticking your noses to things you only knew. And to think they’re here about 5 years working, with no unit tests at all. Peligroso. Our .Net teams are bound to be discriminated. Sad.
Anyway as I said, we have check styles and it’s called StyleCop. I tried implementing it in one of the projects I’m managing as a development lead. We use SharpDevelop 3.2 and 4.2 for 2008 and 2010 project formats. Style cop is fun. All you got to do is set rules. You can do this by opening the style configuration file. Usually SharpDevelop has some default value in the Source Analysis project tabs. StyleCop has also some default configuration file in the installation directory. Usualy I just copy the default and put it to the src directory of our project and modify it to fit our needs. In SharpDevelop, point the style configuration file to where we paste the modified default. That’s it. It’s fun and not so difficult too.
But wait you would say. SharpDevelop didn’t find the task? We need to tell SharpDevelop to find StyleCop. Go to Options and in the Tools tree view, click Source Analysis, find the StyleCop installation directory and choose Microsoft.StyleCop.dll. Clik OK and we’re done.
Comments
Post a Comment