Future reuse of code

G

goose

Richard Plinston said:
There is Waba which is a JVM for smaller machines such as Palm and CE PDAs.
There is even a version for MS-DOS, one for GameBoy, and a version for TI
Calculators.

(see http://www.wabasoft.com )

you miss the point. not only does C also target all the platforms
that java does, it targets a whole lot more as well.

goose,
following the one true brace style :)
 
R

Roedy Green

Haven't been there but lived real close in Guildford at one stage -
reading you C and Java people, I feel like a Wimbledon spectator with my
head zinging from left to right as the opponents take a swipe at the
ball !

If you want to write cross platform code in C++ you have to buy a
rather expensive cross platform library, something like Rogue Wave.
C++ or C out the box is far from being cross platform. What you can
do is write code that can be tweaked to run on another platform, or
you can create a set of macros to make the same code base run on one
or two platforms. However the C and C++ are not naturally
multiplatform. They are lower level languages. That is why they are
used for JNI when you want to get personal with the OS.

C is much more cross platform in the Unix world, but when you throw in
Windows and the Mac, you pretty well have to start from scratch. With
C and C++ you interface directly with the OS. With Java there is a
buffering layer of standard class libraries.

The language wars are for the most part kid nya nya games. You need
both C++ and Java for different things. There are not many places
where you would you would use pure C now instead of C++, perhaps a
device driver or some code to fit in an embedded device.

It is like arguing which is better a wrench or a screwdriver.
 
M

Mark Gordon

If you want to write cross platform code in C++ you have to buy a
rather expensive cross platform library, something like Rogue Wave.

Completely wrong. I work on an applications with about 200,000 lines of
C code + a lot of lines of code in a scripting language, where
the interpretor for the scripting language is part of the C source I
just mentioned. The same source code is used for building both the
Windows and various Linux versions with us paying exactly nothing for
cross platform libraries.

This application is very heavily used by a number of large companies in
the UK with literally hundreds of simultaneous users of the application
on a single machine.
C++ or C out the box is far from being cross platform. What you can
do is write code that can be tweaked to run on another platform, or
you can create a set of macros to make the same code base run on one
or two platforms. However the C and C++ are not naturally
multiplatform. They are lower level languages. That is why they are
used for JNI when you want to get personal with the OS.

C is much more cross platform in the Unix world, but when you throw in
Windows and the Mac, you pretty well have to start from scratch. With
C and C++ you interface directly with the OS.

the languages are entirely cross platform. The extensions required for
handling platform specifics are usually a very small isolated part of
a large well written program.
With Java there is a
buffering layer of standard class libraries.

The language wars are for the most part kid nya nya games. You need
both C++ and Java for different things. There are not many places
where you would you would use pure C now instead of C++, perhaps a
device driver or some code to fit in an embedded device.

It is like arguing which is better a wrench or a screwdriver.

Yes, they are useful for different things, but for a large number of
applications cross-platform is not an advantage of Java over C because C
is cross platform as proved by my using the same source on completely
different platforms. I've even used the same source code (a few thousand
lines) on both an embedded DSP processor and a graphics workstation with
_absolutely_no_changes_!
 
G

goose

Roedy Green said:
If you want to write cross platform code in C++ you have to buy a
rather expensive cross platform library,

thats a lie, gtk is cross-platform *and* free.
something like Rogue Wave.
C++ or C out the box is far from being cross platform.

thats a lie. I can write a non-trivial program that will compile
with any C (where the hell did i mention C++?) compiler out-the-box,
and compile on all c89/90 compilers.
What you can
do is write code that can be tweaked to run on another platform, or
you can create a set of macros to make the same code base run on one
or two platforms.


you can do that *also*, but its not your only option.
However the C and C++ are not naturally
multiplatform.

thats another lie, C was standardised, afaik, *because*
of its ubiquity.
They are lower level languages. That is why they are
used for JNI when you want to get personal with the OS.

and break what little portability that java offers ?
C is much more cross platform in the Unix world,

