By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,130 Members | 2,228 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,130 IT Pros & Developers. It's quick & easy.

C++ and Java

P: n/a
As a newbie I would like to ask what the difference in application (not
details) is between C++ and Java. In what situations would you use C++ in
preference to Java and vice versa?

I am not asking for personal opinions on which is the *best* language :)

Alan.
Jul 23 '05 #1
Share this Question
Share on Google+
47 Replies


P: n/a
Alan Brown wrote:
As a newbie I would like to ask what the difference in application (not
details) is between C++ and Java. In what situations would you use C++ in preference to Java and vice versa?


In general, prefer programming systems that make programmers faster. (And
note that VisualBasic makes them slower, for example.)

So, you might want to go with a very-high level language that rapidly
encodes what you need with minimal futzing

Java is an attempt to impersonat such a high-level language, while keeping
enough {} style syntax to advertize to C++ users.

Use C++ if you like manually managing memory, virtual dispatch, array
bounds, etc. C++ encapsulates these things very well in systems like the
STL, but it still does not allow as much programmer speed as very-high level
languages.

If you need a very large and fast program, you must indulge in manual memory
management, array bounds checking, etc. So use C++ to write things like the
engines of databases or videogames.

And, in any language, write lots of unit tests.

--
Phlip
http://www.c2.com/cgi/wiki?ZeekLand
Jul 23 '05 #2

P: n/a
Alan Brown wrote:
As a newbie I would like to ask what the difference in application (not
details) is between C++ and Java. In what situations would you use C++ in
preference to Java and vice versa?

I am not asking for personal opinions on which is the *best* language :)

Use Java if you want to write applications for the Java Virtual Machine, use C++ if you
want to write applications for everything else, or want to do systems programming.

--
Ioannis Vranos

http://www23.brinkster.com/noicys
Jul 23 '05 #3

P: n/a
* Alan Brown:

As a newbie I would like to ask what the difference in application (not
details) is between C++ and Java. In what situations would you use C++ in
preference to Java and vice versa?
As always the FAQ is a good place to start getting a handle on such questions.

In this case, FAQ items 6.5 and 6.6.

<url: http://www.parashift.com/c++-faq-lite/big-picture.html#faq-6.5>
<quote>
In 99% of the cases, programming language selection is dominated by
business considerations, not by technical considerations. Things that
really end up mattering are things like availability of a programming
environment for the development machine, availability of runtime
environment(s) for the deployment machine(s), licensing/legal issues of
the runtime and/or development environments, availability of trained
developers, availability of consulting services, and corporate culture/
politics. These business considerations generally play a much greater
role than compile time performance, runtime performance, static vs.
dynamic typing, static vs. dynamic binding, etc.
</quote>

The FAQ isn't perfect, though (what is?). It should have stated _main_
programming language selection. For example, long ago, in a galaxy far
far away, there was a Java project where we needed to maximize windows
(not possible in Java then), to deal with the Windows clipboard (not
possible in Java then except for pure text), and where we needed a decent
help system (not available in Java then); I implemented those things in
C++, used by the main Java code. Only a couple of months later a Java
help system much like the standard Windows one became available, and half
a year or so later Java got better support for clipboard operations, I
think, it's possible I have the timeline reversed now, t'was long ago. It
was easy to then switch from the C++ implementations to pure Java because
the interfaces were clean (a single language improves maintainability).

In an even earlier Java project, possibly even farther away, I created
interfaces to the Windows security system (access checks, impersonation)
in C++ -- impossible to do in Java then.

C++ lets you do those integration things that a canned language like Java
doesn't, and it lets you access hardware, and it can be more efficient for
some things, although the set of such things has become smaller and smaller
over the years (Java-like JIT compilation can be superior to a fixed once-
and-for-all C++-like compilation wrt. efficiency, but not always).

With C# there's less need for C++ because C# lets you access basic OS
functionality, but then, with C# it's easy to get stuck not only in the
Windows world, but in a particular version of Windows, .NET and toolset. C#
is great as a beginner's language, though. And so is Java, but IMO not quite
as good for that as C# (here's much room for opinion), the Turbo Pascal heir.

I am not asking for personal opinions on which is the *best* language :)


Ah, but you are... :-)

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Jul 23 '05 #4

P: n/a
Alf P. Steinbach wrote:
With C# there's less need for C++ because C# lets you access basic OS
functionality,

We should not confuse C# (or Java) with the underlying framework.

In particular, .NET facilities are the same for all languages.
--
Ioannis Vranos

http://www23.brinkster.com/noicys
Jul 23 '05 #5

P: n/a
al***@start.no (Alf P. Steinbach) wrote in
news:42****************@news.individual.net:
* Alan Brown:

As a newbie I would like to ask what the difference in application
(not details) is between C++ and Java. In what situations would you
use C++ in preference to Java and vice versa?


As always the FAQ is a good place to start getting a handle on such
questions.
I am not asking for personal opinions on which is the *best* language
:)


Ah, but you are... :-)


Thanks for your reply. I meant I did not want to know who felt that one
language was the better, but in what circumstances would Java be better
than C++ or vice versa.

Thanks

Alan

Jul 23 '05 #6

P: n/a
Alan Brown wrote:
As a newbie I would like to ask what the difference in application (not
details) is between C++ and Java. In what situations would you use C++ in
preference to Java and vice versa?

I am not asking for personal opinions on which is the *best* language :)

Alan.


If you want to write an app that you compile once and it will run the
same on any machine, then use Java (though it does occasionaly have
slightly diffent behaviour between machines). If you want to get lower
level for speed, direct hardware access etc. such as games programming,
use C++.

Lionel.
Jul 23 '05 #7

P: n/a
In article <d5**********@bunyip2.cc.uq.edu.au>,
Lionel <li****@itee.uq.edu.au> wrote:
Alan Brown wrote:
As a newbie I would like to ask what the difference in application (not
details) is between C++ and Java. In what situations would you use C++ in
preference to Java and vice versa?

