Java vs. C++ vs. Visual Basic

I’m the I.S. Manager at a small manufacturer with a large, Japanese parent company; in theory, our prospects for growth are very good. However, our computer system is a joke, and I and my department have the curse/blessing of rebuilding and extending it (for political reasons, it’s not possible to purchase a system - it’s handrolled or nothing).

Our current platform is Windows NT, SQL Server 7, and Access 97 clients, coded where necessary in T-SQL and Visual Basic. It’s a big ball of bandaids and ad hoc code, and (again, for political reasons) must remain in place and compatible with the parent company’s even larger mess (we need permission from the parent company to alter it in any way). Fortunately, its scope is very limited compared to the ERPs at most American businesses, and what must remain in place is relatively limited and can be walled off behind a better system.

I see two choices to make: first, is whether or not to stick with the whole Microsoft platform, and make it work better. Someone always has to muck out the stables, and it may just be my job to do it. This would entail mastering the platform and extending our system in Visual Basic and T-SQL, using Access or perhaps a web interface for clients. Or, I could embark on building a new system from scratch that will eventually support both the business and the old system; the advantage to this would be the opportunity to embed theoretical correctness in it from the beginning, eventually yielding a better and far more scalable system that actually works like it’s supposed to. Assuming I choose the second option, I then have a choice of how to do so. I see two options: Java and C++.

In favour of Java is the fact that it’s easier to code than C++, and has a tremendous amount of libraries available, especially for this situation (e.g., IBM’s San Francisco project). It’s comprehensive, too: it goes in the browser, in web-based applications (JSP), on the server, etc. It’s also platform neutral, so it leaves open the decision to remain a Microsoft shop or to pursue better platforms, or a mixture. Against Java is the performance issue: it’s just not as fast as native code, and in particular, GUIs written in Java are dog-slow on computers that aren’t the latest.

In favour of C++ is, well, that it’s C++. It’s pretty much the standard in business and applications development. It’s more mature than Java and has a wider installed base. Like Java, it has a wide selection of library code, though I’m unaware of anything as comprehensive as IBM’s San Francisco project. Against C++ is the steeper learning curve for my coders (none are experienced in either Java or C++), and the extra work we’d have to do getting a common code base from which to work.

So there’s the choices: Microsoft and it’s scripting language (maximum prewritten software, minimal power and flexibility), C++ (minimal prewritten software, maximal power), or Java (apparently the happy medium). What do you think? What choice would you make when starting your own ERP?

You don’t have to use OO features with MS C++. It can understand plain old C just fine. If the file extension of the source is .cpp it assumes object classes, if it’s .c, it assumes standard C. Most third party libraries (controls and DLLs) should work with C, C++, and VB. C has a much shorter learning curve than C++, and Java uses much the same constructs and conventions as C.

Whether or not you go web interface is always a big question, but MS seems to be more inclined to use JavaScript instead of Java (significant difference) for the client side, and VBScript for the server side, and use Active Server Pages. That’s today; I’m sure tomorrow things will change, especially when VB7 is official. I’m not exactly sure what you mean when you say that Java “goes in the browser.” JavaScript, yes. Java, no, at least not as I understand it. Isn’t Java used more on the Sun platform than Windows/Intel platform?

However, if your tendency is to stick with Access databases on a non-web platform, using VB with ADO is a difficult combination to beat. There’s only one thing that makes me a little hesitant to use VB to build business systems with - and that’s the problem of reading standard variable-length ASCII CRLF-delimited flat files using VB’s native reads/gets. For something like that, COBOL blows VB away. Sorry, but it’s true. I guess you could use ODBC to read the flat files, but it’s still a kludge. If most of your IO is against the Access Database, and you don’t have hundreds of users banging away at it, I’d stick with VB.

You can have bad, patchwork, spagetti code in C++ and Java as well, so the source language won’t prevent that from happening. If anything, I would think that VB tends to have a lower maintenance cost than C or C++, because, if it’s written correctly, mere mortals can understand it. I’ve written in several languages (C, VB, PL/I (aack), JScript, even Fortran and BAL), and of all of them, VB is probably the most readable and maintainable, and it’s fairly powerful. I just re-wrote one patchworked module of one of our systems (both versions are VB) and the new one is 2/5 the size of the old one, and runs in about 1/3 the time. It can be used very effectively.