thats a lie again. C is cross-platform.
period.
but when you throw in
Windows and the Mac, you pretty well have to start from scratch.

yet another lie. gtk compiles on both platforms, afaik.
With
C and C++ you interface directly with the OS.

yet another lie. show me even *one* std C function that
binds your code directly to the OS.

just one.
With Java there is a
buffering layer of standard class libraries.

its strange that you nkow so little yet you post so much.
what do you do for a living anyway ?
lawyer ?
The language wars are for the most part kid nya nya games.

I certainly agree. however it does irk me that you so blatantly *lie*
so *many* times in a single post.
You need
both C++ and Java for different things.

I have not mentioned C++
There are not many places
where you would you would use pure C now instead of C++, perhaps a
device driver or some code to fit in an embedded device.

true, but if you wanted to write a crc algorithm that worked
*everywhere*, you'd write in in pure C.
It is like arguing which is better a wrench or a screwdriver.


no no, it is me pointing out that
a) java is not platform independant, it depends on the java
platform.
b) the java platform only runs on a fraction (i dunno, say 1%?)
of computing machines out there.
c) There is a C compiler for just about every computing
machine in the world. I'd certainly be interested to here
which machine supports java but not C.

You are destroying your credibility with so many lies in a single
post.

If you *really* thought those things, well, then ... now you
know more (e.g. you know that std C is not tied to the OS).

but if you were merely ignorant and neglected to look up the
facts, then I'd have to say that you should do your bloody
homework instead of making an ass of yourself.

goose,
at least now you are more informed, are you not ? no more *myths*
about C ?
 
J

jce

<NEWS FLASH> C probably targets that too </NEWS FLASH>

goose,
java code isn't as portable as C code.

By the way, I would say that Java on a wireless phone or PDA is more
portable than a stoplight.
I don't believe I could get the latter through customs.

JCE
 
H

Howard Brazee

the bottom line is that
(now read this slowly, so that it sinks in)
*code* *written* *in* *java* *will* *be* *portable* *to*
*fewer* *platforms* *than* *code* *written* *in* *C*.

Programs as written will run without change when moved to a different platform?
do you argue that ??? you'd be incredibly stupid and/or
brain damaged to argue that point.

There are other options besides your insulting ones. But when someone is into
that type of insulting, whether he has anything useful to contribute gets
overlooked.
 
B

Bent C Dalager

If the statements in question are the result of mere ignorance then they
lack the intentionality which is required of a lie... or am I missing
something?

You seem to be missing the fact that it was a flame. Logic and correct
use of vocabulary are non-issues in that context.

Cheers
Bent D
 
H

Howard Brazee

I foresee a time when there will be no need for the "lower level"
programming you are talking about, Bill.

We will no longer need to program by moving wires around?

Or we will no longer need to program in machine language?

Or we will no longer need to program using assembler?


Been there, done that.
 
S

Stephane Richard

You two had me going there for a sec, I actually wondered if I was indeed on
a Pascal newsgroup :)....had to double check.
 
S

Stephane Richard

You two had me going there for a sec, I actually ondered if I was indeed on
a Pascal newsgroup :)....had to double check.
 
D

docdwarf

You seem to be missing the fact that it was a flame. Logic and correct
use of vocabulary are non-issues in that context.

Ahhhh, *now* I understand... thanks greatly, you... you poopie-head, you!

(did I do that right?)

DD
 
S

Scott Condit

Ummmmm... it may be that things have changed but I was taught that a lie
was told with intent to deceive; it is the intention which differentiates
it from a simple 'false statement' or 'just being wrong'.

Whilst that usage is certainly more common, the broader one is also
valid.

e.g. from www.m-w.com:
lie, n: [1b] an untrue or inaccurate statement that may or may not
be believed true by the speaker

S
 
R

Richard

(e-mail address removed) (goose) wrote
you miss the point.

No, I didn't 'miss the point at all'. The 'point' was the comment
about 'big enough'.
not only does C also target all the platforms
that java does, it targets a whole lot more as well.

