|
©
8-16-02 Douglas A. Welton
- Product Name/Version: CodeWarrior 8
- OS X?: Yes
- Company: Metrowerks
- URL: http://www.metrowerks.com
- Category: Programming Tool
- Requirements:
Classic Mac OS
- Mac® OS 9.2.2 or greater
- PowerPC G3 or greater (no 68K
support)
- 64 MB RAM
- CarbonLib 1.5
- 350 MB Free hard disk space (minimal
install, 700 MB recommended)
- CD-ROM drive for installation
Mac OS X
- Mac® OS X v10.1.3
- PowerPC G3 or greater (G4 recommended)
- 128 MB RAM
- 350 MB Free hard disk space (minimal
install, 700 MB recommended)
- CD-ROM drive for installation
- Price: $599
- Rating: 3.5 bounces - not
quite Pure Lust
|
Ratings Legend
|
|
One Bounce: Lustless
|
This product is uninspiring and not only lacks lust
appeal, but it also lacks even the possibility of lust-production.
|
|
Two Bounces: Lack-Luster
|
If you need what it is that this product does, look
elsewhere or wait, it lacks lust-appeal.
|
|
Three Bounces: Lustworthy
|
A few rough spots here and there, but overall a high
quality item worthy of lust.
|
|
Four Bounces: Pure Lust
|
Unalloyed lust.
|
Recently, Metrowerks released version 8 of
their flagship product CodeWarrior Development
Tool for Mac OS. Throughout the 90’s,
CodeWarrior has been the definitive developers
toolset for building new Macintosh software
products and with version 8, Metrowerks again
provides an excellent tool to help Macintosh
developers bridge the gap as applications are
migrated from Classic Mac OS to Mac OS X.
What is CodeWarrior?
CodeWarrior is collection of tools referred
to as an Integrated Development Environment
or IDE. These tools work together to provide
everything a developer needs to build a software
product for Mac OS. Before I take a look at
what’s new in version 8, let’s take
a look at the general features of the product.
The Language
CodeWarrior 8 includes compilers to handle
source code for programs written in C, C++,
Objective-C and Java. In addition, modules written
using PowerPC Assembly Language can also be
compiled. Normally, these compilers are invoked
from within the IDE (after selecting Make from
the Project menu). However, the compilers may
also be invoked from the command line. This
technique is particularly useful if you are
migrating command-line-oriented build scripts
to the Mac OS environment.
The Integrated Development Environment
At the heart of the CodeWarrior 8 are four
tools that have come to define the modern IDE:
the Project Manager, A Multifunctional Editor,
the Build System, and the Debugger.
From a big picture point of view, the main
task of CodeWarrior is to convert “projects”
into software “products”. Projects
consists of the files and resources needed to
build the software products, as well as the
settings associated with the tools that transform
the source code into a final product.
The Project Manager handles high-level tasks
involving the files, settings, and resources
associated your project. For example, Figure
1 shows the dialog box displayed when you begin
a new project. The Project Manager will provide
a menu of project stationeries - each a skeleton
of software libraries, frameworks, and resources
needed to build a basic application of the selected
type.
 |
|
Figure
1: CodeWarrior New Project dialog
|
Once you have created your project, use the
Project Manager to add, remove and organize
files, perhaps grouping files based on their
relationship to one another. You may also set
various project attributes, such as the compilation
order, the destination folder for the final
product, and various application packaging attributes.
The Multifunctional Text Editor is perhaps the
most used tool within CodeWarrior. From the
editor you can create and modify source code
written in C, C++, Objective-C and/or Java.
Beyond being a “word processor for source
code,” the editor also provides additional
features such as syntax coloring (see Figure
2), file comparison, project-wide search and
replace, and convenient menus for navigating
within and across files.
 |
