Java vs Visual Basic - A Comparison
Characteristic Java
Visual Basic
Ease of Development Very good visual development environs, lots of wizards and help
No. of syntax elements, routines 50 commands, 1000s of routines 300+ commands, 1000s of routines
Approachability +JVM/SDK free & easily available
+text editor & browser to run
-OO design takes some extra effort
-even bigger API to master +do useful work quite quickly
+ VBA is available in many products
-Learning edition costs $100
-huge API to master
Documentation =mixed quality of written docs
+solid electronic reference HTML -poor written docs; $extra, disorganized
-electronic docs $extra; few/poor examples
Availability of books, tutorials, courses etc =lots of books and tutorials
=big in college and universities
+can do self-training easily =lots of books and tutorials
+MS and other training courses
=mixed adoption in colleges/universities
Reliability and stability Constant and rapid change is drawback to both languages
Major weaknesses -numerous new classes/APIs
-rapidly deprecating classes
-huge API, bigger than VB's -numerous new routines/syntax
-just moving to OO technology
-always bugs in new features
-a mess in data access routines
Robustness +cleaner try/exception handling & event listener models
+runtime type, bounds checking
+restricted memory manipulation +automatic syntax checker in editor
+direct use of Windows APIs
-opened up to direct memory change
Security ++Major advantage is sandlot model -ActiveX still problematic
Overall Reliability + reasonably reliable at start
-bugs creep in early 1.1 SDK
-GUI compatibility problems
+major ISVs likeOracle, IBM, Sun, Sybase, etc committed to it +six versions to clear bugs
-still islands of instability/bugs
-hard to find good advice on what
to avoid or how to fix some bugs
+the favored tool at Microsoft
Speed of Development Very good native & 3rd party tools
Editor -depends on IDE, some are weak +constantly sets the standard
Visual development =IDEs are quite good =IDE is quite good
Debugging/Testing =client side debugging is good
=good but mixed on server debugging
=good profiling and test tools ++best debugger on client by far
=improving on server side
=some great 3rd party test tools
Project size +medium scale with DBMS
+server or large-scale n-tier/web +small quick and dirty
+medium scale with lots of GUI
Other +Advantage is more secure and broad reaching components like JavaBeans, EJBs, servlets, etc.
=3rd party tools, libraries, etc. +Big advantage is huge army of developers
=3rd party tools, libraries, etc.
Runtime options Both languages give away 10-30% speed deficit to C/C++
Cross platform ++Major advantage -could be negated if VB emits bytecode
Deployment options =.exes amd bytecode
=Beans and EJB components
=web servlets
+browser applets =.exes and p-code
=ActiveX components
=web servlets
Speed +advantage to Java on server
+byte code optimizers, trusted compiled apps just getting used +advantage to VB on client
Popularity Two most popular programming languages
Ace in the hole JINI VBA-macro language for Windows
Perhaps because there have been so many bugs and reliability problems, both Java and Visual Basic have very solid debuggers and 3rd party testing tools. Visual Basic is still the only major language that allows users to stop a program during debugging, change one or more lines of code and, in most cases, immediately resume running the program either from where it was halted or from a user chosen new start point. Despite the fact that Java has sophisticated JIT-Just In Time compilers and very fast interpreters, Java IDEs have only a pale approximation of this immediate restart debugging capability. However, on the profiling and testing side both Java and Visual Basic have the support of some excellent testing tools. But perhaps the most compelling reason for speed of development is paradoxically the huge APIs.
Given short development time and complex coding requirements, re-use of tried and tested (hence the concern about bugs)Java or Visual Basic API code can and does cut major chunks out of development time. When time to market has become the critical success factor for most businesses, speed and reliability of software developments that drive market winning innovations also come to the fore. The whole idea behind OO is structured inheritance and re-use of code. What Java and Visual Basic bring to the table is not only re-use but also the ability to deliver code in deployment packages ( excutables, components, servlets and applets) suited to a wide range of needs. Yet Java and Visual Basic give away only a hit of 0- 40% in performance speed relative to the fastest C, C++, Fortran or Pascal programs. In sum it is the combination of rapid application development and broad range of deployment options that have been instrumental in vaulting Java and Visual Basic to pre-eminence among programming languages.
When To Use
It is obvious from TABLE 1 that there are trade off between the two languages. In the coming months, The Computer Paper shall feature tutorials on both Visual Basic and Java so if you haven't already you will get to see some of the coding pros and cons in detail.. But right now you may need to decide which language to use and when. For applications on the server side, especially Web applications - Java has a distinct advantage simply because it runs on more of the enterprise class operating systems. Also major Web application server vendors such as BEA, Bluestone, IBM, Oracle, Sun and others have placed Java development ahead of even C/C++. Visual Basic has a server niche in all-Windows shops particularly when used in conjunction with Visual InterDev and/or Front Page for to develop .ASP based applications.
For PC based applications, where Windows dominates the desktop, the situation is reversed. Because VB is slowly but surely becoming the scripting language for Windows, it is easier to bolt VB through COM and other components onto existing commercial or homegrown Windows apps. If on the other hand your delivery model is to use the Net and a browser interface you may want to give Java a careful look. The new Swing classes make Java GUI operations very fast - download a free copy of Together/J from www.oi.com to see exactly how fast pure Java can be on a PC.
In fact many analysts argue that with steady improvements, Java and Visual Basic will be matching C/C++ for speed of execution. Given that many Java applications do not take advantage of 2nd generation byte code optimizers, rarely use the new breed of Java compilers (the trade-off is less portable code vs a 20-60% speed improvement) and are still waiting for the speed boost of Sun's dynamic Hotspot Technology - Java has plenty of performance tuning capacity. In contrast, Visual Basic did show steady improvements to the point of reaching within 10-20% of equivalent C/C++ code in version 5. However, version 6 saw the speed advantage slip by 5-15% in a number of categories; most notably in database access. But analysts argue that with steady compiler improvements still to come along with CPU chip performance continually improving also, both Java and Visual Basic will be taking on more enterprise programming tasks over the next five to ten years.
Conclusion
If you got all the way through to here in this article, you undoubtedly picked up its tenor - great admiration of Java and Visual Basic mixed with ample frustration. Great programming languages like Java and Visual Basic should not be dogged by poor documentation or lacunae of reliability and bug problems- especially when those small but significant percentage of bugs detract from the languages' greatest strength - speed of development. Visual Basic, in particular, after being such a pioneer in rapid application development, is disappointing its constituency yet again with another version of VB whose new features are buggy (see Confessions of a VB Beta Tester, p128 Aprill 1999 issue of Visual Basic Programmer's Journal). However, the proof is in the programming. Fortunately, both languages are readily available. Go to www.sun.com/java and download the latest JDK which includes javac for compiling and java for running Java programs - just add your favorite text editor (notepad.exe will do). And VB is available in a learning edition for less than $100. Or look for VBA in Office 97 and over 80 other programs like AutoCAD, the new Corel Draw, Peachtree Accounting, System Architect, etc. VBA uses most of the VB interface but does lack some of the more advanced component and server side development features. Try them both