Customization the Highlight of CBuilderX Release

原创 2003年12月02日 21:56:00

Customization the Highlight of CBuilderX Release
 
New C++ IDE from Borland builds on the efficiency of its predecessor, but existing Builder users should be prepared for some glitches in the learning curve. 

advertisement
CSDN_Dev_Image_2003-11-301823523 CSDN_Dev_Image_2003-11-301823525
CSDN_Dev_Image_2003-11-301823527.gifive years ago, I reviewed Borland's C++ Builder 4.0 and I was so impressed with it that I have used it as my C++ IDE ever since! So I jumped at the chance to review this latest release. C++ BuilderX is a multiplatform IDE for building C++ applications that can be deployed on various target platforms: Windows, Solaris, Linux, and Symbian-powered mobile devices. Additionally, it offers an unparalleled degree of customizability, enabling you to choose the underlying compiler, linker, and debugger according to your preferences and target platform.

Installation
Despite the fact that C++ BuilderX pack contains no less than 14 CDs, the installation process went fast and smoothly. Of all the 14 CDs, only the one containing the C++ BuilderX core files is essential. The remaining CDs contain optional compilers, commercial database libraries, performance tuning tools, and other goodies. I decided to stick to the basic configuration and add more components later, should the need arise. The unavoidable registration process was also fast, although the pestilential habit of forcing it on customers should be discouraged.

C++ BuilderX's default look and feel was rather disappointing. If anything, it looked like a mid 1990s AWT-based applet, with those sluggish buttons and menus, blotchy fonts, and a gloomy gray background (Figure 1 shows the default C++ BuilderX user interface). Fortunately, I soon learned that customizability is C++ BuilderX's strongest feature. You can choose between four different "look and feel" settings, including Emacs, Motif, and Windows. Naturally, I chose the Windows look and feel (Figure 2). At last, I was ready to build my first application.


Figure 1: This is the default C++ BuilderX user interface.
 
Figure 2: The Windows look and feel.
Test Drive
Although C++ BuilderX retains many of C++ Builder's characteristics, there are quite a few changes. For starters, the class view has been significantly improved (Figure 3). It now lists every macro, #include file (recursively!), enum type, function, and class member. There are other welcome enhancements besides that. Customizability, as noted previously, is the name of the game. Not only does C++ BuilderX allow you to choose from five different keymaps including Emacs, Visual Studio, and Macintosh CodeWarrior, you may even define your own keys. Visual C++ developers, for instance, can feel at home by switching to Visual Studio's debugger keymap. Nifty, isn't it?

Figure 3:. The new and improved classview.

Nonetheless, some of the changes are less enthralling. C++ Builder lets you edit a source file during a debugging session. It immediately recognizes any changes and kindly asks you whether it should rebuild the current project and launch a new debugging session. Consequently, I developed a foolhardy habit of fixing source files during debugging instead of waiting patiently for the program's orderly exit. While this can be perilous, most code fixes are small and frequent so why waste precious time? Alas, C++ BuilderX isn't as lenient as C++ Builder. It locks all source files during debugging. If you want to edit any of them you have to wait patiently for the debugging session's graceful termination or abort it using the "reset program" key. I wasn't ready to give up so easily, though. A little poking about revealed the secret handshake, namely disabling the "Editor files are read-only during debugging" option under Project Properties—>Debug. Hallelujah!

Standard Deviation
One of my main concerns when choosing a C++ IDE is ANSI/ISO compliance. In this regard, C++ Builder circa 1998 was a treat to work with. Its core language compliance was close to 100 percent—a rarity in those days. A lot has changed since then, however. Microsoft's promise to bring Visual C++ .NET to full ANSI/ISO compliance has become a reality. Likewise, GCC and Sun's Forté have improved considerably. While a full ANSI/ISO compliance test is beyond the scope of this review, I tested some of the minor nits that vexed me in C++ Builder. The first test checks whether C++ BuilderX allows default argument values in pointers to functions and pointers to member functions. According to the C++ standard, they're verboten.

