I always thought that writing code in general and data validation code in particular for the server and then for the client was a tedious and error prone task.
Today I decided to test this with some legacy code I have here. I was thinking on getting some document number validation code I have here, but I stumbled across a function that translates currency amounts into their textual equivalents. Not sure how to say this in English, but the idea is to translate “1,234.56” into “Um mil, duzentos e trinta e quarto Reais e cinquenta e seis centavos”. That is “One thousand, two hundred and thirty four Reais and fifty six cents” in Portuguese.
I got this code originally written in Clipper from a magazine back in 1993.
Sometime later I rewrote it in Access Basic 2.0. A couple of years later ported it to Access 97’s VBA and at last VB 6. I have not touched it since 2000.
I ran the project through Visual Studio 2008 VB project Converter, made a couple of tweaks (really!), and added the project to my Volta test solution configured to run in Debug mode and voila! It worked like a breeze!
That must be what Erik Meijer means when he says "Volta stretches the .NET platform to cover the Cloud.”!!
It is important to notice however, that when you run the code in Debug mode, you are really running the IL version of it. I’m not yet sure how the magic works. Give me time!
As soon I tried to run it in Release mode, the page started complaining about unsupported features such as the Decimal constructor that accepts a Double or somewhere in the VB string helper functions trying to get a CultureInfo.
This is comprehensible since the technology is in its very early stages.
I tried equivalent BCL types and members without using the Visual Basic helper functions, and they worked so as soon as I find more time, I’ll try to fix it. I could simply try to isolate the helper functions giving me trouble and fix those pieces of code, but I’m more inclined to rewrite it in C# since it is not too much code and I have not been programming seriously in VB since 2005.
Anyway I’ll decide the route another time.