|By Ben Forta||
|November 11, 2003 10:57 AM EST||
It's been about seven years since I first inscribed my "10 Commandments of ColdFusion Development" for my first ColdFusion book, and four years since they were last revised (yes, my Ten Commandments are not as omnipresent as their more famous namesake). ColdFusion has changed much over this time, as have the applications we're building and how we build them. And so this month, in honor of MAX, I present to you "The Newer and Even More Improved Ten Commandments of ColdFusion Development," or to adhere to Macromedia nomenclature, "The Ten Commandments 2004."
Have a Plan
We've all done it, and probably more than once. ColdFusion makes it so easy to start coding that there is often the temptation to start projects by firing up an editor and creating CFM files. That's a bad thing indeed. Nothing is more harmful to your development efforts than failing to plan properly, and you should be spending more time planning than coding, not less.
Planning involves thinking through every aspect of your application, from database design to UI considerations, from resource management to schedules and deliverables, and from feature lists with implementation details to language and presentation. You'd never build a house without detailed blueprints (well, you might try, but you'd never get the necessary permission to begin work), and building an application is no different.
I am constantly amazed by the number of applications that I am asked to look at that have no supporting documentation. And not just small development shops - I'm talking about some of the largest and most respected corporations too. Scalability problems? I wouldn't doubt it. I'd actually be amazed if such an app ever did scale. You cannot expect an application that grew to scale in spite of its developers. Nor can you expect it to be bug-free, manageable, or delivered on time.
Of course, some clients just want the job done. Competition may require that you cut corners or lose the deal, and planning always seems like the logical place to cut. So what to do? You may opt to do as requested, recognizing that you'll probably end up with a dissatisfied client, and will thus be creating more work for yourself (or someone else) in the long term. Or you may opt to walk away (idealistic, and perhaps not always realistic). It's a tough call, but whatever you do, make sure that the client is fully aware of the implications of the demands and decisions made (and be sure to get clients to sign off on exactly what they want so as to protect yourself in the future).
Organize Your Application
An extension of planning your application is organizing it (along with any other applications). Applications are made up of lots of little bits and pieces, and keeping them organized is imperative.
This includes directory structures and determining where common files should go, moving images to their own directory (or server), breaking long files into smaller, more manageable (and more reusable) ones, and even ensuring consistent organization among different applications.
The intent here is to make it easier for you (and the lucky soul who inherits the project) to locate code, isolate problems, reuse development, be able to replace or update components without risking breaking things...you get the idea. Understanding application design should not require perusing extensive code listings to understand code blocks and their relationship to each other; application organization must be logical and clear and ideally intuitive too. Going back to the prior Commandment, "Have a Plan," all organization should be documented in detail as part of that plan.
Set Coding Standards
This is an interesting one, and one I get asked about often. Macromedia has not published formal recommendations on coding standards, nor in my opinion should they. Macromedia's job is to create killer tools and products for us developers; our job is to use them as works best for us. I don't believe that a single set of coding standards would work for all developers, but at the same time, I don't believe any developer should be writing code that does not adhere to a standard - any standard.
Coding standards include everything from file- and directory-naming conventions, to variable naming conventions, to code organization and ordering within your source code, to error-handling, to componentization, and much more. (For example, if all variables that tain dates begin with "dt", then references to a variable named "dtOrderDate" become very selfexplanatory.)
The purpose of coding standards is to ensure some level of consistency in your code. Whether it is to allow other developers to be able to understand and work with your code, or whether it is simply so that you'll know what the heck you did (and why) six months down the line, coding standards provide a mechanism to create code that describes and explains itself.
There is no right or wrong coding standard as long as it is used. The only thing wrong about coding standards is not using one. (Note: To get you started, you may want to take a look at Sean Corfield's Coding Guidelines at www.corfield.org/coldfusion/coding_standards/.)
An extension of this is the use of application methodologies and architectures. The purpose of these is to encourage good design and the use of best practices. I am not going to comment on the virtues or failings of specific methodologies or architectures; there is no right or wrong here either.
Don't be swayed by hype and trends and acronyms. What is right for someone else may not be right for you, and what is right for one of your applications may not be right for all your applications. Any architecture should help you write better code. If you find one that works for you, great; if not, come up with something yourself, or adapt something you find. Either way, just do it.
Comment Your Code
This is an obvious one, but apparently few of us have the time to pay attention to the obvious. So, I'll say it once again, all code must be commented. (For the record, I'd fire an employee on the spot for turning in code that is not commented, that's how serious a sin I believe this one to be.)
Every source code file needs a descriptive header containing a description, the author info, creation date, chronological list of changes, any dependencies and assumptions, and any other relevant information. In addition, every conditional statement, every loop, every set of variable assignments, and every include or component reference must be commented with a simple statement explaining what is being done, and why.
It's a pain, I know. But the next time you (or anyone else) has to work with the code you'll appreciate the effort immeasurably. And you might even be able to safely make code changes without breaking things in the process.
Functionality First, Then Features
Yet another obvious one, and a common beginner's mistake. Yes, creating whiz-bang UI effects may be far more fun that writing business rules and dataentry validation routines, but the latter are far more important to the success of your application. Concentrate on creating a complete working application, then pretty it up as needed.
But at the same time, don't neglect the user experience. Some of the best applications ever created failed (and continue to fail) because they were a pain to use. While it is a mistake to start with menus and color choices and application screen flow, it is an even bigger mistake to fail to leave adequate time for these.
It's about sequencing and balancing. Do so and increase the chance that you'll finish on schedule for a change. The final result might not be as cool as you'd like, but there is something to be said for an application that actually works, even an uncool looking one. Furthermore, (as explained in the next Commandment) it is very difficult to debug logic problems when the code is cluttered with fancy formatting and features.
Build and Test Incrementally
You'd be amazed (or maybe you wouldn't be) by the number of e-mail messages I get asking me to help debug attached files - attached files with hundreds of lines of code, often more, and often multiple files all needed to make the application work. My standard response to these messages is "Yes, I'll help you debug your code, but first narrow it down to just the few lines in question." Not surprisingly, many developers find that the process of narrowing down the problems allows them to diagnose their code themselves.
Being sent the messages and requests isn't what bothers me (I know I am going to regret saying this, but I really do not mind those at all). What really bothers me is that what becomes apparent is that core code was never tested in isolation. This goes back to the prior Commandment, "Functionality First, Then Features." And the same is true for testing.
When you develop core components of your application, test them. Write little test routines, hard code, or smoke and mirrors as necessary, but however you do it, do it. Obviously you'll have to test your complete application when done, and some problems won't come to light until then, but the more you can test code blocks in isolation, the better.
Never Reinvent the Wheel, and Plan Not To
This is one I have written about extensively, especially in this column. Write code with reuse in mind, and reuse code whenever possible. When designing your code, put the extra time in up front to make sure it is not hard-coded or highly task-specific unless it absolutely has to be. Make sure code can stand on its own two feet whenever possible, never make unnecessary assumptions about where code is being used and how, and never reference explicit scopes or variables outside of your own code.
The benefits? Being able to reuse existing code will shorten your development time. You'll also stand a far greater chance of creating bug-free code when you use components that have already been used and tested. Plus, if you do make subsequent fixes and corrections, all code that uses the improved components benefit.
ColdFusion developers have lots of reuse options, and should pay particular attention to ColdFusion Components (introduced in detail in a two-part column in CFDJ, Volume 4, issues 6 and 7), which both help and encourage tiered application design (see CFDJ, Volume 3, issue 8, and Volume 4, issue 10), code reuse, and all-around better coding.
Lots of benefits, and no downside whatsoever. Should be a no-brainer. Enough said.
Use All the Tools at Your Disposal, Not Just ColdFusion
This is an extension of the previous commandment, and another one I have written about before (see CFDJ, Volume 1, issue 3, "Take Your Database Out of Retirement," and CFDJ, Volume 2, issue 3, "When NOT to Use ColdFusion"). Unlike all the other Commandments in this list, this one is more ColdFusion specific.
ColdFusion applications are usually not standalone entities. They rely on database servers, mail servers, and much more. In addition, ColdFusion can leverage Java, Web services, COM, CORBA, and C/C++ code. Use these tools, as many as needed, and always attempt to pick the best one for a specific job. The best ColdFusion applications are not the ones written purely in ColdFusion, but the ones that leverage the best technologies for the job, all held together by ColdFusion. And the worst ColdFusion applications are the ones that try to go it solo.
The truth is, even beyond your ColdFusion application development, if you are serious about application development and a future in this industry, then it's in your best interest to not be a one-trick pony. Diversifying your skills will make you a better and more valuable developer, and will also improve your ColdFusion applications in the short term.
Respect (and Fear) Production Servers
There are two very different aspects to this one.
The first is obvious, or so you'd think. But any time I bring this up in front of a group of CF developers, the grins, sheepish looks, and knowing glances convince me that there are transgressors in our midst.
All development and testing must occur on servers established for just that purpose. Yes, this means you'll need additional hardware or the installation of ColdFusion Enterprise (so as to have multiple instances of ColdFusion to work with), but the extra cost is nothing compared to the cost of bringing down your application because that little change was not as little as you expected.
Write your code, test it, debug it as needed, deploy it to a testing server, test it some more and some more, and then finally, deploy it to your live production server. And don't repeat this process too often. Instead of uploading slightly changed versions of your application every day, collect the changes, test them some more, and deploy them monthly or weekly, or whenever works best for you.
That's the respect part. As for fear, production servers are vulnerable, they are necessarily publicly visible, and they are necessarily used and accessed by all sorts of people (including many of whom you may otherwise choose to have nothing to do with).
A little paranoia is healthy when it comes to public-facing servers. Assume that your server will be compromised, and that whatever is on it (and whatever it has access to) will be stolen or tampered with at some point. This has very practical implications - from never embedding passwords in source code, to not keeping databases on your Web server, to not using accounts with access to lots of other resources.
I'll state it again, just to be perfectly clear about this: anything that is on your server, and anything that your server has access to, will be stolen or compromised at some point. Be frightened, be very frightened. And once you have come to grips with your fear, be mindful and cautious.
The key here is that your production server is sacred. Don't touch it at all unless you have to (and the less frequently the better), and never, ever, make changes on it, even minor ones. In addition, don't leave your valuables exposed, or put differently, put nothing on your server that you'd not want in the hands of others.
Keep Things Simple
Simplicity is a good thing, complexity usually isn't. This affects everything from user interfaces to database schemas to documentation to application architecture. Keep it simple. This has obvious implications for user interfaces, application flow, data-entry screens, and error messages. But it goes way beyond these too.
At the risk of upsetting hardcore extremists, this is even true of application architecture and methodologies. I have seen relatively simple apps (apps that should have taken days to develop) turn into behemoth projects because of an insistence that everything be an MVC application. Not that I have anything against MVC, but we don't live in a one-size-fits-all world. If a simpler design is effective, that may be good enough.
Similarly, while it would be wonderful to be able to clearly articulate a blackand- white distinction of what should be written in ColdFusion and what should be written in Java, the reality is that there are shades of gray. Sometimes the less pure solution may be the simpler one. There is no right or wrong here, but there is a lot to be said for simplicity.
There you have it - my new, and greatly improved, Ten Commandments of ColdFusion Development. Of course, you may completely disagree with my list, in which case I'd love to hear what you'd change, and why.
Good luck with your coding, and I look forward to meeting you in person at MAX in Salt Lake City, UT (November 18-21).
SYS-CON Events announced today that Site24x7, the cloud infrastructure monitoring service, will exhibit at SYS-CON's 16th International Cloud Expo®, which will take place on June 9-11, 2015, at the Javits Center in New York City, NY. Site24x7 is a cloud infrastructure monitoring service that helps monitor the uptime and performance of websites, online applications, servers, mobile websites and custom APIs. The monitoring is done from 50+ locations across the world and from various wireless carriers, thus providing a global perspective of the end-user experience. Site24x7 supports monitoring H...
Apr. 19, 2015 02:30 AM EDT Reads: 1,819
SYS-CON Events announced today that Intelligent Systems Services will exhibit at SYS-CON's 16th International Cloud Expo®, which will take place on June 9-11, 2015, at the Javits Center in New York City, NY. Established in 1994, Intelligent Systems Services Inc. is located near Washington, DC, with representatives and partners nationwide. ISS’s well-established track record is based on the continuous pursuit of excellence in designing, implementing and supporting nationwide clients’ mission-critical systems. ISS has completed many successful projects in Healthcare, Commercial, Manufacturing, ...
Apr. 19, 2015 02:15 AM EDT Reads: 2,385
The IoT Bootcamp is coming to Cloud Expo | @ThingsExpo on June 9-10 at the Javits Center in New York. Instructor. Registration is now available at http://iotbootcamp.sys-con.com/ Instructor Janakiram MSV previously taught the famously successful Multi-Cloud Bootcamp at Cloud Expo | @ThingsExpo in November in Santa Clara. Now he is expanding the focus to Janakiram is the founder and CTO of Get Cloud Ready Consulting, a niche Cloud Migration and Cloud Operations firm that recently got acquired by Aditi Technologies. He is a Microsoft Regional Director for Hyderabad, India, and one of the f...
Apr. 19, 2015 02:00 AM EDT Reads: 992
SYS-CON Events announced today that B2Cloud, a provider of enterprise resource planning software, will exhibit at SYS-CON's 16th International Cloud Expo®, which will take place on June 9-11, 2015, at the Javits Center in New York City, NY. B2cloud develops the software you need. They have the ideal tools to help you work with your clients. B2Cloud’s main solutions include AGIS – ERP, CLOHC, AGIS – Invoice, and IZUM
Apr. 19, 2015 02:00 AM EDT Reads: 3,139
SYS-CON Events announced today that Tufin, the market-leading provider of Security Policy Orchestration Solutions, will exhibit at SYS-CON's 16th International Cloud Expo®, which will take place on June 9-11, 2015, at the Javits Center in New York City, NY. As the market leader of Security Policy Orchestration, Tufin automates and accelerates network configuration changes while maintaining security and compliance. Tufin's award-winning Orchestration Suite™ gives IT organizations the power and agility to enforce security policy across complex, multi-vendor enterprise networks. With more than 1...
Apr. 19, 2015 01:45 AM EDT Reads: 3,300
VoxImplant has announced full WebRTC support in the newest versions of its Android SDK and iOS SDK. The updated SDKs, which enable audio and video calls on mobile devices, are now compatible with the WebRTC standard to allow any mobile app to communicate with WebRTC-enabled browsers, including Google Chrome, Mozilla Firefox, Opera, and, when available, Microsoft Spartan. The WebRTC-updated SDKs represent VoxImplant's continued leadership in simplifying the development of real-time communications (RTC) services for app developers. VoxImplant (built by Zingaya, the real-time communication servi...
Apr. 19, 2015 01:45 AM EDT Reads: 1,817
SYS-CON Events announced today that kintone has been named “Bronze Sponsor” of SYS-CON's 16th International Cloud Expo®, which will take place on June 9-11, 2015, at the Javits Center in New York City, NY, and the 17th International Cloud Expo®, which will take place on November 3–5, 2015, at the Santa Clara Convention Center in Santa Clara, CA. kintone promotes cloud-based workgroup productivity, transparency and profitability with a seamless collaboration space, build your own business application (BYOA) platform, and workflow automation system.
Apr. 19, 2015 01:00 AM EDT Reads: 1,497
SYS-CON Events announced today that Cloudian, Inc., the leading provider of hybrid cloud storage solutions, will exhibit at SYS-CON's 16th International Cloud Expo®, which will take place on June 9-11, 2015, at the Javits Center in New York City, NY. Cloudian, Inc., is a Foster City, California - based software company specializing in cloud storage software. The main product is Cloudian, an Amazon S3-compliant cloud object storage platform, the bedrock of cloud computing systems, that enables cloud service providers and enterprises to build reliable, affordable and scalable cloud storage solu...
Apr. 19, 2015 01:00 AM EDT Reads: 2,376
SYS-CON Events announced today that Gridstore™, the leader in hyper-converged infrastructure purpose-built to optimize Microsoft workloads, will exhibit at SYS-CON's 16th International Cloud Expo®, which will take place on June 9-11, 2015, at the Javits Center in New York City, NY. Gridstore™ is the leader in hyper-converged infrastructure purpose-built for Microsoft workloads and designed to accelerate applications in virtualized environments. Gridstore’s hyper-converged infrastructure is the industry’s first all flash version of HyperConverged Appliances that include both compute and storag...
Apr. 19, 2015 12:45 AM EDT Reads: 4,245
SYS-CON Events announced today that IDenticard will exhibit at SYS-CON's 16th International Cloud Expo®, which will take place on June 9-11, 2015, at the Javits Center in New York City, NY. IDenticard™ is the security division of Brady Corp (NYSE: BRC), a $1.5 billion manufacturer of identification products. We have small-company values with the strength and stability of a major corporation. IDenticard offers local sales, support and service to our customers across the United States and Canada. Our partner network encompasses some 300 of the world's leading systems integrators and security s...
Apr. 19, 2015 12:00 AM EDT Reads: 4,922
SYS-CON Events announced today that SoftLayer, an IBM company, has been named “Gold Sponsor” of SYS-CON's 16th International Cloud Expo®, which will take place June 9-11, 2015 at the Javits Center in New York City, NY, and the 17th International Cloud Expo®, which will take place November 3–5, 2015 at the Santa Clara Convention Center in Santa Clara, CA. SoftLayer operates a global cloud infrastructure platform built for Internet scale. With a global footprint of data centers and network points of presence, SoftLayer provides infrastructure as a service to leading-edge customers ranging from ...
Apr. 18, 2015 11:30 PM EDT Reads: 2,356
SYS-CON Events announced today that Cisco, the worldwide leader in IT that transforms how people connect, communicate and collaborate, has been named “Gold Sponsor” of SYS-CON's 16th International Cloud Expo®, which will take place on June 9-11, 2015, at the Javits Center in New York City, NY. Cisco makes amazing things happen by connecting the unconnected. Cisco has shaped the future of the Internet by becoming the worldwide leader in transforming how people connect, communicate and collaborate. Cisco and our partners are building the platform for the Internet of Everything by connecting the...
Apr. 18, 2015 11:15 PM EDT Reads: 5,602
SYS-CON Events announced today that Liaison Technologies, a leading provider of data management and integration cloud services and solutions, has been named "Silver Sponsor" of SYS-CON's 16th International Cloud Expo®, which will take place on June 9-11, 2015, at the Javits Center in New York, NY. Liaison Technologies is a recognized market leader in providing cloud-enabled data integration and data management solutions to break down complex information barriers, enabling enterprises to make smarter decisions, faster.
Apr. 18, 2015 11:00 PM EDT Reads: 3,670
SYS-CON Events announced today that Windstream, a leading provider of advanced network and cloud communications, has been named “Silver Sponsor” of SYS-CON's 16th International Cloud Expo®, which will take place on June 9–11, 2015, at the Javits Center in New York, NY. Windstream (Nasdaq: WIN), a FORTUNE 500 and S&P 500 company, is a leading provider of advanced network communications, including cloud computing and managed services, to businesses nationwide. The company also offers broadband, phone and digital TV services to consumers primarily in rural areas.
Apr. 18, 2015 10:45 PM EDT Reads: 4,828
SYS-CON Events announced today that Dyn, the worldwide leader in Internet Performance, will exhibit at SYS-CON's 16th International Cloud Expo®, which will take place on June 9-11, 2015, at the Javits Center in New York City, NY. Dyn is a cloud-based Internet Performance company. Dyn helps companies monitor, control, and optimize online infrastructure for an exceptional end-user experience. Through a world-class network and unrivaled, objective intelligence into Internet conditions, Dyn ensures traffic gets delivered faster, safer, and more reliably than ever.
Apr. 18, 2015 09:45 PM EDT Reads: 2,281
SYS-CON Events announced today that Open Data Centers (ODC), a carrier-neutral colocation provider, will exhibit at SYS-CON's 16th International Cloud Expo®, which will take place June 9-11, 2015, at the Javits Center in New York City, NY. Open Data Centers is a carrier-neutral data center operator in New Jersey and New York City offering alternative connectivity options for carriers, service providers and enterprise customers.
Apr. 18, 2015 09:30 PM EDT Reads: 2,495
SYS-CON Events announced today that On the Avenue Marketing Group, a sales and marketing firm that utilizes events to market and sell products to consumers, will exhibit at SYS-CON's 16th International Cloud Expo®, which will take place on June 9-11, 2015, at the Javits Center in New York City, NY. On the Avenue Marketing Group (OTA) is a sales and marketing firm that utilizes events to market and sell products to consumers. On behalf of our clients, we attend thousands of fairs, festivals, expos, concerts, conferences, and sporting events annually, helping them reach millions of individuals ...
Apr. 18, 2015 09:15 PM EDT Reads: 3,141
SYS-CON Events announced today that ActiveState, the leading independent Cloud Foundry and Docker-based PaaS provider, has been named “Silver Sponsor” of SYS-CON's DevOps Summit New York, which will take place June 9-11, 2015, at the Javits Center in New York City, NY. ActiveState believes that enterprises gain a competitive advantage when they are able to quickly create, deploy and efficiently manage software solutions that immediately create business value, but they face many challenges that prevent them from doing so. The Company is uniquely positioned to help address these challenges thro...
Apr. 18, 2015 09:00 PM EDT Reads: 2,734
SYS-CON Events announced today that Vitria Technology, Inc. will exhibit at SYS-CON’s @ThingsExpo, which will take place on June 9-11, 2015, at the Javits Center in New York City, NY. Vitria will showcase the company’s new IoT Analytics Platform through live demonstrations at booth #330. Vitria’s IoT Analytics Platform, fully integrated and powered by an operational intelligence engine, enables customers to rapidly build and operationalize advanced analytics to deliver timely business outcomes for use cases across the industrial, enterprise, and consumer segments.
Apr. 18, 2015 08:45 PM EDT Reads: 2,423
SYS-CON Events announced today that Alert Logic, the leading provider of Security-as-a-Service solutions for the cloud, has been named “Bronze Sponsor” of SYS-CON's 16th International Cloud Expo® and DevOps Summit 2015 New York, which will take place June 9-11, 2015, at the Javits Center in New York City, NY, and the 17th International Cloud Expo® and DevOps Summit 2015 Silicon Valley, which will take place November 3–5, 2015, at the Santa Clara Convention Center in Santa Clara, CA.
Apr. 18, 2015 08:30 PM EDT Reads: 1,759