That was not 'the point'.

If you had wanted to argue rationally (and I see no evidence of this)
then you may have pointed out that the WabaVM was written in C.

The whole argument between C and Java is pointless, you are yelling
past each other. You have different views of 'portable'. With full
Java it just runs wherever it is available - automatically portable
with no effort, not even a recompile.

With C there is work to do to at least recompile (ignoring C
interpreters), sometimes quite a bit of work, but compilers and cross
compilers are available more places.

I point you an expert opinion in the July-August 1978 Bell System
Technical Journal in an article 'Portability of C Programs and the
Unix System' by S.C.Johnson and D.M.Ritchie:

"A program is portable to the extent that it can be easily moved to a
new computing environment with much less effort than would be required
to write it afresh."
You are using this version of 'portability', one that is meaningless
to (full) Java which is _ONE_ 'computing environment' regardless of
the machine it runs on.

While C may run on more different machine type this is usually
irrelevant to Java programmers because different 'computing
environments' have completely different needs and different types of
programs. It would be pointless to make a mainframe batch program run
on a PDA, or a PDA applet run in a real-time process controller. A
real-time program can't do anything on a PC, A PC game won't run in a
GameBoy.

All of you who are ranting about portability and availability are
'missing the points' completely, but I doubt if you care what they are
anymore, if you ever did. They are _different_ not wrong.
 
R

Roedy Green

thats a lie again. C is cross-platform.
period.

Don't be silly. Look at any C code designed to run on many platforms.
It is riddled with macros to pull off the feat.

You can do a few simple things like parse the command line, open a
flat file in a platform independent way, but not even the size of int
is guaranteed unless you play some games with macros.

You certainly can't write to a gui without some cross platform library
which is not part of C. Java is in a quite different position. The
standard class libraries are everywhere Java is supported.

C is a portable assembler.

Making code run absolutely unmodified on all platforms and giving the
same results would interfere with its use as a portable assembler.

Have you written any cross platform C or Java?
 
R

Roedy Green

the JVM itself is written in C++, This would imply it needs even less
porting than the Java programs it runs. This is clearly false.

You give yourself away with your handle "goose". You are a silly goose
teasing us.
 
R

Roedy Green

Completely wrong. I

I would agree out of date but not completely wrong. Ok, cheaper or
free packages have come available since Rogue Wave was the tool we
were using.

These packages themselves have to be tuned for each platform. If the
runtime does not exist for the platform you want you are SOL. They are
not universally available the way the Java class libraries are.
They are not part of the language. They come from various third
parties.


All you have done it fob the work of platform independence off on a
third party. The LANGUAGE is giving you precious little help.

The equivalent problem occurs with Java, but the language itself and
the standard class libraries isolate you from all that platform
specific code that had to be written.


Coding for platform independence is something you can do in C++, but
it is not something that comes out in the wash automatically the way
it does in Java. It requires effort and third party libraries chock
full of platform dependent code.
 
K

Kevin Easton

In comp.lang.c Roedy Green said:
Don't be silly. Look at any C code designed to run on many platforms.
It is riddled with macros to pull off the feat.

You can do a few simple things like parse the command line, open a
flat file in a platform independent way, but not even the size of int
is guaranteed unless you play some games with macros.

The size of int is guaranteed in a useful way - it's guaranteed than an
int can hold the values from -32767 to 32767. If you only need to store
numbers that big, than an int is your man. If you need to store numbers
larger, then you probably want a long int, which is similarly guaranteed
to hold numbers in a particular range.

People who *think* they need an exact-width type, rather than an
at-least width type, are usually wrong.

- Kevin.
 
P

Peter E.C. Dashwood

Thanks for the response, Stephane.

Some good points.

My comments below...

Stephane Richard said:
Are you saying that in 20 years, a programmer wont have the tools to make
his own programming language, his own OS should he or she decide to? And
they call that progress? I call it going backwards here. If this is what
I'm gonna face in 20 years, I'll be making endless copies of DOS Linux and
maybe OS/2 so that I have the choice to do what I want. (note that I didn't
mention Windows ;-)

