# Best Practices and Recommendations

# Titanium best practices

Though both Titanium and JavaScript are highly flexible, we have found that certain approaches lead to better outcomes. As a guide, we look for techniques that achieve these goals:

  1. Stable – applications must be stable when published and available to the market.

  2. Rapid – applications must be rapid to develop, maintain, and update.

  3. Performant – applications must perform optimally, approaching 1:1 native speed on targeted devices.

  4. Readable – applications must have a readable codebase for quick understanding, modification, and improvement.

# Does best-practice really mean only-practice?

In the general sense, no. However, the contents of this guide are distilled from the experience and practices of Appcelerator's Professional Services engineers with input from the Engineering department, Developer Relations team, Training department, and of course our many supportive customers.

# Chapters

Coding Best Practices

In this section, we'll lay our cards on the table and describe what we've come to believe is the best way to build a Titanium applications. (There's good stuff in the other chapters. So at least circle back to them when you're done here.)

CommonJS Modules in Titanium

This is a big enough topic that we'll give it its very own section. Learn how to write and use CommonJS modules here.

Application Frameworks

In this topic, we'll share techniques for implementing large-scale Titanium apps as well as techniques for separating presentation and content (and business logic).

Image Best Practices

In this section, we'll share some wisdom about how to handle images, including caching remote images, loading and unloading to minimize memory usage, and optimizing images with tools like pngcrush.

Database Best Practices

In this section, we'll cover techniques for maximizing performance and handling app updates.

Style and Conventions

In this section, we'll examine the Appcelerator preferences for coding style, including naming conventions, code formatting, and commenting. We'll also cover our recommendations for organizing the assets that comprise your project.

# Further reading

Coding Best Practices