On Wed, 13 Nov 2002, CYWare wrote:
> > everything using Java?
>
> JAVA is just too resource intensive on any platform. I'm wondering what
> kind of machine you would need if Netscape/Mozilla was written entirely in
>
In defence of Java, I made some benchmarking few months ago to
shed light on disadvantages and advantages of programming in Java vs
C/C++. The summary of results:
1) if you are performing algorithms heavy in computation, Java is around
50% slower than C/C++. Memory consumption is more than double!
2) the codes written in Java is around 30% shorter than C/C++ for the same
job.
3) if you are not performing algorithms heavy in computation (eg
tcp/ip-based applications or simple gui like phone dialer), C/C++ has no
significant speedup compared to Java.
4) Standard C/C++ libraries dont have online documentation! As far as I
can tell you only STL is documented. So you have to make Stroustrup' book
handy. I think this is a major problem for any programming language. It is
like learning a new spoken language without a dictionary that will explain
you the usage of words. Just imagine that I am more familiar with QString
than the standard "string" data type in C/C++ because Qt makes a nice
documentation. Java makes a very nice web browsable documentation .
> complex business applications regardless of the language used. I can tell
> you right now that to build something like a Warehouse Management System
> would take me the same amount of time whether I use Powerbuilder, Visual
> Basic, QT, Visual C++, Turbo Vision or Kylix. The GUI portion of most
> business applications is minimal, most of your code is spent on business
> logic which will take pretty much the same amount of time in any language.
I beg to disagree at this point. In my own experience there are
things a certain programming language without too much effort that will
take a lot of effort in doing it in another language. I am going to give
two simple scenarios:
1) Conversion from int to string or from string to int takes no
effort in perl and Java. C/C++ can do it using atoi() but there is no
itoa() in the standard C/C++ library. You have to code it by yourself and
that is error prone. Another case, suppose you are given this string:
"234,23,879,234,224"
where each the data is a csv and I ask you to extract the data and
put them in an array of int. Again this is effortless in perl and java but
too painful in C/C++. That's why I have applications written in C/C++
where I embed perl scripts to parse strings like these.
2) Creating a simple tcp/ip echo server. This is effortless in
java but takes some time in C/C++.
> This is why we choose C/C++...at the end of the day, we end up with a
> faster, smaller, more robust product. Most important of all, the end result
> is a "simple product". No need to install JRE, Beans, SWING, Tomcat
> etc...just deploy your binary and you're all set. Minimizing the amount of
> dependencies in any application minimizes the amount of problems/bugs you
> will have in the future.
>
I agree at your point. If you want to build a "lean and mean"
application, C/C++ is the way to go other than doing it in assembly. But
if you are blessed with a reasonable hardware (which I suppose not in your
POS problem here ) and real-time response is not a constraint, do it in
java. Of course web programming is a different story.
rowel
_
Philippine Linux Users Group. Web site and archives at http://plug.linux.org.ph
To leave: send "unsubscribe" in the body to [EMAIL PROTECTED]
Fully Searchable Archives With Friendly Web Interface at http://marc.free.net.ph
To subscribe to the Linux Newbies' List: send "subscribe" in the body to
[EMAIL PROTECTED]