If you do stick with Microsoft, buy at least one MSDN subscription. It will save your tail. Trust me on this one.

Hm. If you want an easy learning curve, Perl has a whole heck of a lot of libraries, including quite a few graphical library wrappers (GTK, TCL, OpenGL etc).
It is also fairly cross-platform, almost more so then Java, from the headaches we’ve been having. Performance wise it compares fairly well with Java (again, this depends on the platform)
Of course, all this depends on what you’re doing. :slight_smile: You say this is for your computer system? What must the software do?

I favor OO because part of the desire to do a clean sheet rebuild is to use a principled methodology (like modelling it in UML). I’ve done some non-trivial coding in both Java and C++, and OO seems like the right way to do it.

When I say that Java goes in the browser, I mean that the combination of Java applications on the server, servlets, and applets in the browser means that we could be a pure Java shop - no C++ on the backend, PHP for server-side processing, and javascript at the front. This is a decision that will be operable for years to come, and I’d like to minimize what people have to learn.

All of our data is in SQL Server 7.0. Access is just the client, and it uses ODBC and VB to act as a stateless client.

I’ve done a lot with Perl, but I can’t see building a wide-scale business system in it: it just doesn’t scale up well for large projects, as far as coding it goes. The scope of the project is ultimately a complete ERP, meaning order processing, manufacturing, distribution, and finance, so it has to be something industrial strength. That’s why I’m unhappy with our current setup - SQL Server is not a performance database, and thin-client networking with Access is unreliable. I don’t know about anyone else’s experience, but I’ve formed the impression that Microsoft just hasn’t figured out how to do distributed computing yet (though perhaps that’s just the choice of Access and SQL Server; I’ve never used COM or DCOM before).

Ummm. have you looked at pre-packaged ERP systems, that you can then just write an interface to the parent company’s database?

Also, I’m mostly a PowerBuilder & Jaguar geek, because while C++ and or Java are wonderful for their OO properties, finding people who write Good, Readable, Maintainable code are very difficult to find and understandably cost an arm an a leg.

Though of course there are a ton of Java development environments that encapsulate most of the ordinary stuff, and let you just write code for the parts that are specific to your project, so those might work just as well.

-Doug

There’s really nothing wrong with any of these solutions (except the notion of using Perl), it’s going to be a matter of tradeoffs.

In the environment you describe, most of the processing work is going to be handled by the middle tier components that are shared among all technologies - ADO, ODBC, etc. Really, in an ERP system you’re mostly building front-ends to the middle tier, so I wouldn’t worry too much about speed.

In favor of web interfaces: The main one is the ease of distributing and maintaining the application. If you write something in VB or C++, you have to install a client front-end on every machine. That means having to worry about versioning, installs, uninstalls, OS incompatibilities, etc. If you build a web front-end, then any time you add functionality you just modify the server side code and all clients are updating instantly. And of course deployment is as simple as making the web site available.

Against Web Interfaces: Speed, lack of refined features, and the generally clunky nature of web interfaces as opposed to a general windows interface. It can also be more difficult to build a good interface with a good User Interface on the web.

My Suggestion: A lot of people are using a RAD tool of some sort to build these interfaces - Delphi, VB, that sort of thing. Use C++ to build your middle-tier components containing the business logic of your ERP, connect the data tier to SQL Server or Oracle, and build your front-ends in the tool of your choice. A big factor in that choice would be the current skill set of your developers.

I should have mentioned this before: we will never, ever buy an ERP, or any component thereof (warehouse management, MRP, etc.). I don’t know about Japan generally, but our parent company’s attitude is to computerize a process only once they’ve been shamed into admitting that they can’t do it on paper anymore. It’s dishonourable to buy a system - it’s admitting you can’t do it yourself. They’ll build for themselves an inferior version of what they refuse to purchase.

