Level Extreme .NET Magazine April 2008 issue

Universal Thread Magazine March 2007 issue

2008
2007
2006
2005
2004
2003
2002

2006
2005
2004

2007
2006
2005
2004

2007
2006
2005
2004
2003

2007
2006
2005
2004
2003

2007
2006
2005
2004
2003

2004
2003
2002
2001
2000
1998
1997
1996
1993

2003
2002

2003
2001

2003
2002
2001

2003
2001

Visual FoxPro 2001
Visual FoxPro 2000
Visual Studio 2000

West Wind 2002
Double Impact 2001
FoxTeach 2001
Jam sessions
Technical Guidelines

Universal Thread documentation

About
Acronyms
Contact information
Troubleshooting
Time zones
Web Service
Terms & Conditions
Copyright

Manage your account for the messages area options, your subscription information, your invoicing, youir banners and your pictures Subscribe to the Universal Thread and get all the benefits related to the messages area A corporate subscription is needed for companies that have more than one developer Access the Universal Thread store to purchase your subscription, corporate subscriptions and banners The Universal Thread is covering several conferences per year. On site, reporters cover the technical aspect of the conference as well as making interviews, taking pictures and videos and other related content. Get all the reports from our coverages site. Universal Thread home page Level Extreme .NET Magazine, a newly published online magazine by Level Extreme about Microsoft .NET technology and its community Universal Thread Magazine, a magazine dedicated to the Visual FoxPro community Southwest Fox 2006

The newest developer conference dedicated to Visual FoxPro! We want to provide practical techniques and best practices for all skill levels that can be applied to the problems and challenges in developing applications today. Sessions will give a better understanding of OOP; upgrading existing VFP skills; address the latest changes and innovations in VFP; knowledge of additional tools such as SQL Server, API’s and .NET; business advice; taking your application to market; and “nuts and bolts” sessions that you can use today. You will also have the opportunity to mix, blend, come together, mingle, join, unite, socialize, circulate, associate and altogether rub elbows with the top speakers and recognized vendors in our industry. Please join us for what we are certain will be a valuable and entertaining conference.

Date: 
Location: 

October 19

by Dave Bernard and Bo Durban

Welcome to our coverage of the 2006 Edition of Southwest Fox.

The conference started out, as conferences are wont to do, with registration and a reception. In Arizona in the fall, that means having a reception outdoors in an environment not unlike sitting in your own home. The finger foods were welcome, the renewal of friendships was encouraging and the conversations were stimulating.

Keynote

Conference organizer Bob Kocher opened the conference, welcoming the substantial ballroom crowd to the third edition of
Southwest Fox (by my count, the number of attendees is somewhere north of 100 developers, down from last year.) He quickly turned the proceedings over to Craig Boyd, Doug Henning and Rick Schummer, for their ensemble keynote presentation.

VFP Past, Present and Future

Craig jumped up, arms waving and pacing, and regaled the assembly with a frightening tale about his ride to the conference with Doug and Rick in their rented Ford Taurus. With Doug driving, the brakes suddenly failed while hurtling down a narrow winding hill, shear cliff on one side and jagged rocks on the other. After bouncing off the guard rail a few times they finally came to a stop after hitting a tree.

The audience at this point had been reeled fully in by Craig, who then related how "Doug then pulled out his computer and wanted to run a Stonefield Query to determine the cause of the problem, followed by Rick attempting to hack the braking system using HackCX." Craig asked "but how will you know if you can accurately reproduce the problem?", then "so we pushed the car back up the hill to try again." With the wool removed, everyone laughed (for some, after a sigh of relief). The point of the story, according to Craig, was that many people are fearful about the future of VFP, unnecessarily, and we need to dispel that fear.

VFP Past (1984 to 2004)

Rick then showed a wonderful nostalgic FoxPro marketing video from 1990 featuring Dr. Dave Fulton. Other people featured included included Tom Rettig, Adam Green, Pat Adams, Walt Kennamer and George Goley. The video received a few chuckles with comments like "Finally you have a database program you can give to your secretary to run" and "It runs fast on the latest high-powered 286 and 386 computers"! A lot of the message still resonated with the VFP crowd.

VFP Present and Future