I am not asking for personal opinions on which is the *best* language :)

Alan.


If you want to write an app that you compile once and it will run the
same on any machine, then use Java (though it does occasionaly have
slightly diffent behaviour between machines). If you want to get lower
level for speed, direct hardware access etc. such as games programming,
use C++.

Lionel.

Or if you want to create an applet which any user can run via a web
site, in any web browser, on most any machine, create a Java applet.
This could also be done via Javascript (a completely different language,
which has nothing to do with Java), but the Javascript version would be
more challenging if you wanted it to run on all machines and all
computers and Operating Systems, since their Javascript and DOMs
(Document Object Models) are not identical. The JVMs are much closer to
identical.

There are many commercial software packages written in C++ (over 95%).
There are very few written in Java.

--Dave

Java__Dave@NOSPAM_Hotmail.com

Remove NOSPAM_ to reply...
The 2 underscores in Java__Dave are required...
Jul 23 '05 #8

P: n/a
Dave wrote:

There are many commercial software packages written in C++ (over 95%).
There are very few written in Java.


Huh?
Jul 23 '05 #9

P: n/a

"alex goldman" <he***@spamm.er> wrote in message
news:13****************@yahoo.com...
Dave wrote:

There are many commercial software packages written in C++ (over 95%).
There are very few written in Java.


Not sure where you got that wisdom from but it is factually untrue. I
sincerely doubt that 95% of the application being written today are C++.
That this may have been the case in the past (i doubt that as well, but
still) is irrelevant. At one point 95% of the programs were written in
assembler, that doesnt mean C++ wouldnt have been the better alternative if
it were available.

Note that i'm not claiming Java is better than C++ or anything else, each
has it's uses. But plenty of commercial apps have been written in Java, and
it's a fair bet a large portion of the websites you visit are powered by it
as well.

-Remon
Jul 23 '05 #10

P: n/a
alex goldman ecrivit le 23/06/2005 16:43 :
Dave wrote:

There are many commercial software packages written in C++ (over 95%).
Sure.
There are very few written in Java.


Sure.

How about Cobol ?
Jul 23 '05 #11

P: n/a
"Remon van Vliet" <re***@exmachina.nl> wrote in message
news:42***********************@news.xs4all.nl
"alex goldman" <he***@spamm.er> wrote in message
news:13****************@yahoo.com...
Dave wrote:

There are many commercial software packages written in C++ (over
95%). There are very few written in Java.


Not sure where you got that wisdom from but it is factually untrue. I
sincerely doubt that 95% of the application being written today are
C++. That this may have been the case in the past (i doubt that as
well, but still) is irrelevant. At one point 95% of the programs were
written in assembler, that doesnt mean C++ wouldnt have been the
better alternative if it were available.

Note that i'm not claiming Java is better than C++ or anything else,
each has it's uses. But plenty of commercial apps have been written
in Java


Care to name some?

C++ applications include Microsoft Office, Internet Explorer, Adobe
Photoshop, Illustrator and Acrobat. I understand that Macromedia's Web
Development apps are also written in C++.

See here for a long list:

http://www.research.att.com/~bs/applications.html
--
John Carson

Jul 23 '05 #12

P: n/a

"John Carson" <jc****************@netspace.net.au> wrote in message
news:d9***********@otis.netspace.net.au...
"Remon van Vliet" <re***@exmachina.nl> wrote in message
news:42***********************@news.xs4all.nl
"alex goldman" <he***@spamm.er> wrote in message
news:13****************@yahoo.com...
Dave wrote:
There are many commercial software packages written in C++ (over
95%). There are very few written in Java.


Not sure where you got that wisdom from but it is factually untrue. I
sincerely doubt that 95% of the application being written today are
C++. That this may have been the case in the past (i doubt that as
well, but still) is irrelevant. At one point 95% of the programs were
written in assembler, that doesnt mean C++ wouldnt have been the
better alternative if it were available.

Note that i'm not claiming Java is better than C++ or anything else,
each has it's uses. But plenty of commercial apps have been written
in Java


Care to name some?

C++ applications include Microsoft Office, Internet Explorer, Adobe
Photoshop, Illustrator and Acrobat. I understand that Macromedia's Web
Development apps are also written in C++.

You're naming desktop apps only, that's a relatively small percentage of
application being developed.
Jul 23 '05 #13

P: n/a
alex goldman wrote:
Dave wrote:

There are many commercial software packages written in C++ (over 95%).
There are very few written in Java.

Huh?


If you mean "commercial software packages currently in the process of
being written":
I think it is very likely, that 95% of them are in Java.

If you mean "commercial software packages used now and written at some
time in the past":
I think it is very likely, that 95% of them are in C++.
--
"Thomas:Fritsch$ops:de".replace(':','.').replace(' $','@')

Jul 23 '05 #14

P: n/a

Care to name some?

C++ applications include Microsoft Office, Internet Explorer, Adobe
Photoshop, Illustrator and Acrobat. I understand that Macromedia's Web
Development apps are also written in C++.

See here for a long list:

http://www.research.att.com/~bs/applications.html

What does that guy know. Windows XP is using ".net" stuff now.
For example Visual Basic is in this directory.

C:\WINDOWS\assembly\GAC\Microsoft.VisualBasic\7.0. 5000.0__b03f5f7f11d50a3a
Jul 23 '05 #15

P: n/a
Thomas Fritsch wrote:
alex goldman wrote:
Dave wrote:

There are many commercial software packages written in C++ (over 95%).
There are very few written in Java.

Huh?


If you mean "commercial software packages currently in the process of
being written":
I think it is very likely, that 95% of them are in Java.

Well, I was kidding. 30% Java is probably closer to reality.