This is one of the reason’s I’m seriously considering Java.

That’s assuming you run java programs through the standard bytecode interpretor. Java CAN be compiled to native code which will increase speed considerably. I’ve only tried this with very specialized applications and I don’t know how well it would work with Java GUIs, and you couldn’t use it in a browser. So while you do gain speed you also lose some of the main features of java.

Another way to speed up interpreted java software is to use a JIT compiler. IBM makes one. It uses more resources than normal java but can give you considerable speed increases. This is not a good reason for choosing java but if you do, you might want to look into it. For some applications it’s great but for others it can actually slow things down.

One of the main reasons I would choose Java for most larger projects is its excellent error handling. It is relatively easy to write code handling runtime errors and exceptions safely compared with other languages.

When it comes to distributed computing java has an integrated technique called RMI which is part of the JDK. Look very seriously at this if you decide to use java. Debugging and configuring RMI isn’t nearly as difficult as DCOM and CORBA can be.

Really, Java can be an app or an applet. And applications run pretty well anyway. Because javascript can communicate very well with java it wouldn’t be off-the-wall to create an explorer interface which rins on client-side javascript integrated with applets or java applications. Now that IE has caught up in the javascript game (and IMO has passed Netscape as the preferable browser) this could really be done nicely. I often considered trashing the stupid existing access database and creating a simple browser-integrated database since our company is pretty small and we never can get very big our database will also never need to be super-complex. Its more complicated than it needs to be now, I can tell you.

Java has a ton of classes, methods, and such to deal with databases, though I’m not up on that at all, I just know they exist. How you would apply that to any specific database I don’t know.

Java, ASFAIK, has one limitation under C++ (aside from speed which I don’t really count): it is less powerful. Java only allows strict single class inheritance, while C++ allows multiple inheritance. But, I think Java rules and everyone should use it if possible anyway, so do it if you can. I don’t think the language is going anywhere soon.

Another factor in favor of Java is the cost of tools. The JDK from Sun is free, as is (I think) the JIT compiler from IBM. Microsoft’s Visual Studio and an MSDN subscription aren’t cheap. The only tool costs for Java would be if you wanted to use an IDE such as IBM’s VisualAge for Java or a UML code generation tool such as RationalRose.

aynrandlover wrote:

Java’s “implements” keyword allows for some of the capabilities of multiple inheritance. Only drawback is the base “class” of an “implements” statement has to be entirely abstract – no data members, and none of the methods can be defined.

I’d say since you’re already an MS shop that you should stay with it and focus on Refactoringyour system instead of throwing the baby out with the bath water.

I would probably get rid of the Access parts. Access as a client never made sense to me. Why not just do it in VB? Especially if you’re not using the DB part of Access?

UML and good procces are both key and I would argue are much bigger concerns than language. Languages are nothing more than ways to express your self and thought patterns.

I think Sam’s on the right track:
Desktop GUI: VB
Web GUI: ASP
Middle tier/business logic: I would start with VB and use C++ for the intensive stuff. COM makes this easy.
Back end:SQL 7.0

There’s alot to said for the JAVA platform and its technologies, but given what you’ve already invested I can’t see making such a drastic move as to throw out everything and start over.

Basically, we can’t refactor the system. We need to ask permission from the Vice President of Finance at the parent company to add a field to a table. We’re stuck with the design of the core system, and are limited to incremental improvements.

This is why this seems like an opportunity to clean sheet the system. To paraphrase some MS exec from the antitrust trial, it’s time to knife the baby. The core system is limited in scope, and it’s feasible to wall it off behind a new one that supports the business and the core system.

I have three main complaints against Microsoft: Access as a client sucks, SQL Server is slow, and Microsoft data networking protocols are unreliable (ADO, ODBC, OLE). VB itself is okay; IIS is good, too, so an ASP interface is a real possibility (or VB; I wouldn’t use Java for a client since Swing is dog-slow and AWT is weak).

