Last week, the developer of APRS-SCS, John - KB2SCS announced that he was dropping all support for APRS-SCS, as it is written in VB6, which is no longer supported by "the boys from Redmond", aka Microsoft. At that time, John put the source code up on his Web Site.
I started to talk with John (he lives close by, and I really have to get together with him), and I think I'm going to take a crack at porting the program over to VB.NET.
This is NOT going to be a trivial port, and in fact, I've had a bear just getting the development environment up to the point I can compile the existing source (I'm there now - if you need hints, email me)
Anyway, John as agreed that I can "open source" the program.
I'm thinking that I'll put this up on Sourceforge (gasp - a windows app on Sourceforge!), and anyone who wants to contribute can.
The first issues that MUST be taken care of
1)The application uses what are called "old controls". These are .OCXs that Microsoft shipped with VB4 and 5, that were basically replaced by native controls in VB6, but were still available for download, but non supported. There is an "interesting" problem with the "Old controls" - they will not work in the VB6 development environment under Vista. (an aside, the VB6 IDE does not work in Vista64, but IS supported under Vista32)
2)The application uses a 3rd party OCX called "Socketwrench". There was a free version of this control, but there no longer is. Under .NET, we don't need it, the stream reader/writer classes can handle this for us
3)The VB6 and .NET graphics systems are totally different, and this will probably be the biggest part of the port
Anyway, I'd like to hear what you think, and many hands make light work. I'll need testers, reviewers, and even a few developers to help.
Anyone game?
Showing posts with label Legacy Code. Show all posts
Showing posts with label Legacy Code. Show all posts
Wednesday, October 01, 2008
Tuesday, April 22, 2008
AAArrrggghhh Legacy Code
Recently, I've been working on what is probably the "Ultimate" legacy/Brownfield application. It's a VERY important application for our business, or WAS, but the users are starting to find other ways to do their job. The problem is that the application in question is VERY hard to maintain, and management does not want to risk making any "non critical" changes. It's the classic "Big Ball of Mud" design.
Now no matter HOW many time's I've read Michael Feather's Working Effectively with Legacy Code, I can can never quite figure out how to make it work in this case. There are almost no seams to exploit. We have numerious routines that have a Maintenance Complexity in the 2000 to 3000 range. Of course these routines have no REASON to be that complex, it's just that previous programmers had a tendency to lump all sorts of things together that had nothing in common except that they needed to execute at the same time.
DRY? They never heard of it
The classes are just mirrors of database tables, and if a calculation needs to be done on a class or collection, the routine is usually inline in a form event, with "other" code mixed in.
I do find RefactorPro! to be a very useful tool, but even with automated tools, I have to take huge risks, just to get the code to the point I can start putting test harnesses on it.
Anyone else have to maintain a probram like this? The goal here is to get the application maintainable enough that I can start to add features to retain/regain our internal user base
Now no matter HOW many time's I've read Michael Feather's Working Effectively with Legacy Code, I can can never quite figure out how to make it work in this case. There are almost no seams to exploit. We have numerious routines that have a Maintenance Complexity in the 2000 to 3000 range. Of course these routines have no REASON to be that complex, it's just that previous programmers had a tendency to lump all sorts of things together that had nothing in common except that they needed to execute at the same time.
DRY? They never heard of it
The classes are just mirrors of database tables, and if a calculation needs to be done on a class or collection, the routine is usually inline in a form event, with "other" code mixed in.
I do find RefactorPro! to be a very useful tool, but even with automated tools, I have to take huge risks, just to get the code to the point I can start putting test harnesses on it.
Anyone else have to maintain a probram like this? The goal here is to get the application maintainable enough that I can start to add features to retain/regain our internal user base
Tuesday, April 15, 2008
A Basic Class Design Lesson
Hi Gang,
I'm going through some OLD code today, probably written before classes, but looking at it, I realized it might be a good class design lesson for those not used to writing classes.
The code was in a form, and was actually used multiple times - which by itself says the code should be in a function - code has been changed slightly to obscure the exact nature for my blog, and is in Visual Basic 6.0, but the lesson works for any Object based language
OK (again, VB6 syntax) you could say:
and put that in the form
Which would make the call in the form
- it's ok, and a heck of a LOT better than it was (remember, it's used multiple places - the Don't Repeat Yourself (DRY) concept comes in here)
BUT - that's NOT where the function should really be. What we do is add a Property to the class
Now, this reduces the code in the form to:
Isn't that better? The class is taking care of itself. Ahhhh
I'm going through some OLD code today, probably written before classes, but looking at it, I realized it might be a good class design lesson for those not used to writing classes.
The code was in a form, and was actually used multiple times - which by itself says the code should be in a function - code has been changed slightly to obscure the exact nature for my blog, and is in Visual Basic 6.0, but the lesson works for any Object based language
If Left(instanceOfClass.pollclose, 2) > 12 Then
objGrid.Text = (CInt(Left(instanceOfClass.closingTime, 2)) - 12) & ":" & Right(instanceOfClass.closingTime, 2)
Else
objGrid.Text = Left(instanceOfClass.closingTime, 2) & ":" & Right(instanceOfClass.closingTime, 2)
End If
OK (again, VB6 syntax) you could say:
Private Function formatClosingTime(byval theTime as string) as string
If Left(theTime, 2) > 12 Then
formatClosingTime = (CInt(Left(theTime, 2)) - 12) & ":" & Right(theTime, 2)
Else
formatClosingTime = Left(theTime, 2) & ":" & Right(theTime, 2)
End If
end Function
and put that in the form
Which would make the call in the form
objGrid.Text = formatClosingTime(instanceOfClass.closingTime)
- it's ok, and a heck of a LOT better than it was (remember, it's used multiple places - the Don't Repeat Yourself (DRY) concept comes in here)
BUT - that's NOT where the function should really be. What we do is add a Property to the class
Public Function formattedClosingTime() as string
If Left(me.closingTime, 2) > 12 Then
formattedClosingTime = (CInt(Left(me.closingTime, 2)) - 12) & ":" & Right(me.closingTime, 2)
Else
formattedClosingTime = Left(me.closingTime, 2) & ":" & Right(me.closingTime, 2)
End If
End Function
Now, this reduces the code in the form to:
objGrid.Text = instanceOfClass.formattedClosingTime
Isn't that better? The class is taking care of itself. Ahhhh
Wednesday, August 08, 2007
Barriers to Agile Development
I just ran across an interesting blog post RE the Barriers to Agile development at
barrier to agile development
Personally, I can see how Agile and TDD work. MY personal biggest barrier is that MOST of my development time these days is spent porting REAL legacy code - VB 6.0 stuff (some of which were ported to VB6 from VB3!)
I've read
Michael Feather's Working Effectively with Legacy Code and Joshua Kerievsky's Refactoring to Patterns.
The BIG problem is that there are very few tools to get VB6 fat client NON DLL applications under test before you try a port, and if you have seriously UGLY code (and some of this stuff belongs on the daily WTF) you are basically FORCED to do the port, do hundreds of minor repairs to try and get your code running, and THEN instrumenting your code. Distinctly NON optimal.
barrier to agile development
Personally, I can see how Agile and TDD work. MY personal biggest barrier is that MOST of my development time these days is spent porting REAL legacy code - VB 6.0 stuff (some of which were ported to VB6 from VB3!)
I've read
Michael Feather's Working Effectively with Legacy Code and Joshua Kerievsky's Refactoring to Patterns.
The BIG problem is that there are very few tools to get VB6 fat client NON DLL applications under test before you try a port, and if you have seriously UGLY code (and some of this stuff belongs on the daily WTF) you are basically FORCED to do the port, do hundreds of minor repairs to try and get your code running, and THEN instrumenting your code. Distinctly NON optimal.
Subscribe to:
Comments (Atom)