My Quick and Simple Software Generator

Monday, June 29, 2009

A significant part of my business involves developing software and I'm always seeking ways to create source code more quickly. The less time I can spend on the task of writing code, the more time I can spend on designing the business logic that the software will deliver.

Something that I've started doing lately has ended up being a big timesaver: I use Excel as a poor-man's code generator to produce some of my markup and code-behind.

I do a lot of ASP.Net Web development using Microsoft Visual Studio 2008. A common task for me involves dragging a group of controls to a page, renaming each of them so that they are associated with the same field, then linking those controls to corresponding CSS styles. Each group of controls can take two or three minutes to configure in this way so repeating this process 10 or 15 times, as is common, can use up a lot of time.

So I built a simple spreadsheet wherein I type in the key field named just once and the =concatenate() function does the rest of the work for me inserting the unique tags in the appropriate places. Then I simply paste the resulting code into my development environment and away I go. This has ended up saving me a lot of time.

Yes I know, I could write a macro that would prompt me for the field name and spit out the code.But my way takes a lot less time to customize whatever I need to and I didn't have to debug yet another programming routine.

So for those of you who must write the same thing repeatedly with only minor differences, consider something similar to my decidedly not-so-high-tech solution... and use the time you save for something more valuable.

Virtual Machine Networking

Wednesday, May 20, 2009

Microsoft Virtual PC 2007 is very useful for software development and testing new software.

I use this form of virtualization for developing most of the financial applications Amplus provides. I also use it as a test environment for new accounting software.

I can create a virtual machine on my computer, install an operating system, and work in that environment as if it were a totally separate machine. If something goes wrong such as an application not "playing nicely with others", I just delete the whole thing and try again.

Paul Sterling of Motus Connect introduced me to this handy tool and now I use it all the time.

I find it relatively straightforward to use except when it comes to networking. Seems like it always takes me a while to set up a virtual machine to access the Internet through the Shared Networking Adapter (NAT).

The settings that have worked for me are

Network Discovery: On

Local Area Connection|TCP/IPv4|Preferred DNS Server: 192.168.131.254.

Settings such as this seem so esoteric that it surely must frustrate many who simply need a test environment but aren't network administrators. I've experienced that same frustration when all I want to do is get on with my work but end up spending most of a day running down some small but critical detail. Two days ago it was Umbraco (the terrifically promising CMS). I wanted to get more familiar with it but couldn't get the virtual machine to access the Internet to download a required component.

Now that I've got that ironed out - I can start my real work of learning more about the powerful features of Umbraco.