You will be redirected in 30 seconds or close now.

ColdFusion Authors: Yakov Fain, Jeremy Geelan, Maureen O'Gara, Nancy Y. Nee, Tad Anderson

Related Topics: ColdFusion

ColdFusion: Article

10 Mistakes Fuseboxers Make

10 Mistakes Fuseboxers Make

In the last year, I've seen a great number of developers make the commitment to learn Fusebox - and for good reason: the Fusebox framework and the Fusebox Lifecycle Process (FLiP) give developers both a framework and a methodology that work well in creating Web applications. Even so, there are still many pitfalls that can trip up Fusebox programmers. If you're learning Fusebox, here are some tips on avoiding common mistakes:

1.   Asking too much of wireframes
The Fusebox Lifecycle Process (FliP) begins with wireframes. A wireframe is a skeletal application meant to engage the client in the process of discovering what is required. I love wireframes. I find them tremendously helpful in the opening stages of a project, when we're trying to find out what the client wants. They're also very useful as a sales tool; clients see them and get excited by the ability to actually point and click - letting them browse through a skeletal application.

But many developers, eager to get coding, treat wireframes as all that's needed to fully explore what clients want. Wireframes work best when treated like a booster rocket - essential in getting us "off the platform," but quickly becoming ballast that weighs down the project.

Wireframes work best when they're used to help jump-start the process of prototyping - the process of creating an HTML version of the finished application. Too often, I see developers treat the wireframe as a substitute for a prototype. This is almost always a mistake - one that, unfortunately, doesn't reveal itself until the very end of the project. Don't forget a basic truth of software development: clients can only tell us what they want after they see it. In short, wireframes aren't a substitute for prototypes.

2.   Omitting the prototype
This is perhaps the worst mistake we can make. It comes in two varieties. In the first, we completely skip the prototype altogether. "Don't have time," we tell ourselves. Years ago, I worked as a cabinetmaker. One of the wonderful things about that experience is that it taught me patience and respect for my material and my tools. If the temptation in developing is to start coding too quickly, the temptation in cabinetmaking is to assemble too quickly. Hey, it's fun! I want to see my beautiful cabinet, chair, or curio. I want others to see it, too.

In working with wood, assembling the piece early in the process means that you're working with a largish object rather than working with what are essentially flat pieces of wood. When you do that, things like routing, drilling, and planing become much harder and you risk ruining not only a single piece of wood (a sad enough experience), but the entire piece. After a few ruined pieces, you learn to be patient, to delay gratification, to trust in the process. There's a reason they call things like cabinetmaking - and coding - disciplines.

Before I learned this, I often justified my zeal by telling myself, "I don't have time for all this process stuff. I need to see what I'm building." After the heartrending pain of ruining a piece or the heart-stopping fear of almost ruining a piece convinced me to slow down, I put a sign up in my shop to help me remember. It read, "If you don't have time to do it right, how will you find time to do it over?"

If you find yourself saying, "I don't have time to do a prototype," consider this: the work of the prototype must be done prior to delivering the application. What people usually mean when they say they don't have time to do a prototype is that they want to do it while they're writing the code. This is analogous to designing a cabinet while you're building it.

In the second variety of Mistake No. 2, we do a prototype, but don't do it completely. We whoosh through the process, putting up "sample" pages; we start coding before we know exactly what the content will be - in short, we don't have a true prototype.

But all of those details must be decided at some point in the process. My advice on this is the same I gave myself when I wanted to rush to assemble a cabinet: do it right. Understand that much of the value in prototyping comes from creating a context in which the inherent messiness of finding out what the client wants can work itself out.