No. I'm not saying that. The "limits" of my view are bounded by BUSINESS (ie
commercial) application development. I don't know what will happen in
programming research labs (and, to be blunt, I'm not really
interested...hopefully, there will be some exciting developments, that will
eventually trickle through to commerce, but that isn't where my particular
personal interest lies.)
Here's my view of things, from my point of view, so you can't sue me for
saying this...hehehe.

We haven't even begun to touch the tip of the iceburg into what we can do as
far as software development goes. And while microsoft seems to be amazed by
it's Windows, Where it's been, where it is now, and where's it's going to
be, since about 3 to 4 thousand programmers went into the making of Windows,
I'm not impressed by those results. This having been said, So far, all
we've done for all these decades, is make the computer do that we dont want
to do. (Hefty calculations, any repetitive tasks, games (not for the same
reasons of course :). But we haven't even begun to tap into the potential
that's ahead of us.

I would agree with the above. The question is HOW we unleash this potential
in the future. I believe it won't be by Procedural code. (There are many
reasons for this... and I am NOT suggesting that NO-ONE will be writing
procedural code. It just won't be commercially viable to develop business
solutions in this way. In fact, it isn't even today. It's just that there
has been no alternative for 40 years...)
To me What you are suggesting is that we let the others come up with the new
stuff, give the users the ability adjust/change what the user did through
the use of somewhat flexible modules, and that's it for the programmer? I'm
thinking much longer term than that. After this step of yours happens, do
you really think that everything will have been made that can be made in the
whole computer industry?

No, that is pushing my argument beyond its limits and I couldn't defend such
a position. I am not speculating on the "whole computer industry", only
commercial systems development.

I beg to differ, as this approach the the future
of computing is one of many thousands of avenues, and I'm not saying there's
only that way out of it, even if this ever gets made, it wont close the door
to the rest of the potentials that still are, to date, untouched.

But that's my vision of it, once your implementation exists and is stable,
do you think the users, ever so evolving as you say (which I do have to
agree that they are) will stay contended with this? that they wont want
more? Give a man an inch, he'll take foot, etc etc etc....I dont seen that
human behavior stopping anytime soon. To stop that human behavior, we might
as well stop populating since after 5 billion people we can safely assume
we've conceived every possible kind of human being? not at all :). far
from it. And the same goes for programming. Your view is one of many
parralel views, views that will all equally evolve, each in their own
specific ways, each towards very specific and unique goals. And as long as
they are computers, there will be programmers.

The question is whether those "programmers" will be human... We already have
computers that monitor computers. In heuristic systems, programs modify
themselves so fast that the only way to know what happened is to monitor it
with another computer. While this is outside the arena I have defined for my
speculation, it is interesting and fun to look at.

I see a time when some programs will attain a result (based on trial and
error and a program modifying itself several trillion times within a few
minutes) where it will not be (humanly) possible to know HOW it arrived at
the solution. We'll just be thankful we HAVE a solution. There will be no
way of knowing whether the solution is optimum. The best we could do is run
the program again and hope for a shorter result...

This means a computer will attain a result and NO-ONE will know HOW it did
it.

As a Programmer, you may find this an exciting prospect, or you may find it
terrifying. (personally, I'm in the former category). No matter how you feel
about it, it will happen (has already, actually...).

Your statement regarding computers and programmers may be suspect.

And programming languages
that will range from low level to high level. The way Pascal is adjusting
to the current reality of development, I dont fear that it can adapt to any
new programming concept we can throw at it. It's been doign great at
adapting thus far.

Remember, software development is not a user only oriented concept. :) at
least not in my book.

And that's my 0.02 cents worth :)....(ok maybe there's a couple dollars in
there instead :).
I have tried to give you some return on your investment...<G>

Pete.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,076
Latest member
OrderKetoBeez

Latest Threads

Top