If you mean "commercial software packages used now and written at some
time in the past":
I think it is very likely, that 95% of them are in C++.

Jul 23 '05 #16

P: n/a
Remon van Vliet wrote:
"John Carson" <jc****************@netspace.net.au> wrote in message
news:d9***********@otis.netspace.net.au...
"Remon van Vliet" <re***@exmachina.nl> wrote in message
news:42***********************@news.xs4all.nl
"alex goldman" <he***@spamm.er> wrote in message
news:13****************@yahoo.com...

Dave wrote:
>There are many commercial software packages written in C++ (over
>95%). There are very few written in Java.

Not sure where you got that wisdom from but it is factually untrue. I
sincerely doubt that 95% of the application being written today are
C++. That this may have been the case in the past (i doubt that as
well, but still) is irrelevant. At one point 95% of the programs were
written in assembler, that doesnt mean C++ wouldnt have been the
better alternative if it were available.

Note that i'm not claiming Java is better than C++ or anything else,
each has it's uses. But plenty of commercial apps have been written
in Java


Care to name some?

C++ applications include Microsoft Office, Internet Explorer, Adobe
Photoshop, Illustrator and Acrobat. I understand that Macromedia's Web
Development apps are also written in C++.


You're naming desktop apps only, that's a relatively small percentage of
application being developed.


Note that he said commercial applications. That would preclude a lot of
custom web applications you may be banking on on the Java side of the
ledger.

That said, this kind of statistic is very difficult to ascertain. Most
commercial applications do not advertise what language they are written in.

Ray

--
XML is the programmer's duct tape.
Jul 23 '05 #17

P: n/a
Thomas Fritsch wrote:
Thomas Fritsch wrote:
alex goldman wrote:
Dave wrote:
There are many commercial software packages written in C++ (over 95%).
There are very few written in Java.
Huh?


If you mean "commercial software packages currently in the process of
being written":
I think it is very likely, that 95% of them are in Java.

Well, I was kidding. 30% Java is probably closer to reality.


But that 30% is a very significant 30%. Java's application servers really
did catch the C++ community off guard. C++ programmers look(ed) at all the
features that Java lacks and conclude(d) that C++ is(was) a superior
language. What they fail(ed) to look is what Java does provide over C++.
I've seen a good many experienced C++ programmers switch from scoffing at
Java to using Java. Few have moved in the opposite direction.

There aren't a whole lot who have looked at Java carefully and tried to
address the deficiencies of C++ as a result of their observations. I really
don't know what is happening with regard to C#, but I suspect there is a
growing challenge from that direction as well. C++ designers would do well
to examine the features that make these languages attractive. It really
isn't as simple as disallowing assignment in an if condition. To me the
three key aspects that make Java attractive are introspection, organization
and portability. I'll leave my dislike of the CPP off the list for now.
--
If our hypothesis is about anything and not about some one or more
particular things, then our deductions constitute mathematics. Thus
mathematics may be defined as the subject in which we never know what we
are talking about, nor whether what we are saying is true.-Bertrand Russell
Jul 23 '05 #18

P: n/a
"Remon van Vliet" <re***@exmachina.nl> wrote in message
news:42***********************@news.xs4all.nl
"John Carson" <jc****************@netspace.net.au> wrote in message
news:d9***********@otis.netspace.net.au...
"Remon van Vliet" <re***@exmachina.nl> wrote in message
news:42***********************@news.xs4all.nl
"alex goldman" <he***@spamm.er> wrote in message
news:13****************@yahoo.com...
Dave wrote:

>
> There are many commercial software packages written in C++ (over
> 95%). There are very few written in Java.

Not sure where you got that wisdom from but it is factually untrue.
I sincerely doubt that 95% of the application being written today
are C++. That this may have been the case in the past (i doubt that
as well, but still) is irrelevant. At one point 95% of the programs
were written in assembler, that doesnt mean C++ wouldnt have been
the better alternative if it were available.

Note that i'm not claiming Java is better than C++ or anything else,
each has it's uses. But plenty of commercial apps have been written
in Java


Care to name some?

C++ applications include Microsoft Office, Internet Explorer, Adobe
Photoshop, Illustrator and Acrobat. I understand that Macromedia's
Web Development apps are also written in C++.

You're naming desktop apps only, that's a relatively small percentage
of application being developed.


The original statement referred to "commercial software packages" which I
take to mean something that you can buy off the shelf. I understand that the
most popular language for in-house development is Visual Basic.

--
John Carson

Jul 23 '05 #19

P: n/a
"Lucy" <lu**@nospam.invalid> wrote in message
news:br********************@comcast.com

See here for a long list:

http://www.research.att.com/~bs/applications.html

What does that guy know. Windows XP is using ".net" stuff now.
For example Visual Basic is in this directory.

C:\WINDOWS\assembly\GAC\Microsoft.VisualBasic\7.0. 5000.0__b03f5f7f11d50a3a


The significance of this directory entry is not as clear to me as it
apparently is to you.

It is certainly true that Microsoft is moving some of its development to the
..Net framework. Stroustrup acknowledges this when he comments "Some parts of
Visual Studio like the Base Class Libraries that ship with the .NET
Framework were written using C# but the C# compiler itself is written in
C++."

Bits and pieces of a variety of Microsoft apps are now written using C# (and
presumably one of the versions of managed C++). It remains to be seen how
far this change will go, but my understanding is that it has not yet gone
very far.

--
John Carson

Jul 23 '05 #20

P: n/a
..NET still only works on Windows Platform. Is that correct? It will be
very slow to run on VM. For commercial software, C++ is still the best
choice.

Jul 23 '05 #21

P: n/a
<jr********@hotmail.com> wrote in message
news:11*********************@g47g2000cwa.googlegro ups.com
.NET still only works on Windows Platform. Is that correct?


There are attempts to clone it for use on Linux --- the Mono Project.