Java is a serious contendor for the middle tier because, as a language, it’s easier to learn and apply than C++; UML modeling tools that skeletonize code are plentiful (e.g., Rambling Rose), and there are a lot of good applications servers for Java (including ones that snap in to IIS). As Kferr noted, java tools can also be extremely cheap.

My cousin is a consultant who’s built several large systems, and he’s a java advocate (but not a zealot). According to him, Windows 2000/NT is actually a very good platform for Java, and principled design is generally easier in Java than C++ because of the language restrictions. Given the inexperience of my department, easier tools are preferable.

I agree with your feelings regardign Access. As for SQL server being slow I’m sure there are plenty of benchmarks that show it isn’t; more info and some optimizations might help. As for MS’s data access tech even if you move to Java you’ll still be using a JDBC-ODBC bridge to access your SQL 7.0 so you won’t gain (in fact you’ll lose) functionality in that respect. I couldn’t find a native (or any other class) driver for SQL 7.0 on MS’s site. You might be able to buy one.

I agree, but (being the VB’er at heart that I am) I think you can do alot of great work on the middle tier with VB and COM and not hafta relearn a new product. Free or not learning a new app server increases your TCO (check out http://www.jboss.org for a good one, though).

[hijack]
Why are we so enamored with free software. MS has more geniuses working on its stuff than anything since the Manhatten project, but people would rather run their business on a OS written by a grad student and his buddies as a hobby, then pony up a few bucks. YIKES!!!
[/hijack]

As for UML/CASE tools they are sweet, but most definately not free. Rose (I assume you meant Rational Rose) runs about $5000 per seat. http://www.togethersoft.com has another that’s not bad, but something about “call for pricing” worries me (I don’t lobster either). MS Visio 2000 Enterprise Edition runs about $900. If anyone knows of others, I’d love to know myself.

Benchmarks I’ve seen put SQL Server significantly below Oracle and DB2. I think this is to be expected - SQL Server is (I believe) a latecomer to the full-scale enterprise database market, and is playing catch-up to those two. Certainly, a lot of our performance problems are design-related, but there’s not a lot we can do about it. To some extent, I’m forced to select raw power in place of elegant code (which is exactly backwards to what should happen, but my hand is forced in this case).

There are commercially available SQL Server drivers available for JDBC. The problem isn’t speed in this case as much as reliability, and I’ve heard of the same problems from others.

I think I’m a little gunshy about VB because of all the bad VB code we already have. Also, from my own experience, a principled design will be more difficult to implement in VB, since it’s not fully OO (from what analysis I’ve already done, an OO methodology is very well suited to our problem domain). It’s still a scripting language at heart, and derives most of its power from access to components (which could be java, C++, etc.), so we’re back to the problem of choosing an industrial language.

This is a mischaracterisation of the general landscape for free software; it makes it sound like there aren’t skilled coders and well-managed projects out there doing this. Sure, a lot of it sucks, and a lot of it is midnight hacking by warezdoodz. There’s also a lot of companies that are releasing code that’s peripheral to their corporate goals (Enhydra, for example; or Sun and IBM releasing Java development kits and virtual machines; even MS’s virtual machine for java is free). There’s also a lot of projects that have so much inertia and prestige that they attract better people than your run-of-the-mill corporate coder (Apache, sendmail, etc.)

From any perspective, free is better if you’re getting what you require. If you think that there aren’t viable choices in free software, you’re simply missing out.

Besides, as an I.S. manager, I’m really concerned about things like Microsoft’s plan to sell subscriptions to Office rather than CDs. As an MS shop, our software costs are significant, and the new pricing structures that MS and others are coming up with mean one thing to me: higher costs for the same product.

I did mean Rambling Rose, and I’m aware of the costs. There are free alternatives that I’ve only started evaluating, so I don’t know whether they’re viable. Again, this goes to the issue of where I put my money, and where I can save it.

All good points and well taken (except for that crack about vb being a scripting language <removes dagger from heart> :slight_smile:

As for Rambling Rose or for some of the free UML/Case tools, do you have a link? I did a net search and all I got back was links for a BnB in West Va. and a movie with Robert Duvall and Lara Dern.