Refactoring in VB6
I just got handed a click event with 19 pages of code. Yep, you read it right: nineteen pages!
What can I say? My need for a refactoring tool that works in Visual Basic 6 became immediate.
Luckily I found CodeShine through a little googling.
It doesn’t do a lot, compared to Refactor! and Resharper, but the things it does are invaluable. Its functions are: Extract method, Introduce Explaining Var, Extract function, Localize module variables and Rename.
At about SEK500:- I’d probably pay for it with my own money if I would need it more than the 21 days I can try it for free. This is a tool everyone maintaining crappy legacy VB6 code should have.
FreeMind and the current job
The current job is about defining/refining and documenting a system that is a couple of years old. I was a big part in building it initially but it has grown without much control since then.
As I see it, the main reason it is hard to get a grasp of it now is because there is (or has never been) a central role to consolidate the development. For each little project there has been a new project manager who only wanted to do his part at the lowest cost or him. No one has taken, or gotten, responsibility for all of it. This has led to more than one ugly hack to solve the same issue in different sub projects.
Now they have taken the opportunity to try to figure out what functionality there actually is, and what should be reused or refactored.
This is the first time my deliverables aren’t code. Starting with a blank sheet is always hard, but I remembered FreeMind, a free mind mapping tool. It helps a lot with the blank sheet syndrome since one can start dumping information in it and organize it later. Of course that is possible in any other text editor, but the graphical metaphor of FreeMind helps, at least me, get over the writers block.
I haven’t run FreeMind in Vista before so it was not very pleasant to discover that all file operations on new files failed. I solved it by copying one of the document that came with the install. When I double click it in my favorite file manager it starts FreeMind and I can save changes to ‘old’ documents. It is apparently a known bug so I will keep recommending FreeMind to any one who wants to listen.
I used to build my documentation for logview4net in a commercial competitor called Mind Manager. I think I will start using FreeMind for both logveiw4net and jsiPodFetch in the future.
Working offline with Team Foundation Server
I’m just about done reading Professional Team Foundation Serverand at the end I found this little gem:
This tip needs the Team Foundation Power Tool (tfpt.exe) to work.
When you are working offline you just clear the read-only attribute on the files you want to edit. Later, when you are online, you open the command line, navigate to your workspace and run:
tfpt.exe online
Now the power tool will find all those writable files and create a change set from them.
Remember that you can not rename files while offline, but it is ok to add or remove files.
Sharpdevelop, resources and compiler error
When I moved logview4net to SharpDevelop I got the dreaded CodeDomSerializerException in the WinForm designer. It complained about resources not existing.
Since everything worked in Visual Studio and the application compiles and runs I started looking for other things. After some digging around I found that the properties in the typed resource class was declared internal. I changed the modifiers to public instead and now the WinForm designer works again.
Moving to SharpDevelop from Visual Studio Express
In light of the recent controversy of using plugins in Visual Studio Express and getting some inspiration after listening to the DotNetRocks episode with Christopher Wille on SharpDevelop I thought I should give SharpDevlop a chance again. I am working on two utilities that I plan to release as shareware and as I do not want to rely on tools supplied by my employer I have been using Visual Studio Express until now. I haven’t done any real work in #Develop yet, but I’ve got both projects up and running.
The first thing that bit me was the lack of a typed dataset designer. I was on the way to move that structure into a List<T> anyway so it doesn’t bother me that much right now. I’ll write about the progress of each project this week.
Microsoft vs TestDrivet.NET revisited
Here Dan Fernandez explains the technical reason Microsoft claims TestDriven is in violation of the EULA.
I had not understood how much of a hack the integration is. Hijacking a process and injecting code is not something you do by accident.
So my rule is in favor of Microsoft, but I hope they can solve it without taking TestDriven out of business.
Microsoft vs. TestDriven.NET
This article is revisited here.
There is an ongoing conflict between Microsoft and Jamie Cansdale regarding TestDriven.NET.
I think Microsoft is really wrong here. Is anybody really going to buy one of the non-free Visual Studio SKU’s because they want TestDriven to work? The companies that are so cheap that they don’t use the ‘real’ Visual Studio SKU’s now will probably not buy them anyway. It is still possible to run the unit test outside of Visual Studio so the cost isn’t justified for TestDriven alone.
If Microsoft is afraid that there will be lots of other plug ins for the Express SKU’s they should make the license clear. It is not hard to state that it is against the license to extend the product in any way. If it is true that they have the same license for the commercial SKU’s as the free ones then all external plug ins that didn’t come via the VSIP program should be stopped.
This way of treating the community makes me go to SharpDevelop and MonoDevelop for all .NET work I do independent of my employer and contractors.
If all students looking at .NET do the same the incentive to buy Visual Studio when they start to program for a living will go away. Maybe they will even jump the .NET train and go for another development stack.
My top 5 free development tools
- Visual Studio Express Editions
The free editions of Visual Studio are just fantastic. If you’re developing for Windows they are the best free IDE:s out there.
TortoiseSVN
Lets you use Subversion from Explorer. It doesn’t get much easier than that. With OpenSVN you have no excuse to program without source control.
Testdriven.NET
Run your unit tests from within Visual Studio. You don’t have to release buggy code because you are using free tools.
NSIS
The easy way to create install programs for your projects.
FreeMind
Keep track of your ideas and all the things you need to do.
This is my entry for the Top 5 – Group Writing Project
Roland Weigelt : GhostDoc 2.0.0 Released
I’m trying hard to not make this blog a place where I drop links, but some tools I just can’t ignore.
GhostDoc 2.0 has been released:
Roland Weigelt : GhostDoc 2.0.0 Released
… and there is a lot of fuzz in the cloud because of these: 09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0
If Visual Studio crashes when setting DataSource in GUI
… or you get an ‘Object not set…’ when trying to expand the DataSource list in the properties window,it might be because you have a corrupt datasource in your solution.
Press ALT+SHIFT+D to open the data sources window.
If there is one with a yellow sign in front of it; delete it and Visual Studio should start working again.
I got a corrupt DataSource when I imported a solution to TFS.