http://www.mono-project.com/Main_Page

I haven't really followed the progress of the Mono Project but my impression
of all of these Microsoft-cloning attempts is that they are always
works-in-progress and are never going to appeal to people who want something
that "just works".

--
John Carson

Jul 23 '05 #22

P: n/a
jr********@hotmail.com wrote:
.NET still only works on Windows Platform. Is that correct? It will be
very slow to run on VM. For commercial software, C++ is still the best
choice.

I'm not sure why running on a VM will necessarily be "very slow". Some
things might be marginally slower, such as loadtimes, but instructions are
instructions. Calling a single instruction from the hardware instruction
set is no different when it is done by a virtual machine or by a program
running directly on the OS. The big difference is likely to come from the
ability of the C++ compiler to optimize code for the OS. If people come up
with ways of doing that for bytecode executed on a virtual machine, the
only difference in performance will come from factors such as the ability
to arrange source code in ways that enhances performance such as using
compositors.

In answer to the question about .NET:
http://www.go-mono.com/
--
If our hypothesis is about anything and not about some one or more
particular things, then our deductions constitute mathematics. Thus
mathematics may be defined as the subject in which we never know what we
are talking about, nor whether what we are saying is true.-Bertrand Russell
Jul 23 '05 #23

P: n/a
John Carson wrote:
"Remon van Vliet" <re***@exmachina.nl> wrote in message
news:42***********************@news.xs4all.nl
"alex goldman" <he***@spamm.er> wrote in message
news:13****************@yahoo.com...
Dave wrote:
There are many commercial software packages written in C++ (over
95%). There are very few written in Java.

Not sure where you got that wisdom from but it is factually untrue. I
sincerely doubt that 95% of the application being written today are
C++. That this may have been the case in the past (i doubt that as
well, but still) is irrelevant. At one point 95% of the programs were
written in assembler, that doesnt mean C++ wouldnt have been the
better alternative if it were available.

Note that i'm not claiming Java is better than C++ or anything else,
each has it's uses. But plenty of commercial apps have been written
in Java

Care to name some?

C++ applications include Microsoft Office, Internet Explorer, Adobe
Photoshop, Illustrator and Acrobat. I understand that Macromedia's Web
Development apps are also written in C++.

See here for a long list:

http://www.research.att.com/~bs/applications.html

I know of two off the top of my head not written by Sun. Workbrain is a
payroll system my employer is currently implementing which is written in
Java. "Chrome" is a FPS game written in Java. And there is LimeWire
which claims to be the fastest file sharing program available.

And if you count applications written by Sun, "StarOffice" isn't all
that bad.

Those are the examples I have used that I know are written in Java. I
am sure there are many more out there.
Chrome
http://www.chromethegame.com/

Workbrain
http://www.workbrain.com/

StarOffice
http://www.staroffice.com/

LimeWire
http://www.limewire.com/
Jul 23 '05 #24

P: n/a
On Fri, 24 Jun 2005 13:46:47 +0100, Brooks Hagenow
<bh******@sbcglobal-nope.net> wrote:
Care to name some?
C++ applications include Microsoft Office, Internet Explorer, Adobe
Photoshop, Illustrator and Acrobat. I understand that Macromedia's Web
Development apps are also written in C++.
See here for a long list:
http://www.research.att.com/~bs/applications.html

I know of two off the top of my head not written by Sun. Workbrain is a
payroll system my employer is currently implementing which is written in
Java. "Chrome" is a FPS game written in Java. And there is LimeWire
which claims to be the fastest file sharing program available.

And if you count applications written by Sun, "StarOffice" isn't all
that bad.

Those are the examples I have used that I know are written in Java. I
am sure there are many more out there.


StarOffice may use Java for some things but I think it's primarily C++.

Obviously there's all the Java commercial development tools like IntelliJ
and JBuilder. Surprisingly, some versions of C++ Builder are also written
in Java (I know the earlier versions were native but the Mobile Edition I
have installed here is Java at least - I don't know if that's the case for
the latest full edition). Most of Oracle's admin tools were Java too last
time I used Oracle.

Other commercial Java desktop apps include Poseidon UML and SmartCVS.

Moving away from the desktop, there's lost of commercial mobile software
written for J2ME (mainly games).

That said, most commercial Java development is server side. Where Swing
is used commercially it tends, in my experience, to be in more bespoke
development rather than off-the-shelf software.
Dan.

--
Daniel Dyer
http://www.footballpredictions.net
Jul 23 '05 #25

P: n/a
Brooks Hagenow wrote:
John Carson wrote:
I know of two off the top of my head not written by Sun. Workbrain is a
payroll system my employer is currently implementing which is written in
Java. "Chrome" is a FPS game written in Java. And there is LimeWire
which claims to be the fastest file sharing program available.

And if you count applications written by Sun, "StarOffice" isn't all
that bad.


Sun didn't write StarOffice, nor is it written in Java:

#ifdef PRODUCT
#error Wer fummelt denn an den makefiles rum?
#endif
#pragma hdrstop

#include "dbg_lay.hxx"

#ifndef _STREAM_HXX //autogen
#include <tools/stream.hxx>
#endif

#ifndef _SVSTDARR_HXX
#define _SVSTDARR_USHORTS
#define _SVSTDARR_USHORTSSORT
#define _SVSTDARR_LONGS
#include <svtools/svstdarr.hxx>
#endif

#include <stdio.h>

#include "frame.hxx"
#include "layfrm.hxx"
#include "flyfrm.hxx"
#include "txtfrm.hxx"
#include "ndtxt.hxx"
#include "dflyobj.hxx"
#ifndef _FNTCACHE_HXX
#include <fntcache.hxx>
#endif
// OD 2004-05-24 #i28701#
#ifndef _SORTEDOBJS_HXX
#include <sortedobjs.hxx>
#endif