|
Figure 2: The Multifunctional
Editor
(Click to Enlarge)
|
Once a project has been created, the source
files and resources have been edited and organized,
then CodeWarrior’s Build System is used
to convert the source files into executables.
In principle, building software is rather simple:
compilers translate source code into object
modules, which are (in turn) bound by the linker
resulting in either a software application or
library. Unfortunately, the build process may
vary greatly from one operating system to another.
This is the exact circumstance many developers
find themselves - needing to deliver products
for Classic Mac OS, as well as Mac OS X.
CodeWarrior 8 handles software construction
for both Classic Mac OS and Mac OS X. The IDE
runs natively in both environments, providing
settings to configure the build process for
the specific target platform. Figure 3 illustrates
a platform-specific panel used to select the
Code Generation parameters for a project build.
 |
|
Figure 3: Project Build
Settings Panel
(Click to Enlarge)
|
The final tool at the heart of the CodeWarrior
8 IDE is the Debugger, which allows you to “pull
back the skin” and examine the internals
of a “living, breathing” application
while the program is actually running.
From the debugger (see Figure 4), you have
considerable control over the execution of the
program. Statements may be executed one-at-a-time
or execution can be set to stop at a certain
location or when certain conditions have been
met. Likewise, you may (in real time) examine
the contents of variables and arbitrary memory
locations.
 |
|
Figure 4: CodeWarrior
8 Debugger
(Click to Enlarge)
|
Other CodeWarrior Tools
Most of your software development time will
be spent using the four principle tools of the
IDE. However, CodeWarrior 8 has a number of
other tools that help make building new software
easier. A partial list of other tools include
the following:
- PowerPlant is an object-oriented
C++ class library and application framework
that facilitates rapid development of reliable
interfaces for your applications.
- Constructor is a visual interface
builder that provides an interactive graphical
interface to create and modify resources for
windows, controls, buttons, scroll bars, bitmaps,
text appearance, and menus. Constructor works
hand-in-hand with PowerPlant, supplying the
resources needed by a PowerPlant application
to create its visual interface.
- The Class Browsers allow you to inspect
the structure and content of objects within
your project. Additionally, the Hierarchy
Browser allows you to see the larger context
of how all the objects fit together within
the scheme of the entire project.
- The Metrowerks Code Profiler is a
code analysis tool that provides you with
a snapshot of the processor times required
by your program as control is passed to each
segment.
- ZoneRanger is a dynamic memory inspection
tool that allows you to see the when, what,
how, and where of memory allocation and usage
within their application. Note: ZoneRanger
has not been carbonized and does not run on
Mac OS X.
- The Java RAD Tools provide an environment
within the CodeWarrior 8 IDE for Java programmers
to quickly construct and manipulate visual
elements (i.e., components) of their application
and “wire” the relationships between
application components
What’s New in CodeWarrior 8?
CodeWarrior 8 brings a lot of new features
to the table. Some of these features are relatively
small, nice-to-have things that will only impact
a few developers. Other features are major and
impact how everyone uses the tools. My suggestion…
before you get started using the new version,
read through the release notes!
Having said that, here are some of the things
that I think are the best new features:
Mach-O Run-Time Architecture Support
One subtle difference between Classic Mac OS
and Mac OS X is the run-time architecture for
object libraries and executable files. The Classic
Mac OS architecture is based on the Code Fragment
Manager (CFM), and Mac OS X uses Mach-O, an
architecture descended from the operating system’s
BSD roots.
Unfortunately, getting these two formats to
“play together well” can be somewhat
of a challenge. In the past, Apple’s Developer
tools created only Mach-O objects, while CodeWarrior
only generated CFM-based executables. Developers
wanting to take advantage of existing Classic-based
libraries when building new Mac OS X applications
found themselves having to do a lot of “coding
voodoo” to glue the two architectures
together.
CodeWarrior 8 provides users with the option
to create both a Mach-O and/or a CFM-based project
from a single project. Two Linkers are provided
for building Mach-O projects:
- Apple Mach-O PowerPC is based on traditional
UNIX tools. Along with the standard Macho
formatted object, this linker generates STABS
debugging information that can be used when
debugging with gdb.
- Mac OS X PowerPC Macho is based on the previous
version of the Metrowerks Debugger. This linker
generates Macho formatted files, but instead
of STABS, it generates SYM debugging information.
The result is a debugger that performs much
better and is more responsive than previous
versions of the Metrowerks debugger that handled
Macho formatted files.
Selecting the appropriate Linker is a rather
simple process. Figure 5 illustrates how to
do it for the current project.
 |
