473,406 Members | 2,549 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

C++ and Java

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
47 3486
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
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
* 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
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
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
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
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
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

"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
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
"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

"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
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

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
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
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
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
"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
"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
..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
<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
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
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
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
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
"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
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
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
"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
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

"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

<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
"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
"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
"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

"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

"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
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

"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
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
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
"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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Ravi Tallury | last post by:
Hi We are having issues with our application, certain portions of it stop responding while the rest of the application is fine. I am attaching the Java Core dump. If someone can let me know what...
1
by: ptaz | last post by:
Hi I'm trying to run a web page but I get the following error. Ca anyone please tell me a solution to this. Thanks Ptaz HTTP Status 500 - type Exception report
11
by: DrUg13 | last post by:
In java, this seems so easy. You need a new object Object test = new Object() gives me exactly what I want. could someone please help me understand the different ways to do the same thing in...
0
by: mailkhurana | last post by:
Hii , I am trying to use a type 2 driver to connect to DB2 0n AIX 5 I have a small java test to class to establish a conneciton with the db .. I am NOT using WAS or any appserver When I try to...
1
by: David Van D | last post by:
Hi there, A few weeks until I begin my journey towards a degree in Computer Science at Canterbury University in New Zealand, Anyway the course tutors are going to be teaching us JAVA wth bluej...
12
by: Mark Fink | last post by:
I wrote a Jython class that inherits from a Java class and (thats the plan) overrides one method. Everything should stay the same. If I run this nothing happens whereas if I run the Java class it...
0
by: jaywak | last post by:
Just tried running some code on Linux (2.4.21-32.0.1.EL and Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_04-b05)) and Windows XPSP2 (with Java HotSpot(TM) Client VM (build...
1
by: jaimemartin | last post by:
hello, I want to validate an xml by means of a schema (xsd). To do that first of all I´m using a SchemaFactory. The problem is that if I run the code in Windows all works fine, but If I run it in...
0
oll3i
by: oll3i | last post by:
package library.common; import java.sql.ResultSet; public interface LibraryInterface { public ResultSet getBookByAuthor(String author); public ResultSet getBookByName(String name);
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.