ULONG SwProtocol::nRecord = 0;
SwImplProtocol* SwProtocol::pImpl = NULL;

ULONG lcl_GetFrameId( const SwFrm* pFrm )
{
#ifndef PRODUCT
static BOOL bFrameId = FALSE;
if( bFrameId )
return pFrm->GetFrmId();
#endif
if( pFrm && pFrm->IsTxtFrm() )
return ((SwTxtFrm*)pFrm)->GetTxtNode()->GetIndex();
return 0;
}

class SwImplProtocol
{
SvFileStream *pStream; // Ausgabestream
SvUShortsSort *pFrmIds; // welche FrmIds sollen aufgezeichnet werden
( NULL == alle )
SvLongs *pVar; // Variables
ByteString aLayer; // Einrueckung der Ausgabe (" " pro
Start/End)
USHORT nTypes; // welche Typen sollen aufgezeichnet werden
USHORT nLineCount; // Ausgegebene Zeilen
USHORT nMaxLines; // Maximal auszugebende Zeilen
BYTE nInitFile; // Bereich (FrmId,FrmType,Record) beim Einlesen der
INI-Datei
BYTE nTestMode; // Special fuer Testformatierung, es wird ggf. nur
// innerhalb einer Testformatierung aufgezeichnet.
void _Record( const SwFrm* pFrm, ULONG nFunction, ULONG nAct, void*
pParam );
BOOL NewStream();
void CheckLine( ByteString& rLine );
void SectFunc( ByteString &rOut, const SwFrm* pFrm, ULONG nAct, void*
pParam );
public:
SwImplProtocol();
~SwImplProtocol();
// Aufzeichnen
void Record( const SwFrm* pFrm, ULONG nFunction, ULONG nAct, void* pParam )
{ if( pStream ) _Record( pFrm, nFunction, nAct, pParam ); }
BOOL InsertFrm( USHORT nFrmId ); // FrmId aufnehmen zum Aufzeichnen
BOOL DeleteFrm( USHORT nFrmId ); // FrmId entfernen, diesen nicht mehr
Aufzeichnen
void FileInit(); // Auslesen der INI-Datei
void ChkStream() { if( !pStream ) NewStream(); }
void SnapShot( const SwFrm* pFrm, ULONG nFlags );
void GetVar( const USHORT nNo, long& rVar )
{ if( pVar && nNo < pVar->Count() ) rVar = (*pVar)[ nNo ]; }
};

/* -----------------11.01.99 10:43-------------------
* Durch das PROTOCOL_ENTER-Makro wird ein SwEnterLeave-Objekt erzeugt,
* wenn die aktuelle Funktion aufgezeichnet werden soll, wird ein
* SwImplEnterLeave-Objekt angelegt. Der Witz dabei ist, das der Ctor
* des Impl-Objekt am Anfang der Funktion und automatisch der Dtor beim
* Verlassen der Funktion gerufen wird. In der Basis-Implementierung ruft
* der Ctor lediglich ein PROTOCOL(..) mit ACT_START und im Dtor ein
* PROTOCOL(..) mit ACT_END.
* Es lassen sich Ableitungen der Klasse bilden, um z.B. beim Verlassen
* einer Funktion Groessenaenderungen des Frames zu dokumentieren u.v.a.m.
* Dazu braucht dann nur noch in SwEnterLeave::Ctor(...) die gewuenschte
* SwImplEnterLeave-Klasse angelegt zu werden.
*
* --------------------------------------------------*/

class SwImplEnterLeave
{
protected:
const SwFrm* pFrm; // Der Frame,
ULONG nFunction, nAction; // die Funktion, ggf. die Aktion
void* pParam; // und weitere Parameter
public:
SwImplEnterLeave( const SwFrm* pF, ULONG nFunct, ULONG nAct, void* pPar )
: pFrm( pF ), nFunction( nFunct ), nAction( nAct ), pParam( pPar ) {}
virtual void Enter(); // Ausgabe beim Eintritt
virtual void Leave(); // Ausgabe beim Verlassen
};

class SwSizeEnterLeave : public SwImplEnterLeave
{
long nFrmHeight;
public:
SwSizeEnterLeave( const SwFrm* pF, ULONG nFunct, ULONG nAct, void* pPar )
: SwImplEnterLeave( pF, nFunct, nAct, pPar ),
nFrmHeight( pF->Frm().Height() ) {}
virtual void Leave(); // Ausgabe der Groessenaenderung
};

class SwUpperEnterLeave : public SwImplEnterLeave
{
USHORT nFrmId;
public:
SwUpperEnterLeave( const SwFrm* pF, ULONG nFunct, ULONG nAct, void* pPar )
: SwImplEnterLeave( pF, nFunct, nAct, pPar ), nFrmId( 0 ) {}
virtual void Enter(); // Ausgabe
virtual void Leave(); // Ausgabe der FrmId des Uppers
};

class SwFrmChangesLeave : public SwImplEnterLeave
{
SwRect aFrm;
public:
SwFrmChangesLeave( const SwFrm* pF, ULONG nFunct, ULONG nAct, void* pPar )
: SwImplEnterLeave( pF, nFunct, nAct, pPar ), aFrm( pF->Frm() ) {}
virtual void Enter(); // keine Ausgabe
virtual void Leave(); // Ausgabe bei Aenderung der Frm-Area
};