|
Figure 5: Selecting
a Linker for Mac OS X
(Click to Enlarge)
|
Mac OS X Support!
Like all applications making the transition
from Classic Mac OS to Mac OS X, CodeWarrior
has had to adjust to a number of features in
the new OS that were “outside” the
original design of the product. Among the new
features that further CodeWarrior’s integration
with Mac OS X, these three stand out:
Application Packaging – On Classic
Mac OS, an application consisted of a single
file. Under Mac OS X, this is not the case.
Applications are now “a special type of
Bundle. Think of a Bundle as a directory, with
a structured hierarchy of executables, resources,
and other meta-data that can be copied, moved,
and otherwise manipulated as single entity.
In the Finder, a Bundle appears as a single
file. CodeWarrior provides new support for application
packaging via the project settings panels, as
well as the file mapping panel – which
specifies how resources are to be copied to
the resulting application bundle
Framework Support – Mac OS X provides
development Frameworks for various functional
subsystems and environments on Mac OS X. Each
framework contains an organized bundle of related
libraries, headers, and documentation. Now,
instead of including a collection of separate
libraries (often stored in several different
locations), the user can include a single framework.
CodeWarrior 8 contains a new tab (see Figure
6) on the Project Settings panel to make including
Frameworks easier. This feature will be particularly
handy for users building Cocoa applications.
 |
|
Figure 6: Adding Frameworks
to a Project
|
Long Filename Support – CodeWarrior
8 now supports filenames of length up to 255
characters!
Interface Builder Support
One of the best legacy applications from NeXTStep
to be incorporated in Mac OS X was the Interface
Builder (IB). Along with Project Builder (which
are very tightly integrated), IB facilitated
the rapid development of user application. IB
provides a vehicle to layout user interface
objects. IB also records the interactions between
those UI objects and other controller objects
within your code. This information is stored
in a NIB file – a “freeze-dried”
archive of application objects and their connections.
Previous versions of CodeWarrior didn’t
“play well” with NIB files (which
are stored as a bundle). The new IDE does a
much better job in working with Interface Builder.
First, NIB files can now be properly read and
included into projects. And second, CodeWarrior
has been “integrated” with Interface
Builder. This means that the IDE will now respond
to all messages and request from Interface Builder
in the same way that Project Builder responds
to those messages.
Property List Compiler
Mac OS X applications keep their resources
in separate file as a part of the bundle used
for application packaging. One of the most common
resource types is the Property List, an XML-based
description of application-required information.
CodeWarrior 8 includes a new Property List
Compiler, which uses a simple declarative language
to create property list. Compare the source
code for the CodeWarrior Property List Compiler
in Figure 7 to the equivalent XML shown in Figure
8
 |
|
Figure 7: Property List
Compiler Source Code
(Click to Enlarge)
|
 |