If you do the prototype right, you'll find out about key people who weren't in the initial meetings (despite your insistence and the client's assurance that all key decision makers were present). You'll allow the office politics to work themselves out on your prototype - not your code. Finally, you'll arrive at a prototype that both you and your client can agree is exactly what the finished product should look like. Then you can start coding.

How long should a prototype take? Of course, this depends on the application, but I find that almost universally, developers tend to cut the prototype short; the desire to start coding is great. In looking back at jobs I've done, I usually find that the wireframe/prototype phases take up as much as 60% of the entire job. I'm tempted to say that the longer a prototype takes, the greater the chances for project success. Certainly, I've never found myself in a "post mortem" saying, "Gee, I wish we hadn't spent so much time on the prototype."

3.   Not establishing acceptance tests up front
It's easy to start coding and - like assembling my woodworking project - it's fun. But when do you stop coding? When is "done" done? If you don't establish this up front, you're likely to find yourself forever chasing a moving goal line.

Did you build the application for a single machine, later to learn that the numbers of users would require a cluster? Did the client assure you they were going to use SQL Server, only to later (and without telling you) decide to adopt Oracle for all corporate projects? Did the client forget to tell you that the application must handle 5,000 transactions per second?

I've made some of these mistakes, so I can tell you that it is definitely not fun to try to convince your clients (after the fact) that no, this had not been discussed beforehand and that no, the application was not built for this. Make expectations clear: put them into the project documents right after you freeze the prototype. Determine the environment in which you run your acceptance tests and make sure that you have access to that environment while coding.

4.   Not using unit-testing code
Now I realize your code is flawless - a model by which to guide less-experienced coders. Mine too. But we do have to work in teams with other coders and those coders - well, they do make mistakes, don't they? If you don't unit-test code, you're going to find the flaws when you begin to assemble the project. At that point, finding out where the flaws occur is the old needle-in-the-haystack problem. Again, not fun.

Unit-testing code doesn't need to be difficult. I recommend building a simple test harness that creates an environment in which an individual fuse can run. This might include setting variables needed by the fuse, establishing state management, etc.

Your Fusedoc provides you with all the information you need to build a test harness, and I recommend building them and using them to test every fuse you write. These test harnesses can be saved and run at any point. This can be a great confidence booster when you're deeply into a critical project and could use a little encouragement. Oh, and since we don't want to make those other coders - the ones who make all the mistakes - feel bad, we might as well test our own code, too.

5.   Waiting too late to integrate unit-tested code
This mistake is easy to make. There's so much to do while involved in a project - especially a large project - that it's easy to defer integrating the unit-tested code until very late in the project.

I recommend that, if you aren't already doing this, you try having regularly scheduled project "builds," where you integrate all of the code. Typically, after I've identified the fuses and written Fusedocs, I create a simple stub that says something like, "I'm home.main and I'm not implemented yet." With this, I can do a project build from the first day. Now, granted, it doesn't do much, but it does give me a framework for integrating working, tested fuses. I can build the project at regular intervals.

Daily builds are great confidence boosters. They also serve to alert us to areas where problems may arise. It's become something of a joke that on any project, the first 90% of the project is done in three months, while the remaining 10% takes another three months. Or six.

The problem, of course, is that we were never 90% done. We developers are nothing if not optimists. Daily builds are also helpful when working in team environments. Rather than trying to get a teammate to commit to a deadline, why not just use daily builds to see exactly how far along the project is.

The rule I use is that all completed fuses are checked in by midafternoon. Another rule is that only one fuse is worked on at a time. This means that at any given point, I should be able to see how the project is doing. If someone needs help, it becomes clear at an early stage and saves recrimination and blame later on.

The best way to ensure project success is to know exactly where we are. Then we can make needed changes and the project can get back on track. Depending on who your client is, you may want to give them access to a daily build site. This can alleviate a good deal of client nervousness. After all, they have reason to fear if their project fails (as most do) and a partnership approach can make you both successful.

6.   Starting at the database
If omitting the prototype is the most serious mistake we can make, starting a project at the database is probably the most common. "Let's get started on the database schema," someone will say, and others readily go along. It seems to make such good sense. Besides, it's something we can do that feels concrete; we can show our managers the progress we're making.

I suggest that a better approach is to begin by identifying the conceptual components of your application. If, for example, you're dealing with a document management system, your conceptual components probably include a "Document" and an "Author." These exist quite independently of any database. In fact, a database exists only to provide a physical storehouse for these conceptual components. Beginning with a database is truly putting the cart before the horse.

Once you've identified your conceptual components, determine the various properties for each component. If, for example, my application has the concept of an "employee," I might identify its properties as employeeID, firstName, lastName, dateOfHire and so forth.

Part of writing good code is writing clear code. If you're taking your cue from the database - especially if your company has database naming standards - then you're likely to end up with variable names in your code like PRO_CDR_RTN. What does that stand for? Who knows? And once you find out, who will remember in six months?

Instead, you decide what your variables should be named. Make them clear so that in six months, you, or whoever is working on your code, will be able to tell the nature of the variable from its name. Then you can alias the actual database names so that they come from the database with the name that you want.

It's not just a matter of naming schemes. Beginning with a database creates a needless dependency. Coding can't begin until all the database issues are resolved. But in a complex application, this can take weeks or months. Do you want to wait this long to write your code? I sure don't.

You'll want to write code to work with the eventual database record set, of course. One of the great things about relational databases is that they always return tables (or relations in relational database lingo). What starts off as a seven-table many-to-many join gets resolved down to a simple record set. That means that you can use an artificially created record set and work with it while you're writing code. Later, you can swap out the artificial for the real thing. Your code won't break and it won't have to be rewritten.

I wrote a custom tag called QuerySim.cfm to help with this. You can download it at www.halhelms.com.

7.   Not using a standard
But wait - if we're using Fusebox, we're using a standard. How can this mistake apply to us? Surprisingly often; otherwise smart people recommend to others the practice of "adapting" a standard such as Fusebox. While the desire to put one's own stamp on something is understandable, it's often a mistake.

One of the great things about standards is that they are, well, standards. Having an "almost standard" won't help much when you run into problems and need help either debugging or finishing code for a project. And unless you want to be stuck forever maintaining code you've written, you'll want to write to a standard so that others can pick up what you've done quickly and easily.

Standards are especially important if you're working on a team. One of Eli Whitney's great contributions to the world was his demonstration that standardized parts could allow products to be built cheaper, faster, and better than the old practice of each person doing their own thing. Whitney was a genius; his advice is as true of coding as it is of manufacturing.

8.   Not using projects to learn new technology
You've noticed that technology is whizzing past you? Why not use your projects to help both you and your company by increasing your knowledge? Now, far be it for me to discourage anyone from going to training classes (since I offer them!), but I do encourage you to also use the project you're working on to do some experimenting. I'm not suggesting that you turn your project into a science project, but rather select a very specific and relatively small technology (or a small portion of a large technology) to play with. Besides, have you noticed that companies tend to send their best people off to training - people who have taken initiative and actively seek out learning experiences?

For example, you might decide to experiment with XML on a project. ColdFusion has some wonderful tags and functions that make this process fast and painless. Or you might decide to try implementing the Model-View-Controller design pattern on your application (or a small part of it). (I've written about the MVC design pattern on my site, www.halhelms.com.) If you're using a good methodology like FliP, you'll have time to do this without endangering the project at all.

A friend remarked to me recently that "the difference between a programmer and a plumber is the programmer's knowledge." If you don't invest in yourself - in your knowledge - you're likely to find yourself without current skills, putting both you and your company in jeopardy. So be strategic: select a specific area that won't consume an inordinate amount of time and go to school on it!

9.   Fixing problems
We've all done this one: pressure on, little time left, deadline looming, and we have a bug. What do you do? Why, reach for the can of Lucky Brand Magic Fixit Powder, of course. This may take the shape of finding someone who you think may know more than you, shipping off all of the code for the entire project with an accompanying e-mail that goes something like this: "My code isn't working. Please help! I've got a presentation in two hours!!! TIA"

Or you might find yourself commenting out variables that are giving you problems, or adding in variables just to make the code "work." Believe me, I am sympathetic. I know the frustration and panic that such a situation causes. But the solution is not reaching for the Magic Fixit Powder. Once simple syntax errors are resolved, you're not dealing with a bug. Instead, you're getting valuable feedback telling you that your understanding of the logic of your program is incomplete. That's all. The solution, therefore, is to gain a complete understanding.

How? Well, one thing I recommend without fail is to use Fusedocs to document your code. You can easily see what variables are supposed to be entering and exiting your code. Are they doing what they're supposed to? Use test harnesses to ensure that what you think is happening really is. You can set self to the value of a page that simply calls Dan Switzer's wonderful Debug.cfm custom tag (www.pengoworks.com <http://www.pengoworks.com>), which will give you lots of information about the state of your application.

The important thing to realize is that you're in a situation that is not a singular occurrence. For as long as you're programming, you're going to be dealing with code that doesn't do quite what you expected it to, so craft a long-term strategy. Isolate the problem, use snippets of code running in a test directory to make sure that each individual piece of your code works. The downside of this advice is that you are likely to end up getting those e-mails thanking you in advance for "fixing" someone else's problem!

10.   Not asking for help
Wait a minute. I just told you not to rely on others to save you. Now I'm saying that one of the deadly mistakes that Fuseboxers make is not asking for help? Well yes, that is what I'm saying. Do your homework, for sure. Isolate the problem so that you know exactly where the problem is occurring, but if you still can't figure out where the problem is, ask for help.

Innumerable times, I've found that printing out the code in order to go over it with someone else reveals the problem quickly. I know someone who has a stuffed animal on their monitor that they talk with when running into problems. The point is to break a mental logjam by changing the environment.

Programming, sadly, is often a culture of one-upmanship, where lack of knowledge is a sign of weakness and revealing any weakness is seen as shameful. That's bunk. Our job is to produce a successful software deployment, not to prove to someone that we're like Al Franken's character, Stuart Smally, who needed constant self-assurance that he was "smart enough, good enough, and - doggone it - people like me."

Like the ColdFusion community, where Fusebox had its start, one of the great things about the Fusebox community is its collegiality and closeness. The forums on the fusebox.org site offer assistance from people who are more than willing to help. Lists like cf-talk at Michael and Judith Dinowitz's houseoffusion.com are invaluable. I write an occasional newsletter that deals with software engineering issues. (Sign up at halhelms.com.)

Well, that ends our tour of "10 Deadly Mistakes." If you've got any others you'd like to share, send me an e-mail at ha[email protected].

More Stories By Hal Helms

Hal Helms is a well-known speaker/writer/strategist on software development issues. He holds training sessions on Java, ColdFusion, and software development processes. He authors a popular monthly newsletter series. For more information, contact him at hal (at) halhelms.com or see his website, www.halhelms.com.

Comments (0)

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.

IoT & Smart Cities Stories
The challenges of aggregating data from consumer-oriented devices, such as wearable technologies and smart thermostats, are fairly well-understood. However, there are a new set of challenges for IoT devices that generate megabytes or gigabytes of data per second. Certainly, the infrastructure will have to change, as those volumes of data will likely overwhelm the available bandwidth for aggregating the data into a central repository. Ochandarena discusses a whole new way to think about your next...
Dynatrace is an application performance management software company with products for the information technology departments and digital business owners of medium and large businesses. Building the Future of Monitoring with Artificial Intelligence. Today we can collect lots and lots of performance data. We build beautiful dashboards and even have fancy query languages to access and transform the data. Still performance data is a secret language only a couple of people understand. The more busine...
DXWorldEXPO LLC announced today that Big Data Federation to Exhibit at the 22nd International CloudEXPO, colocated with DevOpsSUMMIT and DXWorldEXPO, November 12-13, 2018 in New York City. Big Data Federation, Inc. develops and applies artificial intelligence to predict financial and economic events that matter. The company uncovers patterns and precise drivers of performance and outcomes with the aid of machine-learning algorithms, big data, and fundamental analysis. Their products are deployed...
All in Mobile is a place where we continually maximize their impact by fostering understanding, empathy, insights, creativity and joy. They believe that a truly useful and desirable mobile app doesn't need the brightest idea or the most advanced technology. A great product begins with understanding people. It's easy to think that customers will love your app, but can you justify it? They make sure your final app is something that users truly want and need. The only way to do this is by ...
CloudEXPO | DevOpsSUMMIT | DXWorldEXPO are the world's most influential, independent events where Cloud Computing was coined and where technology buyers and vendors meet to experience and discuss the big picture of Digital Transformation and all of the strategies, tactics, and tools they need to realize their goals. Sponsors of DXWorldEXPO | CloudEXPO benefit from unmatched branding, profile building and lead generation opportunities.
Digital Transformation and Disruption, Amazon Style - What You Can Learn. Chris Kocher is a co-founder of Grey Heron, a management and strategic marketing consulting firm. He has 25+ years in both strategic and hands-on operating experience helping executives and investors build revenues and shareholder value. He has consulted with over 130 companies on innovating with new business models, product strategies and monetization. Chris has held management positions at HP and Symantec in addition to ...
Cell networks have the advantage of long-range communications, reaching an estimated 90% of the world. But cell networks such as 2G, 3G and LTE consume lots of power and were designed for connecting people. They are not optimized for low- or battery-powered devices or for IoT applications with infrequently transmitted data. Cell IoT modules that support narrow-band IoT and 4G cell networks will enable cell connectivity, device management, and app enablement for low-power wide-area network IoT. B...
The hierarchical architecture that distributes "compute" within the network specially at the edge can enable new services by harnessing emerging technologies. But Edge-Compute comes at increased cost that needs to be managed and potentially augmented by creative architecture solutions as there will always a catching-up with the capacity demands. Processing power in smartphones has enhanced YoY and there is increasingly spare compute capacity that can be potentially pooled. Uber has successfully ...
SYS-CON Events announced today that CrowdReviews.com has been named “Media Sponsor” of SYS-CON's 22nd International Cloud Expo, which will take place on June 5–7, 2018, at the Javits Center in New York City, NY. CrowdReviews.com is a transparent online platform for determining which products and services are the best based on the opinion of the crowd. The crowd consists of Internet users that have experienced products and services first-hand and have an interest in letting other potential buye...
When talking IoT we often focus on the devices, the sensors, the hardware itself. The new smart appliances, the new smart or self-driving cars (which are amalgamations of many ‘things'). When we are looking at the world of IoT, we should take a step back, look at the big picture. What value are these devices providing. IoT is not about the devices, its about the data consumed and generated. The devices are tools, mechanisms, conduits. This paper discusses the considerations when dealing with the...