void SwProtocol::Record( const SwFrm* pFrm, ULONG nFunction, ULONG nAct,
void* pParam )
{
if( Start() )
{ // Hier landen wir, wenn im Debugger SwProtocol::nRecord mit
PROT_INIT(0x1) oderiert wurde
BOOL bFinit = FALSE; // Dies bietet im Debugger die Moeglichkeit,
if( bFinit ) // die Aufzeichnung dieser Action zu beenden
{
nRecord &= ~nFunction; // Diese Funktion nicht mehr aufzeichnen
nRecord &= ~PROT_INIT; // PROT_INIT stets zuruecksetzen
return;
}
nRecord |= nFunction; // Aufzeichnung dieser Funktion freischalten
nRecord &= ~PROT_INIT; // PROT_INIT stets zuruecksetzen
if( pImpl )
pImpl->ChkStream();
}
if( !pImpl ) // Impl-Object anlegen, wenn noetig
pImpl = new SwImplProtocol();
pImpl->Record( pFrm, nFunction, nAct, pParam ); // ...und Aufzeichnen
}

// Die folgende Funktion wird beim Anziehen der Writer-DLL durch TxtInit(..)
aufgerufen
// und ermoeglicht dem Debuggenden Funktionen und/oder FrmIds freizuschalten

OTOH:

BEA WebLogic is written in Java, and is used by a great many DoD sites.

http://www.bea.com/framework.jsp?CNT...ntent/products
--
If our hypothesis is about anything and not about some one or more
particular things, then our deductions constitute mathematics. Thus
mathematics may be defined as the subject in which we never know what we
are talking about, nor whether what we are saying is true.-Bertrand Russell
Jul 23 '05 #26

P: n/a
"Brooks Hagenow" <bh******@sbcglobal-nope.net> wrote in message
news:Xg****************@newssvr33.news.prodigy.com

I know of two off the top of my head not written by Sun. Workbrain
is a payroll system my employer is currently implementing which is
written in Java. "Chrome" is a FPS game written in Java. And there
is LimeWire which claims to be the fastest file sharing program
available.
And if you count applications written by Sun, "StarOffice" isn't all
that bad.
Those are the examples I have used that I know are written in Java. I
am sure there are many more out there.


What makes you think that StarOffice is written in Java? I went to the site
of its close relative, OpenOffice, and there I read:

"The OpenOffice.org source code includes the technology which Sun
Microsystems has been developing for the future versions of StarOffice(TM)
software. The source is written in C++ and delivers language-neutral and
scriptable functionality, including Java(TM) APIs."

http://about.openoffice.org/index.html

Enough said really.
--
John Carson

Jul 23 '05 #27

P: n/a
John Carson wrote:

What makes you think that StarOffice is written in Java? I went to the
site of its close relative, OpenOffice, and there I read:

"The OpenOffice.org source code includes the technology which Sun
Microsystems has been developing for the future versions of StarOffice(TM)
software. The source is written in C++ and delivers language-neutral and
scriptable functionality, including Java(TM) APIs."

http://about.openoffice.org/index.html

Enough said really.


Most of what you find here is written in Java:
https://www.us.army.mil/suite/login/welcome.html
--
If our hypothesis is about anything and not about some one or more
particular things, then our deductions constitute mathematics. Thus
mathematics may be defined as the subject in which we never know what we
are talking about, nor whether what we are saying is true.-Bertrand Russell
Jul 23 '05 #28

P: n/a
Raymond DeCampo <no****@twcny.rr.com> writes:
Note that he said commercial applications. That would preclude a lot
of custom web applications you may be banking on on the Java side of
the ledger.


When company A pays company B $2 million to develop a Java app that is
a commercial app. Unless you redefine commercial to mean shelfware or
somesuch.

(MSIE is not a commercial app but - according to the vendor - a
component in Windows.)
Jul 23 '05 #29