Here's the relevant code snippets used in this test:


void (*pf) (int  x=81); //default argument not allowed here

// missing & before A::g; default argument not allowed here 
int (A::*pmf)(int x=51)=A::g;  
C++ BuilderX compiled the code blissfully. Don't get me wrong: several compilers have allowed default argument values in pointers to functions for years. Therefore, this isn't truly a bug but rather a "nonstandard extension." Still, I would expect to receive a diagnostic message in this case. Taking a member function's address without an ampersand is even worse. Yet C++ BuilderX didn't issue a warning about this either. For cross-platform developers this might be a problem since some compilers would reject this code altogether.

My second test checks the ordering of exception handlers. I used the following test program:


class Base{};
class Derived1: public Base{};
class Derived2: public Base{};
int main()
{
 try
 {
  throw Derived2(); //should activate the second handler
 }
 catch (Derived1 &d) //handle Derived1 exception
 {
 }
 catch (Base &b) //handle Base and Derived2
 {//throw statement above should transfer control
 }//to this block
 catch (...)// any other exception
 {
 } //Alas, the debugger jumps to this line
 return 0;
}
When the throw statement in the try block executes, the debugger mistakenly points to the wrong handler (see Figure 4) instead of entering the second catch block. This is very misleading. I remember this bug had me tearing my hair out when I first encountered it in C++ Builder. It persists in C++ BuilderX. By the way, this is a debugger bug; the generated assembly code seems to be correct.

Figure 4. When the throw statement in the try block executes, the debugger mistakenly points to the wrong handler.

A Tale of Two Libraries
C++ Builder used Rogue Wave's STL which was pretty antiquated and cluttered up. I was therefore glad to discover that BuilderX had migrated to STLport's implementation instead. In many respects, STLport is cleaner and more standard-compliant. Alas, my elation was short-lived. I noticed that identical programs executed under both C++ Builder and BuilderX showed a significant difference in execution speed. Under C++ Builder they were 30 percent faster on average. Knowing that the underlying compiler and linker of both IDEs were essentially the same, I suspected that the culprit was STLport. To corroborate this, I wrote another test program that didn't use any Standard Library components. This time, execution speed was virtually identical. It was STLport.

Figure 5: The Project Properties.

Mixed Emotions
C++ BuilderX's claim to fame is its multiplatform development capabilities. I wanted to find out how realistic the promise of "write once, deploy anywhere" (not copyrighted yet!) was. I decided to build my project with Intel C++ 7.1 instead of the default Borland BCC32 compiler. I installed Intel's CD (included in the package). The installation dialog box blurted an ominous warning: it couldn't locate Visual C++ 6.0 or higher installed on my machine. You're probably wondering what Visual C++ has to do with Borland's IDE. So did I. It appears that a separately licensed and installed version of Microsoft Visual Studio C++ 6 or Visual Studio.NET are necessary for using Intel's compiler under C++ BuilderX. I ignored this warning and proceeded according to the original plan. Everything seemed to be working smoothly until I hit the "build project" key (see Figure 5 for the project properties). C++ BuilderX's patience ended here. A noisy error message "please verify that the build tool is installed and available to the IDE nipped my vision of multiplatform development in the bud.

Figure 6: Here's a list of code templates supported by the BuilderX Editor.