Craig outlined the immediate future of VFP; there’s a lot of activity from both Microsoft (in the form of VFP 9 SP2 and Sedna) and the VFP open source community (in the form of VFPX and VFPY.

VFP 9 SP2, currently in CTP, will ultimately deliver a number of bug fixes, good compatibility with Windows Vista and some exciting reporting exnhancements. For example, the Dynamics tab in the report form field properties dialog is essentially a PRINT WHEN on steroids. Properties can also be set according to report output type, too. For example, a VFP report that is going to be output to HTML might need to have certain form elements turned into links. You can now make those kinds of decisions according to the output target, which gives VFP developers a lot of flexibility.

Doug then showed off the new My namespace that is part of the CTP Sedna download. This is similar to the VB.NET 2005 My namespace and is very easy to extend via a builder. Everything that defines the MY namespace is driven by a VFP table (of course), and it all comes with extensive documentation. This is one of Doug’s personal contributions to Sedna.

LOCAL My as MY
My.
My.Data
My.Settings
My.Computer.Audio.PlaySystemSound(...
My.Computer.Clock
My.Computer.FileSystem.SpecialDirectories.MyDocuments
Doug went on and discussed the new, completely rewritten Upsizing Wizard in the Sedna CTP. Compared to the old wizard, it is about 10x faster, and does a much better job importing data (data type conversions), e. g., bring in blank dates as nulls, trim character fields that are mapped to varchar instead of leaving the spaces, etc. It is also available as an engine, allowing you to programmatically control the upsizing process. Hooks are provided via (certainly a Doug Henning specialty) to create notifications during the upsizing progress. For example, you can create a custom progress meter or write out to a log file.

Rick returned to the stage to describe and demo some of the new enhancements made to the Sedna Data Explorer. First, Rick reminded everyone (again) not to install the Sedna CTP on a production machine. Some of the issues addressed include a problem with default values not showing up properly and auto incremental fields causing strange behaviors. Rick made a point of saying how he has benefited from community input to make improvements to the Sedna release.

Many of the UI changes to the Data Explorer bring it much closer to mimicing the behavior of SQL Server Query Analyzer. The F5 button now executes query, just like QA (yeah!). Rushmore optimization status is now visible and font and sorting options are much more consistent. A useful (and cool) feature is the ability to output schema definition information to HTML format, and be able to easily customize the look and feel via CSS. Rick showed off a "Copy field list to clipboard" feature that he coded last weekend also. He could not confirm that this will make it into the final release of Sedna.

Rick was really impressed at how fast he was able to update a cleint to SQL Server 2005 Express recently. Rick next discussed NET4COM, which bridges the gap between VFP and .NET, exposing many .NET framework pieces. It makes it easy to use .NET assemblies from within VFP. For example, you can take easy advantage of the strong regular expression functions available in .NET. Users require .NET 2.0 or later.

Craig came back up and dove into the Vista toolkit:

Currently considered for inclusion:
  • MSFeeds (RSS): global store of RSS fedds. This is a wrapper around this store for use inside of VFP; build your own news aggregator.
  • Windows Desktop Search: demonstrates how NET4COM type technologies can be used to wrap the Windows Desktop Search .NET libraries inside of VFP to search files and emails on a workstation, similar to the way Google Desktop works. You can use SQL syntax or a paramterized command text to search to define the search criteria (shades of LINQ?).
  • New Common Dialogues: Task dialogs: Messageboxes on steroids. Can work on Windows 2000 and Windows XP.
  • XAML: Using NET4COM technology, you can render XAML dynamically within Visual FoxPro.
Then Craig got a few "Wow"s while demonstrating Aero Glass transparency in VFP forms running on Windows Vista. XPS (XML Paper Specification) is new to Vista, and Craig showed how to render a VFP report so that it could be displayed in an XPS viewer. He’s working on a reporter listener to do this more directly (he used a printer driver to accomplish it in his demo, similar to using CutePDF to create PDF output). The XPS specifications supports digital signatures, which is very important for legal documents.

Craig told an abbreviated version of the VFPX story, how Ken approached him with the idea last year and how it was originally set up as SednaX on GotDotNet. Now, it exists as VFPX on CodePlex, and supports quite a few important projects. Get involved!

Similar to VFPX, but with a different focus, VFPY is a community project to provide a robust web development environment for VFP developers.

Miscellany

Michael Hogan’s FoxPro Success Stories site; another good one is on the FoxWiki.

A few great promotional videos, created by Kevin Ragsdale, really pumped up the crowd. These were great!

DBi Technologies has generously donated several commercial controls to VFP developers.

One big surprise was Doug Henning receiving a Lifetime Achievement Award from Ken Levy. Well deserved!

October 20

by Dave Bernard

The Security Cookbook
Christof Wollenhaupt

For me, this was a much anticipated session. Christof is a prolific constributor to the FoxPro community, but he is rarely seen on this side of the pond. His session did not disappoint...

Christof isn't a guy who enters a pool by wading in via the steps; he dives right into the deep end. He dropped every jaw in the room by running an application protected by ReFox Level II then nonchalantly displaying the original VCX source code. Some protection!

Don't include the Report Designer in your code; it will allow you to bypass any third-party security. It's a whole programming environment! Build the report designer as a separate EXE that hits empty tables and not the production tables.

Assume that source code is not protectable. Protecting source code in this day and age is near impossible, according to Christof. However, obfuscation techniques can make it much, much more difficult for a hacker to be able to understand and use your source code, even if it's available. As with many of Christof's solutions, it is both simple and elegant: add the ability, say through an INCLUDE file, for your program to replace all variable and procedure names with large unfathomable strings that are still valid names for Visual FoxPro:

#DEFINE VAR_Sum         QÍEÃúÿec2ÏÞJåVâ_Aêb1MûÈvuÔwÈYYEÉÒÆàáÑÅpKþO
#DEFINE VAR_Count       gÜäXùsÝÑsQë5RíÁÁÓÑwOãÎUoyÌÑÈycÄp
#DEFINE VAR_Price       I4ÝûtÁÞ5SÄAy9xjþÃDøüZwä
#DEFINE PRC_GetDiscount ËzrhÎvôhýÕñNäSÃ_2QyFôhN9ùÔYüOÜQîÉò_WRVðWï
#DEFINE PRC_GetVAR      ÎkE_"rlèÐÿhÌÛtÄòÛËßaÝUSS7mvOe
To protect the code against simple search and replace attacks, you could use the same names for local variables in every method; include a procedure-specific include file at the beginning of each method and another one at the end that releases all constants using #UNDEF. You get the idea.

Christof spent a lot of time on the importance of ensuring strong password usage in an application. The password defines how secure encrypted data are; if you know the password, it doesn't matter at all how secure or insecure a data encryption algorithm is. Given that, it is surprising that few applications ensure that strong passwords are enforced (gulp! mea culpa). This applies not only to the IT arena, but to combination locks the world over!

Password strength depends on a number of factors:

  • A good password is not driven by personal aspects. Bad passwords are the name or birthday of the kids or spouse, favorite car or pet, or other passwords that are directly related to the user's personal environment.
  • Passwords shouldn't contain words. The Internet contains word lists in all major languages that contain regular words, names, places and frequently used passwords. Specialized tools can use these word lists to try these passwords. This greatly reduces the amount of territory that the hacker needs to cover to get at the password.
  • In theory, 128-bit passwords are equivalent to a length of 16 characters. However, hardly anyone uses all 256 possible available characters; most passwords are formed out of characters, sometimes digits and seldom special characters. If you only use digits to create a 128-bit password, you need a password with 40 characters!
Christof showed a lot of useful code to illustrate creating and validating strong passwords, including how to measure the strength of a password. In general, it should be a mix of characters (upper and lower case), digits and special characters. There are also web sites that can generate strong passwords for you; our company has used http://www.securitystats.com/tools/password.php to good effect. You can also pull passwords by reading a chunk of a known file (such as a JPG, GIF, etc.) That's clever!

"Passwords are something that should never ever be stored somewhere." UNIX has long used 160-bit hash values to point to actual passwords. Use the Windows LogonUser API function to validate a user, instead of creating application-specific authentication.

Next, Christof discussed and demoed encryption techniques. Rather than being a solution to make an application secure, encryption is just a building block of a total security plan. Once you ensure the use of strong passwords, any implementation plan needs to use encryption techniques as protection against tampering, preferably off-the-shelf methods like the Windows CryptoAPI or the VFP _crpytapi foundation class.

Christof deftly mixed slides, code and demonstrations to illustrate security issues with COM servers and create hashes with SYS(2007) (just make sure to add your own short unique string to the output). He showed how FLL's can be hacked, and recommended storing FLL code in a table and then writing it to disk and calling it in real time, before destroying it; that way, the FLL never exists as a file on the disk!

DBC's should always be write-protected. Only a developer needs to alter one, never a user. You can use code to make sure that the DBC is read-only on the disk, just in case someone's tampered with it. Also, you can save copies of the DBC files somewhere and compare that to the one to be opened to make sure it's not been tampered with. Do the same with DBF's, by comparing portions of the header to a template.

My head hurts...

Installing Applications Using InnoSetup
Doug Hennig

For many people, deployment is almost treated as an afterthought. But the installer is the first thing your users will see.

Doug cleared the air pretty quickly about just where he stood on the various deployment options available to VFP developers. While VFP can create Windows Installer-based deployments (Doug: "I hate Windows Installer") and also comes with a stripped down version of InstallShield (Express), fast-free-easy InnoSetup was his clear choice. Windows Installer creates bloated code, delivers glacial install performance, "poops" on your system by leaving registry entries and files all over the place and sometimes appears to have a mind of its own. InnoSetup is the direct opposite in all respects.

Doug spent quite a bit of time demoing the creation of a simple install using the InnoSetup wizard, which walks you carefully and smartly through all the fine points of setup creation, step by step. It supports incredible granularity in terms of detailed settings and behaviors, and does it quickly. The wizard creates a plain text file not unlike an INI file that can also be edited. There is an ISTool UI available (highly recommended) that makes editing existing InnoSetup files even easier. It's also a good idea to download the Quickstart pack.

Inno Setup offers several major advantages over Windows Installer:

  • Starting InnoSetup is significantly faster than starting InstallShield Express.
  • The compilation is significantly faster.
  • The setup executable is significantly (about 10 MB) smaller.
  • The installation process is significantly faster.
  • Uninstalling the application is significantly faster.
Looking to Windows Vista, Doug said that, even though Vista disallows writing to the Program Files folder, it does allow setup programs to do this. An application cannot.

Other related resources mentioned during the session:

  • Rick Borup recommended UnClean 2, an improved replacement for the uninstall portion of the Add/Remove Programs applet (ARP). It provides full and clear access to all available information. You can delete an uninstall entry if you discover that it's no longer valid. And of course you can remove, change, or repair programs in the same way that you can with ARP.
  • See InnoSetup resources on the FoxWiki.
  • Check out Gavin Lambert's InnoSetup Snippets.
Rick Borup also provided a really good example of extending InnoSetup with additional dialogs to get user info via code.

Great session, Doug!

Lunch and Ken Levy

I spent lunch time chatting with several new-found acquaintances, when Ken Levy stepped up and introduced a video taken at the 1993 DevCon in Orlando (which I attended).

On this video, we saw Roger Heinen interviewing Bill Gates via satellite; at one point Bill declares "We are totally committed to the Fox product." No comment.

Ken proceeded to do a great overview and series of demos of the Windows Live Platform, including many examples of various mashup possibilities that are being provided for. Cool stuff!

VFP and AJAX
Mike Feltman

Mike has an easygoing and direct style; you always know exactly where he stands and how he feels about particular technologies, and he backs his opinion up with real world experience.

In this session, he tackled one of the hottest buzzwords in the industry today: Asynchronous Javascript with XML (AJAX). Made suddenly popular by Google engineers (who refer to their coding technique simply as JavaScript) with applications like Google Maps and GMail. In reality, AJAX is just a new name for good old DHTML (Dynamic HTML), and just a small subset of it at that. AJAX allows web developers to create rich desktop-like applications in the browser by taking advantage of client-side events and the DOM (Document Object Model) and by performing background communications with the web server to handle timely data retrieval and validation. With the wide variety of server side scripting tools available for it, its blazing fast database engine and its strong text handling capabilities VFP can be a strong player in the AJAX arena.

AJAX isn’t a technology. It’s really several technologies, each flourishing in its own right, coming together in powerful new ways.

  • Consists primarily of DHTML, JavaScript and XMLHTTP.
  • Create Web apps with mature, freely available technologies.
  • Browser client code calls server side code directly without reposting the entire page back to the Server.
  • Client side code pulls incremental UI updates in response to user action, enhancing the illusion of speed.
  • Contrast this with standard Web applications where typically all business logic and UI creation is managed on the server, with the client browser merely rendering the content.
  • AJAX makes the client an active part of the application.
  • Incidentally, despite the "X" in the AJAX name, XML is actually not used by most AJAX implementations. XML use is optional.
Mike's goal was to show how to:

  • Use AJAX to make asynchronous background calls to retrieve data.
  • Use JavaScript to update elements of web pages without redrawing the entire page.
  • Build fast interactive web applications with all of the bells and whistles.
Mike's first demos relied heavily on Active Fox Pages, but developers can use Web Connection, ASP, ASP.NET and other methods just as well. He demonstrated popular examples like zipcode lookups and illustrated the differences in targeting Internet Explorer and FireFox. Mike reviewed several resources for heavy-duty Javascript out there:

  • Script.aculo.usfor cross-browser user interface Javascript libraries;
  • Prototype for a JavaScript framework that aims to ease development of dynamic web applications;
  • Rico for an open source Javascript library for creating rich Internet applications;
  • Dojo for another open source Javascript toolkit;
  • Max Kiesler for lots of AJAX tutorials and resources.
See Neil Gerard's AJAX for a really good presentation-style overview.

AJAX is a very important software development technology today, gaining wider and wider acceptance. VFP developers can take direct advantage of this to deliver advanced, desktop-like web applications to their customers. This is a must-see and must-learn for anyone doing web development.

Best Practices for Project Management
Cathy Pountney

Cathy has done an amazing job of distilling the broad and sometimes arcane subject of Project Management into a single session, jammed packed with nuggets of useful techniques and guidelines. It's a great roadmap for avoiding typical pitfalls and ensuring a smooth successful process for any project.

She directly addressed why requirements aren’t always understood and communicated properly, developers aren’t always "team players", schedules are often unrealistic, lack of coding standards hinder consistency, little or no testing is done, and implementations don’t go smoothly. And what you can do about it.

Cathy started off with a little humor that illustrated the viewpoints held by the various stakeholders in a typical project.

First, it's important to start the project with high-level view of the project from the customer's point of view, the Vision and Scope Document. Once completed, it's time to lay the initial Groundwork for the project, such as choosing a methodology (e.g., Agile or Incremental development) and choosing the development tool set. The tool set should encompass project management tools such as a wiki, spreadsheets, commercial management tools, database technology, development environment, source control, bug tracking, help generation and others. A common thread here is concerns communication capability: build up your infrastructure to enable frequent and easy communication among all stakeholders via processes and tools.

Cathy spent quite a bit of time on the important topic of team building, contrasting in-house vs. contracting, staff training, using consultants effectively and how to optimize team management. She seemed to view off-shoring as something to be considered only as a last resort, a popular view a few years ago. However, that is rapidly changing as off-shore talent providers become increasingly more sophisticated and competitive in their offerings, moving to a model that provides for an on-shore management component. Many technology venture capitalists now view prospective investment targets much more favorably if they're able to successfully integrate off-shore development into their business. Information technology spending is still largely viewed as a cost rather than an investment by many companies, and lower labor rates resonate loudly with executives.

I couldn't agree more with Cathy's opinion that companies generally do a poor job of doing simple things to keep a high level of morale in the ranks. Inexpensive "treats" like free drinks or a monthly company-paid movie outing return far more value than the financial investment made. This is borne out in the relatively low conference attendance rates, for any technology area, in relation to the total number of possible attendees. Training investment is also largely ignored.

Another part of morale building involves effective leadership; being a good listener, being accountable, being respectful and demonstrating trust in the team go a long way toward gelling a team. You can only do this by getting to know each and every team member, and learning how to relate and motivate each one.

Cathy discussed specification preparation, a controversial topic when contrasting project management methodologies like Waterfall, Agile, Incremental and Extreme Programming. Learn about these approaches and make a careful business decision about which wagon to jump on. The amount of detail required will vary greatly with the level of customer involvement.

The real alchemy of project management is estimating and scheduling. Be sure to account for scope creep and schedule slippage, and don't assume that 40 paid hours a week renders 40 effective hours of work. Build in adequate overhead calculations; create contingency plans for unexpected delays.

Constructing, testing and delivering the product constitutes the execution phase. Again, the details are largely governed by which overall management methodology is guiding the project, but things like coding standards, code reviews, technical documentation and test harnesses are elements consistent with successful implementations. Pay attention to installation details (data conversion work is often overlooked and can be a black hole of expense and risk), customer training, timing and defining and implementing a solid change management process.

Thanks, Cathy!

October 21

by Dave Bernard

Agile Software Development
Craig Berntson

This is a topic I've heard a lot about, but have not really internalized it's meaning, much less worked toward applying it. I was really looking forward to this session, and it ended up exceeding my expectations.

Craig started out by describing the traditional baseline of development methodologies, including
Waterfall, Capability Maturity Model, Rational Unified Process and the Microsoft Solutions Framework. These methods are usually applied in a very linear, step-by-step process, which usually only renders usable code in the latest stages. Business and marketing pressures have greatly shortened development cycles; it's often more important to get something to market sooner rather than wait for a fully articulated system to be created. Flexibility is a key idea in Agile approaches.

"Design consists of creating things for clients who may not know what they want, until they see what you’ve done, then they know exactly what they want, but it’s not what you did." -- Brian Sooy, Creator of the Lucerna Font.

Traditional approaches put the development process above all other goals, which does not reflect the new realities of a much more competitive global marketplace. Agile methods describe effective techniques and, more importantly, new priorities, for effective systems development.

The Agile Manifesto was created in 2001 by 17 self-proclaimed "organizational anarchists", soon to become the Agile Alliance. The Agile approach has been institutionalized and "packaged" in many ways; Scrum, eXtreme Programming (XP), Lean, Adaptive Software Development and Agile Unified Process are but a few well-defined examples.

The main principles embraced by the Agile movement include:

  • Satisfying the customer through early and continuous delivery of value-driven software;
  • Harness change requirements as a competitive advantage for the customer, even late in the development process;
  • Tight frequent collaboration between business people and trusted, motivated developers in self-organizing teams;
  • Working software is the primary measure of progress and success;
  • Maximizing the amount of work not done.
Some of the more tactical features of Agile development include:

  • Short (weekly, bi-weekly or monthly) delivery horizons; to show progress is more important than to reach full functionality for any given iteration;
  • Prototypes do not exist; all code is live running code;
  • Maximize the use of automated testing (something that few developers do);
  • Little or no team hierarchy;
  • Analysis, Design, Test and Code are all done simultaneously;
  • The code itself is the final documentation.
Craig then detailed the similarities and differences between two of the leading Agile approaches, Scrum and eXtreme Programming (XP). Both advocate daily short meetings to get answers to questions like "What did you do yesterday?", "What's to be done today?" and "What are the barriers to getting it done?". It usually held as a stand-up meeting where only team members can speak. The job of the team leader/moderator is one of enabler, removing barriers to team success.

Another aspect of these approaches is that the customer drives the task backlog, which is displayed publicly; Craig says it does not work to put it on the computer, that it should be index cards on the walls of the designated permanent meeting room.

Each release iteration is run as a one-, two- or four-week sprint. A release does not necessarily mean that a customer is directly targeted; a release could be targeted at the QA or marketing departments, as well as the actual customer. You are designing as you go, with continuous integration of new pieces during the sprint; that way, you know early if there are problems. eXtreme Programming adds the idea of "pair programming": do the hard stuff in pairs; rotate around to different people (not always the same pairs). One might call this a "close mentoring" technique.

Next, Craig covered the area of Test Driven Development (TDD), essentially, write a test first, before code ("How am I going to test this method I'm about to build?"). For VFP developers, FoxUnit offers a great tool to manage the execution of tests.

Implementing Agile, Craig insisted, was not an "all or nothing" proposition; implement one or more pieces at a time, and mix and match different Agile methodologies parts as much as makes sense. If you're not pure "Agile", who cares?

Craig delivered other good points while covering a slew of best practices:

  • The customer is not always right; he may have a point, and that point may or may not be valid. (illegalities, e.g.)
  • Any code that's checked in must be in a releasable state
  • Don't give the customer an estimate, give them a "forecast", just like a weather forecast. Do you always believe it?
  • 80% of software applications are shipped without adequate testing
  • Read Code Complete
  • Method names should be verb-noun combinations, e.g., "do something to this"
  • Comment the why, not the what; answer "why did he do it that way?"
  • "Code as if whoever maintains your code is a violent psychopath who knows where you live"
One of the biggest benefits of attending conferences of any kind is chatting with others and networking in general. I attend a lot of conferences each year, not all of them FoxPro-related, and, pound for pound, this conference has the most experienced group of speakers and attendees, who are more than willing to share their knowledge and answer all kinds of questions. It's a real shame that more developers don't (or are not enabled) to take advantage of this.

Where do you want to go today?
Mike Feltman

"I am not a Microsoft hater!" he pleaded...

VFP's future, as a stand-alone monolithic development environment, is limited, due to a lack of Microsoft marketing investment and a shrinking VFP job market.

But that doesn't mean it's time to jump ship! It's time to extend!

First, Mike outlined a foundation of ideas and possibilities that go beyond the pure technological aspects of software development, things that software developers sometimes lose sight of when debating various technology approaches:

  • Focus on keeping current customers happy
  • Build and sell vertical market solutions
  • Add web tools to your skill set
  • Participate in community projects like VFPx and VFPy
  • Increase your exposure; market the brand that is you!
  • Sell business solutions, not technology
  • Be willing to do maintenance work
But we stray far from technology issues. Mike reminded us that a "programming language is just a language"; it's not part of a "religious" war, which is a silly waste of time. Besides, most business needs can be met in any programming language. Remember that the various language "advocates" have ulterior motives. Keep in mind, too, that many (most?) features in a language go unused. Given that, it is useful from time to time to step back and survey the landscape. Mike presented his view of programming alternatives to VFP, analyzing the pros and cons of each.

Common concerns about .NET, Java and C/C++ development, from a VFP'er point of view held common ground in one major area: steep learning curve. I can speak for myself that this is the single biggest barrier to fully adopting any different development methodology: it is difficult to justify in terms of time, expense and lost opportunity cost. The pros for these are why we even consider them: expanding opportunities, growing job market (mostly), backed by large companies, etc. For me, these pros are outweighed by the con.

PHP, PERL, Python, Javascript and Ruby were also mentioned by Mike as worth considering. Javascript and Ruby warrant closer attention because both are "hot" technologies, and Ruby has perhaps the shallowest learning curve.

Most interestingly, Mike did a six-month survey of the job market using DICE, Monster, etc., listings (probably skewed a bit away from small company positions). There were several surprises:

  • Java held a 37% market share, and was growing at a rate of 12%
  • .NET: 16% share, but is declining at a rate of 28%!
  • C++: 15% share, declining by 17%
  • PERL: 11%, growing at a rate of 10% (big surprise to Mike)
  • Javascript: 10%, growing at 9%
  • PHP: 4%, growing at 24%
  • AJAX: 2%, growing at 57%
  • Ruby: 1%, growing at 30%
  • Delphi: 1%, growing at 9%
  • VFP: 0%, declining by 5%
It is clear that, outside of .NET, the web technologies are growing quickly, even "legacy" ones like Javascript. The VFP numbers are probably deceiving because so much of VFP work is done in small companies that are rarely represented on the sites that the survey covered. Think of these numbers as more of a statement of corporate IT trends, making the .NET numbers (a technology engineered from the ground up as an enterprise play) very disturbing if you're a .NET fan.

Mike also surveyed database tools and found SQL Server slipping a bit right after the launch of SQL Server 2005; not sure why. Oracle held the most market share (61%) while MySQL was growing the fastest at 20%.

Mike summarized the kind of work in which he was currently engaged, which included "working like crazy in VFP--really no end in sight", integrating Javascript, AJAX, DOM and CSS work with VFP, learning more and more SQL Server and keeping his eyes on PHP, Ruby and .NET.

What should you do? Whether you're an employee, independent contractor or entrepreneur, make a business decision. Where will you get the most ROI? Where can you deliver the most value to your clients? Start learning other technologies now; read, get tools, etc.

Don't Be A Hater! You'll starve! Employers and customers like optimism.

Lunch
Another nice lunch outside; plenty of buzz about Craig Berntsen's Agile session, Mike Feltman's "Where do you want to go today?", both of Christof's sessions and Andy's Meta Data session. Sounds like everyone is having a pretty good time and learning a lot. Lot's of networking going on, too.

Crashing VFP and Preventing Crashes
Christof Wollenhaupt

I learned from my first Christof experience to prepare myself to drink from the proverbial firehose. At least this time I wasn't surprised by the sheer breadth and depth of his material, especially for such an arcane subject as C5 crashes.

What is a crash?

Why does your application crash?

How do I prevent this?

A crash is an exception, not a bug; it's when a program has left it's normal flow of execution. The most insidious of these is a catch-all memory protection fault error commonly known as a C5. It occurs when some code is accessing a memory address that doesn't exist.

How does this happen? Lots of possibilities in versions of VFP prior to version 9. Here are some of the reasons:

  • Bugs in VFP
  • Dangling references
  • Defective drivers (printers, video adapters)
  • Defective H/W
  • Imperfect system software (anti-virus, spam filters, firewalls, etc.)
Dangling references are a side effect of VFP's way of handling objects and because VFP uses a handle-based memory management system. I can't admit to understanding all of this, but apparently the internal list of object pointers can be lost, leaving the objects hanging but no way to address them. Sometime later, when code tries to access one of these, a C5 is generated because the object pointer is no longer there.

Errors like these often pop up Dr. Watson, Microsoft's built-in bug reporting tool. One option is to allow Dr. Watson to send information to Microsoft about the error; the problem is, enough information is sent to pose a potential privacy issue because all application memory (containing SSN's, passwords, etc.) is sent. This information is stored in a SQL Server database at Microsoft to aid in statistical bug analysis (proof, according to Christof, that SQL Server can store large amounts of data!)

On the other hand, you can get to this data yourself: kill the DW20.exe process via Task Manager (to preserve the file of information), then look for a DMP file in the user's Temp folder (Windows Explorer, navigate to %Temp%). Open the dump file in VS.NET, choose DEBUG, Start Debugging, then the Disassembly pane will be sitting on the error line.

Look at the loaded module list on the right: there you can tell if it's your application or a third party vendor package that's crashing; match the disassembly address with the address column in the module list to verify what crashed.

Christof then demoed in rapid fire fashion many ways of generating C5 errors, most since fixed in VFP 9:

   VFP 5, 6: Include a file in a VCX class that contains
      #IF UnknownVariable
      #ENDIF
   VFP 5: Try this for an object that's not yet on a form:
          olbl = CreateObject("Label")
          oLbl.AutoSize = .T.
          oLbl.Visible = .T.
   VFP 8: lcvar = "EVALUATE(lcVar)"
          EVALUATE(lcVar)
If you really know your stuff and understand a bit of assembly language, you can even get VFP to recover from the C5 by using the debugger to pop the stack "just right"!

VFP 6, VFP 7: hitting the boundary of VFP's 4K internal memory paging mechanism:

t=0
DO while .t.
  @ 0,0 say Str(t)
  lc = Sys(2015)
  Public (lc)
  Store Replicate("X",Rand()*999)+Chr(13)+Chr(10)+;
    Chr(13) to (lc)
  lc2 = Sys(2015)
  Dimension &lc2[1]
  ALines((lc2),&lc)
  t=t+1
  Release (lc)
  Release (lc2)
EndDo
Long field names in a SELECT in VFP 7:

Sys(3054,12)
Select ;
  xxxxxxxxxxxxxxxxxxxxxxxx.yxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxy, ;
  Left(xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaax.;
  yaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaay,1) AS ;
  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, :
  xiiiiiiiiiiiiiiiiiiiiiiiiix, ;
  xx, Space(20) AS xx, Space(40) AS ;
  xxyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy,;
  x1x, x2x, xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.yy, ;
  xx.ylllllllllllllllllllllllllllllllly, ;
  xx.ybbbbbbbbbbbbbbbbbbbbbbbbbby, Space(20) as xzzzzzzzzzzzzzx, ;
  xx.yttttttttttttttttttttttttttttty, ;
  Space(20) xqqwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwqqqqx ;
From xxxxxxxxxxxxuuuuuuuuuuuuuu
Christof highlight potential C5 problems with WITH...ENDWIDTH constructs, because VFP creates an internal PRIVATE (scope) reference that could affect downstream method or procedure calls. Commands to avoid within a WITH...ENDWIDTH structure include RETURN, RETRY and COMRETURNERROR.

Christof addressed risky developer behavior, advocating avoidance of rarely used features (Microsoft doesn't test these as thoroughly), older features (same reason) and unusual feature usage. In fact, he says that if someone tells you "I have this cool code here", respond "Then go and fix it!"

"Cool" is buggy; boring code is great!

Great presentation, Christof!

October 22

by Dave Bernard

Using the VFP Debugger Effectively
Tamar Granor

Tamar started right in by reviewing the various ways to access the debugger components. Then, she went into detail on each of the debugger windows:

Drag-and-Drop is extensively supported across windows, too.

The real meat of the session followed (characterized as the "Julia Childs section" by Tamar!). She noted that choosing Fix off the Debug window doesn't really "fix" things, but takes you back into the IDE and loads the right code, placing you at the point of the error.

Tamar is a big fan of assertions, which are intended to check developer behavior; "at this moment in the code, this assumption should be true".

ASSERT [expr] [message]
Assertions are ignored at runtime; use SET ASSERT ON|OFF to control them programmatically. Assertion messages appear in the Debug Output window. Assertions do not replace true boundary checking in your code.

Next, Tamar showed some examples of setting breakpoints in order to step through code and examine variables, properties, expressions, etc., to find problems. She outlined four kinds of breakpoints:

  • Break at a location (a line of code); check out the Pass Count setting.
  • Break on the value of an expression becoming true.
  • Break on the value of an expression changing; going in and out of scope unfortunately triggers a change.
  • Break at a location is the value of an expression is true.
Don't use SET STEP ON or SUSPEND in your code! Instead, set breakpoints, because they only apply in the debugging environment and if the debugger is open. How many times have you delivered production code after forgetting to remove a SET STEP or SUSPEND statement?

There are several ways to step through code:

  • Step Into (F8): One line at a time.
  • Step Over (F6): execute a line, but don't step into a procedure call if there is one.
  • Step Out (Shift+F7): finish executing the current routine only.
A couple of very useful features:

  • "Run to cursor" allows you to quickly run to a point without setting an explicit breakpoint.
  • "Set next statement" allows you to skip code and set the run start point to an explicit location, without executing any intervening code. Only works within the current procedure; cannot go across the call stack boundary.
On-The-Fly Fixing: don't get stuck staring at the debugger when troubleshooting; use the full VFP IDE to help troubleshoot a running program. You can jump over and change a variable's value, for example. Really cool: in the Locals window, double-click on a value and you can edit it!

Don't use WAIT WINDOWS for development-time debugging; use DEBUGOUT because WAIT WINDOWS get in the way of execution, and DEBUGOUT doesn't do anything in either the runtime environment or when the debugger is closed.

Event Tracking: can get a message for every event that fires, and the order in which they fire, and display that in the debugger. Beginning in VFP 8, you could even track certain Windows-level events. You can choose which events to track; avoid tracking MouseMove and Paint events because they will fill up the output quickly. You can send the results to a file or to the Debug Output window (preferred, because you can then save it selectively if you want).

Coverage Logging: logs a line to a file for each line executed. For each line, execution time, class/method/procedure information, call stack level, line number and other information is captured. This information can then be used with the Coverage Profiler, and displays a merge of the log information and the source code, including marking lines which were not executed. Other items of interest that can be displayed are execution times (per line and average) and how many times each line was executed. Great for final stage performance tuning.

Become a better programmer by using the debugger!

Finis

The closing session was a giveaway-fest; many of the sponsors gave away software packages in multiple drawings. A really nice touch as Cathy Pountney's surprise presentation of a collaborative baby shower gift to Toni and Mike Feltman, who are expecting their next child in January. That was probably as good an illustration of how close-knit the VFP community is, just as it always has been. And that is one of its greatest strengths.

Bob Kocher, conference Grand PooBah, got a big round of applause for his efforts. This conference, as defined by the session mix, speakers and attendees, underscored the maturity level of both the tools and the people who make up the VFP family. There are few other software technology gatherings with so much accessible brain power and experience under one roof. FoxPro is not only alive and kicking, but it rocks!

We all look forward to next year!

 
David Bernard, The Intellection Group, Inc. 
Dave is co-founder and Vice President at The Intellection Group, Inc., which builds web-based business solutions for many different industries. He has been a software developer, manager and executive for over 25 years. He has worked in FoxPro continuously from version 1.02 through VFP 9, is Vice President of the Atlanta FoxPro Users Group and holds MCSD and MCDBA certifications. He currently specializes in Internet-based extranet development using VFP and SQL Server and has recently been immersed in voice recognition, text-to-speech, natural language and RFID projects.

 
Bo Durban, Moxie Data, Inc. 
Bo Durban is the CEO for Moxie Data, Inc. specializing in the development of enhanced database and reporting tools for VFP developers. He is also the project manager for the GDIPlusX open source project on VFPX.



Copyright © 1993-2008, Level Extreme Inc., All Rights Reserved
62 Rue Doucet, Petit-Rocher, New Brunswick, E8J 1L3
Telephone: 1-506-783-9007 Email: mfournier@levelextreme.com