P: n/a
"Daniel Dyer" <da*@footballnospamformepleasepredictions.net> writes:
Surprisingly, some versions of C++ Builder
are also written in Java (I know the earlier versions were native but
the Mobile Edition I have installed here is Java at least - I don't
know if that's the case for the latest full edition).
The C++BuilderX IDEs are written in Java.
Other commercial Java desktop apps include Poseidon UML and SmartCVS.


Plus project planning tool GDPM Tools.

The big issue regarding Java desktop apps has to do with install
complexities; the C++ and Delphi worlds have better installers. In
theory, installing an app for Java should be as easy as the "xcopy
deployment" Microsoft claims for .Net, but just as with that
technology you need the runtime installed, and common libraries
referenced (not all install to lib/ext in a clean fashion).

JNLP and in particular the most common implementation - Java Web Start
- helps a lot though.

Sun has a list of Swing applications at

http://java.sun.com/products/jfc/tsc/sightings/S21.html

(that's the most recent page, there are earlier ones too).
Jul 23 '05 #30

P: n/a
Tor Iver Wilhelmsen wrote:
Raymond DeCampo <no****@twcny.rr.com> writes:

Note that he said commercial applications. That would preclude a lot
of custom web applications you may be banking on on the Java side of
the ledger.

When company A pays company B $2 million to develop a Java app that is
a commercial app. Unless you redefine commercial to mean shelfware or
somesuch.


That was my understanding of the term. WikiPedia agrees, citing
shrinkware as a synonym:

<http://en.wikipedia.org/wiki/Commercial_software>

However, I recognize that reasonable people can disagree on this matter
and even the WikiPedia article is open to interpretation. Another
reason statistics like this are impossible to obtain.

Ray

--
XML is the programmer's duct tape.
Jul 23 '05 #31

P: n/a

"John Carson" <jc****************@netspace.net.au> wrote in message
news:d9***********@otis.netspace.net.au...
"Lucy" <lu**@nospam.invalid> wrote in message
news:br********************@comcast.com

See here for a long list:

http://www.research.att.com/~bs/applications.html
What does that guy know. Windows XP is using ".net" stuff now.
For example Visual Basic is in this directory.

C:\WINDOWS\assembly\GAC\Microsoft.VisualBasic\7.0. 5000.0__b03f5f7f11d50a3a
The significance of this directory entry is not as clear to me as it
apparently is to you.

It is certainly true that Microsoft is moving some of its development to the .Net framework. Stroustrup acknowledges this when he comments "Some parts of Visual Studio like the Base Class Libraries that ship with the .NET
Framework were written using C# but the C# compiler itself is written in
C++."
And C++ is/was written in "C", so what?

Bits and pieces of a variety of Microsoft apps are now written using C# (and presumably one of the versions of managed C++). It remains to be seen how
far this change will go, but my understanding is that it has not yet gone
very far.

--
John Carson

Jul 23 '05 #32

P: n/a

<jr********@hotmail.com> wrote in message
news:11*********************@g47g2000cwa.googlegro ups.com...
.NET still only works on Windows Platform. Is that correct? It will be
very slow to run on VM. For commercial software, C++ is still the best
choice.


Best for what? My washing machine doesn't use C++.
Jul 23 '05 #33

P: n/a
"Joan" <Jo**@nospam.invalid> wrote in message
news:ed********************@comcast.com
"John Carson" <jc****************@netspace.net.au> wrote in message
news:d9***********@otis.netspace.net.au...

It is certainly true that Microsoft is moving some of its
development to the .Net framework. Stroustrup acknowledges this when
he comments "Some parts of Visual Studio like the Base Class
Libraries that ship with the .NET Framework were written using C#
but the C# compiler itself is written in C++."


And C++ is/was written in "C", so what?


Stroustrup was discussing the full range of C++ uses. Accordingly, the use
of C++ in the writing of compilers is an appropriate thing to mention. I was
discussing application programs, so compiler writing has no relevance to my
point, but I prefer to quote complete sentences.

--
John Carson

Jul 23 '05 #34

P: n/a
"Joan" <Jo**@nospam.invalid> wrote in message
news:ed********************@comcast.com
<jr********@hotmail.com> wrote in message
news:11*********************@g47g2000cwa.googlegro ups.com...
.NET still only works on Windows Platform. Is that correct? It will
be very slow to run on VM. For commercial software, C++ is still the
best choice.


Best for what? My washing machine doesn't use C++.


How do you know?

--
John Carson
Jul 23 '05 #35

P: n/a
"John Carson" <jc****************@netspace.net.au> wrote in message
news:d9***********@otis.netspace.net.au
"Joan" <Jo**@nospam.invalid> wrote in message
news:ed********************@comcast.com
"John Carson" <jc****************@netspace.net.au> wrote in message
news:d9***********@otis.netspace.net.au...

It is certainly true that Microsoft is moving some of its
development to the .Net framework. Stroustrup acknowledges this when
he comments "Some parts of Visual Studio like the Base Class
Libraries that ship with the .NET Framework were written using C#
but the C# compiler itself is written in C++."


And C++ is/was written in "C", so what?


Stroustrup was discussing the full range of C++ uses. Accordingly,
the use of C++ in the writing of compilers is an appropriate thing to
mention. I was discussing application programs, so compiler writing
has no relevance to my point, but I prefer to quote complete
sentences.


Actually, now that I think of it, I was discussing off-the-shelf
applications, and the C# compiler is one of them. Further, the original C++
compiler would have been written in C, but that is no longer the case. C++
compilers are now written in C++.

--
John Carson

Jul 23 '05 #36

P: n/a

"John Carson" <jc****************@netspace.net.au> wrote in message
news:d9***********@otis.netspace.net.au...
"Joan" <Jo**@nospam.invalid> wrote in message
news:ed********************@comcast.com
<jr********@hotmail.com> wrote in message
news:11*********************@g47g2000cwa.googlegro ups.com...
.NET still only works on Windows Platform. Is that correct? It will
be very slow to run on VM. For commercial software, C++ is still the
best choice.
Best for what? My washing machine doesn't use C++.


How do you know?


It has the TMS-1000 chip which is programmed in machine code.

--
John Carson

Jul 23 '05 #37

P: n/a

"John Carson" <jc****************@netspace.net.au> wrote in message
news:d9***********@otis.netspace.net.au...
"John Carson" <jc****************@netspace.net.au> wrote in message
news:d9***********@otis.netspace.net.au
"Joan" <Jo**@nospam.invalid> wrote in message
news:ed********************@comcast.com
"John Carson" <jc****************@netspace.net.au> wrote in message
news:d9***********@otis.netspace.net.au...

It is certainly true that Microsoft is moving some of its
development to the .Net framework. Stroustrup acknowledges this when
he comments "Some parts of Visual Studio like the Base Class
Libraries that ship with the .NET Framework were written using C#
but the C# compiler itself is written in C++."

And C++ is/was written in "C", so what?

Stroustrup was discussing the full range of C++ uses. Accordingly,
the use of C++ in the writing of compilers is an appropriate thing to
mention. I was discussing application programs, so compiler writing
has no relevance to my point, but I prefer to quote complete
sentences.


Actually, now that I think of it, I was discussing off-the-shelf


I think MS still has a free C# that is not ots, but you can download it.
applications, and the C# compiler is one of them. Further, the original C++ compiler would have been written in C, but that is no longer the case. C++
compilers are now written in C++.

--
John Carson

Jul 23 '05 #38

P: n/a
In article <kY********************@comcast.com>,
Joan <Jo**@nospam.invalid> wrote:

It has the TMS-1000 chip which is programmed in machine code.


How can you be certain there aren't C++ compilers for this chip?

Cheers
Bent D
--
Bent Dalager - bc*@pvv.org - http://www.pvv.org/~bcd
powered by emacs
Jul 23 '05 #39

P: n/a

"Bent C Dalager" <bc*@pvv.ntnu.no> wrote in message
news:d9**********@orkan.itea.ntnu.no...
In article <kY********************@comcast.com>,
Joan <Jo**@nospam.invalid> wrote:

It has the TMS-1000 chip which is programmed in machine code.


How can you be certain there aren't C++ compilers for this chip?


Don't fit, the TMS-1000 has only 1Kbyte of ROM, and 32 byte RAM.
Jul 23 '05 #40

P: n/a
In article <3p********************@comcast.com>,
Joan <Jo**@nospam.invalid> wrote:

"Bent C Dalager" <bc*@pvv.ntnu.no> wrote in message
news:d9**********@orkan.itea.ntnu.no...
In article <kY********************@comcast.com>,
Joan <Jo**@nospam.invalid> wrote:
>
>It has the TMS-1000 chip which is programmed in machine code.


How can you be certain there aren't C++ compilers for this chip?


Don't fit, the TMS-1000 has only 1Kbyte of ROM, and 32 byte RAM.


Assuming that C++ has managed to deliver on "you don't pay for what
you don't use," I don't see why you shouldn't be able to use it in
this case. Granted, the program might not do much more than define the
state table and a small FSM but it should still be more managable and
maintainable than if it were in assembly.

But I suspect I am drifting off topic :-)

Cheers
Bent D
--
Bent Dalager - bc*@pvv.org - http://www.pvv.org/~bcd
powered by emacs
Jul 23 '05 #41

P: n/a
In article <d9***********@otis.netspace.net.au>,
John Carson <jc****************@netspace.net.au> wrote:

Care to name some?


The Encyclopaedia Britannica 2004 suite is written in Java. This is
the sort of software any random household may end up using for some
reason or other.

Cheers
Bent D
--
Bent Dalager - bc*@pvv.org - http://www.pvv.org/~bcd
powered by emacs
Jul 23 '05 #42

P: n/a
"Bent C Dalager" <bc*@pvv.ntnu.no> wrote in message
news:d9**********@orkan.itea.ntnu.no
In article <d9***********@otis.netspace.net.au>,
John Carson <jc****************@netspace.net.au> wrote:

Care to name some?


The Encyclopaedia Britannica 2004 suite is written in Java. This is
the sort of software any random household may end up using for some
reason or other.


No great surprise there. I have the 2000 edition and it functions rather
like a web server, only not as well (you need to have Internet Explorer
installed to use it). The box declares that the program was "Made with
Macromedia".

--
John Carson

Jul 23 '05 #43

P: n/a
Bent C Dalager wrote:
In article <d9***********@otis.netspace.net.au>,
John Carson <jc****************@netspace.net.au> wrote:

Care to name some?


The Encyclopaedia Britannica 2004 suite is written in Java. This is
the sort of software any random household may end up using for some
reason or other.


Does it work on any platform with a JVM then?
Jul 23 '05 #44

P: n/a
John Carson wrote:
The original statement referred to "commercial software packages" which
I take to mean something that you can buy off the shelf. I understand
that the most popular language for in-house development is Visual Basic.


There's a significant amount of software that doesn't fall into either
of these buckets. There's a spectrum of solutions between "off the
shelf" and "custom"; some products are partially-to-mostly OTS but need
custom code to integrate them at a customer site.
Jul 23 '05 #45

P: n/a
In article <19****************@yahoo.com>,
alex goldman <he***@spamm.er> wrote:

Does it work on any platform with a JVM then?


I haven't tried it on anything but Windows so I wouldn't know.

Bent.
--
Bent Dalager - bc*@pvv.org - http://www.pvv.org/~bcd
powered by emacs
Jul 23 '05 #46

P: n/a
Java is also pretty keen when you want a UI on a cross platform app, and
cannot justify distinct development branches. Dundjinni does this, so
they can produce a cross platform RPG mapping tool.

Matlab is apparently moving in this direction for their front end, as
X11 has performance implications that they are not entirely happy with,
and is not that well received on some platforms. In their case, they
would love one essential front end body of code that works on Linux,
Mac, and Windows platforms.

Scott

--
Scott Ellsworth
sc***@alodar.nospam.com
Java and database consulting for the life sciences
Jul 23 '05 #47

P: n/a
On Fri, 24 Jun 2005 21:16:01 +0800, Daniel Dyer wrote
(in article <op***************@cgl0517.chaucer.co.uk>):
On Fri, 24 Jun 2005 13:46:47 +0100, Brooks Hagenow
<bh******@sbcglobal-nope.net> wrote:
Care to name some?
C++ applications include Microsoft Office, Internet Explorer, Adobe
Photoshop, Illustrator and Acrobat. I understand that Macromedia's Web
Development apps are also written in C++.
See here for a long list:
http://www.research.att.com/~bs/applications.html

I know of two off the top of my head not written by Sun. Workbrain is a
payroll system my employer is currently implementing which is written in
Java. "Chrome" is a FPS game written in Java. And there is LimeWire
which claims to be the fastest file sharing program available.

And if you count applications written by Sun, "StarOffice" isn't all
that bad.

Those are the examples I have used that I know are written in Java. I
am sure there are many more out there.


StarOffice may use Java for some things but I think it's primarily C++.

Obviously there's all the Java commercial development tools like IntelliJ
and JBuilder. Surprisingly, some versions of C++ Builder are also written
in Java (I know the earlier versions were native but the Mobile Edition I
have installed here is Java at least - I don't know if that's the case for
the latest full edition). Most of Oracle's admin tools were Java too last
time I used Oracle.

Other commercial Java desktop apps include Poseidon UML and SmartCVS.

Moving away from the desktop, there's lost of commercial mobile software
written for J2ME (mainly games).

That said, most commercial Java development is server side. Where Swing
is used commercially it tends, in my experience, to be in more bespoke
development rather than off-the-shelf software.
Dan.


a lot of oracle products are written in java ( not including the database)

Jdeveloper
formsbuilder
Calanderclient.

also if you look round source forge, the "big dirty" is being done on a lot
of java apps.
they used to be "free", but they are converting to commercial apps.

Jasperreports

and i would suspect Ireports some time in the future, as the author is NOT
including code from outside sources in his project
Jul 23 '05 #48

This discussion thread is closed

Replies have been disabled for this discussion.