Editor's Corner
The C++ BuilderX editor also brings novel features—including user-adjustable code templates for class declarations, for-loops, functions, try and catch blocks, and so on (see Figure 6 for a list). In addition, it allows you choose the font, color setting, and default indentation. Be careful when changing the editor's font, though. I mistakenly chose Lucinda Console. It took me awhile to figure out why the editor wouldn't let me erase or insert characters in the right place. Instead, it insisted on deleting one character before the cursor's position or one after it. Sometimes it erratically jumped past {, } or ; signs. I tried to disable the "smart indent options" and "smart key option", to no avail. At a certain point I even found myself editing source files in good old C++ Builder and pasting them back into BuilderX's editor (what an incredible way to increase developers' productivity!) until it hit me: the Lucinda Console font was causing the whammy! Setting the editor to Courier New immediately solved the problem.

Final Judgement
C++ BuilderX offers an unrivaled level of customizability. How many other IDEs allow you to adjust the default keymap, look and feel, or just about anything else so easily? In terms of stability, it's a marked improvement over C++ Builder, although it has crashed a couple of times. As for the promise of multiplatform development under a single IDE, it has yet to be fulfilled. Although this product is an important step towards this goal, you still need a separate license for Visual Studio in order to use Intel's C++ 7.1 compiler and a Professional version of Microsoft Visual Studio if you wish to use Intel's optimizations. Mobile development is also confined to Windows in this release. Apart from minor glitches that will be fixed soon hopefully, C++ BuilderX is a fine choice for mainstream C++ application development.

Maven常见报错原因及解决方案

No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?解决方法...
  • blueboz
  • blueboz
  • 2017年03月19日 18:08
  • 8792

问题:编译策略之代码逻辑顺序不正确(Optimization Level)

曾经遇到过一个问题, 运行一段代码发现执行的逻辑顺序不正确, 而且在添加了其他语句后, 还会有不同的顺序, 但是都是不正确的....
  • wangyanchang21
  • wangyanchang21
  • 2016年04月15日 16:57
  • 2361

【故障】旧版本的Docker Toolbox 无法正常运行的解决办法

如果下载的是旧版本的Docker Toolbox 版本,在安装完毕后,运行终端控制台时会报错, 无法正常运行并创建Docker虚拟机(default)。通过下载、拷贝最新版本的boot2docker....
  • CSDN_duomaomao
  • CSDN_duomaomao
  • 2017年06月11日 13:30
  • 2543

26 Customization of UI Controls javafx

This chapter describes the aspects of UI control customization and summarizes some tips and tricks p...
  • ccssddnnbbookkee
  • ccssddnnbbookkee
  • 2013年04月13日 20:23
  • 3613

PADS 9.4 Release Highlight_CN

  • 2012年05月01日 14:54
  • 272KB
  • 下载

This is an excellent example of how to highlight HTML code i

  • 2006年02月23日 09:05
  • 60KB
  • 下载

ARC forbids explicit message send of release

ARC forbids explicit message send of 'release' 'release' is unavailable: not available in automatic ...
  • dexin5195
  • dexin5195
  • 2015年01月06日 17:31
  • 401

Installation of Oracle 11g Release 2 (11.2.0.1.0) on RedHat EL 5, (Oracle) Enteprise Linux 5 and Cen

http://ivan.kartik.sk/oracle/install_ora11gR2_elinux.html Installation of Oracle 11g Rele...
  • longyinyushi
  • longyinyushi
  • 2016年05月28日 08:26
  • 644

10.2.0.4 to 10.2.0.5 Installation of Patch Set Release (Windows)

环境:10.2.0.4集群数据库zlm10g(双节点,zlm10g1,zlm10g2) 系统:Windows 2003 Server 64Bit 内存:2G RAM 存储:ASM 目标:把集群数据库从...
  • aaron8219
  • aaron8219
  • 2014年07月07日 15:21
  • 1109

[转]Installation of Oracle 11g Release 2 on Solaris 11 Express x86 and SPARC

在 Solaris 11上安装Oracle 11g 转自:http://ivan.kartik.sk/oracle/install_ora11gR2_solaris11.html ...
  • wanghui5767260
  • wanghui5767260
  • 2014年10月10日 18:42
  • 1391
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:Customization the Highlight of CBuilderX Release
举报原因:
原因补充:

(最多只允许输入30个字)