|
Figure 8: Property List
in XML Format
(Click to Enlarge)
|
Workspaces
The new IDE for CodeWarrior 8 introduces the
concept of "workspaces". A Workspace
is the group of projects and files you have
open at any particular time. When the user exits
the IDE, the current workspace will be saved.
The next time CodeWarrior is invoked, the last
workspace will be reopened. Workspaces also
remember the locations of each window. Workspaces
can be stored at any time. This is a handy feature
for users who repeatedly open the same projects
or those who have to switch between several
projects.
Debugger Enhancements
Besides the Editor, the CodeWarrior 8 component
where you will spend most of your time is the
Debugger. The Metrowerks debugger has been around
for a while and has seen a good deal of shakeout,
in relation to usability issues. However, the
transition to Mac OS X highlighted some shortcomings
that have been addressed in the current release.
First, with the inclusion of the Mac OS X PowerPC
Macho Linker, the Debugger now support debugging
of Macho executables using CodeWarrior’s
native (and more efficient) SYM debugging information.
Second, for users who may be using multiple
machines (perhaps with different operating systems)
Remote Debugging is now a more stable proposition.
However, for my money, Eventpoints are the
best new Debugger feature. Eventpoints are conditional
breakpoints that “do something.”
That is, execution of the program is not stopped,
but instead a user-specified action is performed.
Eventpoints come in five basic flavors:
- LogPoint - logs or speaks a string or expression;
records messages to the log window.
- PausePoint - pauses execution just long
enough to refresh debugger data.
- Script Point - runs a script, application,
or other item when it reaches the Eventpoint
in a line of code. The Eventpoint triggers
when execution reaches that line in the code.
- Skip Point- skips execution on a line of
source where you set an Eventpoint.
- Sound Point - plays a sound when the program
finds an Eventpoint.
Eventpoints allow you to automate the flexibility
you sometimes need when debugging a piece
of code.
Code Completion
An interesting enhancement to the IDE’s
editor is a new Code completion functionality.
As you type, you will be able to choose from
the current list of local variables, global
symbols, class and structure members, etc. What
is happening behind the scenes is that CodeWarrior
is dynamically building a table of symbols during
the idle time between your keystrokes.
This feature works best when CodeWarrior is
given plenty of information to use for suggested
completions. If you want to see results “magically”
appear after typing just a few lines, you may
be greatly disappointed.
Other Miscellaneous Enhancements
Several other features worth noting include
the following:
- File Compare has a better algorithm for
detecting differences between files which
may result in slower execution, but returns
more distinct differences.
- The CodeWarrior Profiler can now profile
Multiprocessor threads, if you use the MP
2.0 API to build your application.
- Third-party tools support provides users
with access to the latest Universal Headers
from Apple, and Mac OS X updates to third-party
tools such as WASTE and MoreFilesX.
- Preliminary support has been provided for
developers using IOKit.
...Not Everything Works As Planned :^(
Although CodeWarrior 8 offers an impressive
array of nifty new features, everything is not
quite perfect. Nothing is showstopper, but here
are a hand-full of “Gotchas” that
may impact your ability to use the full range
of functionality available to you.
- ZoneRanger on Mac OS X is dead. This should
be a surprise to no one. Dynamically monitoring
memory allocation and usage depends strongly
on the underlying run-time architecture. The
transition from CFM to Macho directly impacted
ZoneRanger. The workaround – use MallocDebug
in the Apple Developer Tools.
- Code Completion does not work with Objective-C
or C++ Templates. I expect that Metrowerks
will receive a large amount of feedback about
this feature.
- Cocoa developers who have been using the
Project Builder/Interface Builder combination
may find the integration of CodeWarrior and
Interface Builder less intuitive than what
they are used to. That was my reaction.
- Application Packaging Support was not intuitive
to me. The Copy-To-Package compiler makes
perfect sense in the tradition of CodeWarrior’s
file Mapping functionality, but somehow it
seems to be a red-head-stepchild of a solution
for managing the integration of bundle resources
(as opposed to Classic Mac OS resources).
- The CodeWarrior profiler does not handle
Objective-C.
All in All...
I like CodeWarrior 8.
I find the IDE well designed and highly intuitive
for building Mac OS software products. CodeWarrior’s
product maturity shows through in the polished
interface presented to the user. For developers
moving existing applications from Classic Mac
OS to Mac OS X, CodeWarrior 8 is an essential
tool. For new developers, using the Mac OS X
Carbon environment, CodeWarrior 8 may be the
best place to start. For Cocoa and Java developers,
I suggest that you try CodeWarrior. IDE’s
are like religions and people change them both
with equal frequency.
- Douglas
A. Welton
What do you think? Talk about it in our Forums...
[an error occurred while processing this directive]
|