B
Bent C Dalager
Ahhhh, *now* I understand... thanks greatly, you... you poopie-head, you!
(did I do that right?)
I certainly appreciate the effort, but you could do with some work on
the execution
Cheers
Bent D
Ahhhh, *now* I understand... thanks greatly, you... you poopie-head, you!
(did I do that right?)
- First there must be a Java implementation
- Second there must be a *full* java implementation.
People who *think* they need an exact-width type, rather than an
at-least width type, are usually wrong.
Stephane Richard said:Quoted: " SQL Server for example has a "drag and drop" tool that allows
processing streams to be built in minutes. These same streams using
procedural code would take days."
funny, me in 15 years, I dont see microsoft in the picture. ;-)
Roedy 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.
In comp.lang.c WB said:Well, no you can't open a file in a generic way. Opening a file on a PC
is different than opening a file on a mainframe. You need a special
library to do this:
#ifdef I370
#include <lcio.h>
#endif
Which works with the SAS C compiler.
Plus, all your variables and function names need to be 8 characters or
less, AND mixed case is ignored, so VarA and VARA are the same, thanks
to the mainframe linker.
At least it was a few years ago. Things may have chnaged since then....
It is impossible to
write incorrect Java code?
The difference in, that equivalent program in Java would either work
or not work. It would give the same results on all platforms. With
the C version, you don't know if it works on other platforms until you
test it.
In comp.lang.c Roedy Green said:The Java version might not work either, but this is because of BUGS.
If the C version did not work, it would be because of FEATURES.
Is it possible to write non-portable code in C? Yes.
Does it follow from this that it is impossible to write portable code in
C? No.
You made the silly assertion that ALL C code would run unmodified on
any platform correctly. That is nonsense.
Peter E.C. Dashwood said:Thanks for the response, Stephane.
Some good points.
My comments below...
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.)
do amazed
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...)
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.
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...
**** As I mention it's exciting in one category only.. and differentThis 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...).
**** and indeed you have, but now, I am yet another couple dollars ahead ofYour statement regarding computers and programmers may be suspect.
**** Suspect? as in?
I have tried to give you some return on your investment...<G>
Roedy Green said:But then people write code thinking of only their own platform where
int is say 32 bits, and hand it to someone else whose int is 16 bits.
It does not work. It requires foresight and a macro to make that
code work on both platforms. It is thus foolish to claim C or C++
works naturally multiplatform. It requires extra effort.
In comp.lang.c Roedy Green said:Straw man argument Kevin.
You made the silly assertion that ALL C code would run unmodified on
any platform correctly. That is nonsense.
I merely stated that writing cross platform code in C or C++ takes
considerable effort. It does not happen as a natural side effect of
coding the way it does in Java. You need to find third party
libraries supported on all your platforms. You need to generate
separate executables. You have to keep your wits about you realising
that int means different things on different platforms. To get 32
bits on ALL platforms you have to use macros, and even then, there is
no guarantee of support.
You need to test separately, and you need a ton of compile time
macros to make the magic work.
I merely stated that writing cross platform code in C or C++ takes
considerable effort.
However, comparing C with Java is not comparing apples with apples.
ANSI C is more portable than Java in that ANSI C code will compile and
run unmodified on more platforms
The big advantage is you have is Sun's licensing. Basically if its is
called J2SE you can COUNT on classes and methods being there, and
working in a standard way. EVERY J2SE has these.
I argued for a such standard class libraries back in 1986 October in
an article in Byte Magazine. It is huge help no matter where you go
to have the same interfaces to deal with. You are not starting from
scratch with different tools for every project. With Java they are
effectively built into the language.
You can count on them just as strongly as you can count on +. That is
not true with C++. Chances are any given tool WON'T be supported on a
particular platform
Each tool handles only a handful of platforms. J2SE
handles EVERYTHING that handled claims to be J2SE, which is basically any
Java desktop or bigger.
Platform independent code happens naturally with almost no effort in
Java. It is requires considerable effort in C++. You can't convince
me otherwise because I have done both.
How can a queue (FIFO) and a stack (LIFO) be implemented with an ORDERED orI could suggest if you have a real problem, use OO COBOL <G>.
BTW - took a very quick look at your Java Glossary, and noted your
reference to lack of FIFO and LIFO in Java lists. Surely that can't be a
big deal, possibly cloning your own list class. Although
collections(lists) are included in both Fujitsu and Micro Focus versions
of OO COBOL - our J4 Standards Committee currently has collections as an
on-going topic at the moment. I doubt we'll finish up with a collection
specifically geared to FIFO/LIFO. I can handle it quite easily at
present from either an Ordered or SortedCollection :-
What about retrieving subsequent members of the queue or stack?*>FIFO
move 1 to MyIndex
invoke MyCollection "at" using MyIndex returning anElement
*>LIFO
invoke MyCollection "size" returning lsSize
*> above gives total elements
*> then I can do either of the following :-
invoke MyCollection "at" using lsSize returning anElement
*> OR
move lsSize to MyIndex
invoke MyCollection "at" using MyIndex returning anElement
Is he "REALLY using OO COBOL"...?If you haven't got what you want - James Gosling's fault. (He was born
in Calgary).
Guess he should have checked the Smalltalk hierarchy more closely before
he sat down to re-invent the wheel <G>.
Using the free or cheapest tools you can get to do a job is quite distinctI might add I can invoke both C and Java, with COBOL classes written to
support invoking Java. I have no need at the moment as I have rich
support of collections and GUIs built into the product.
One comment that came up here in this thread early on was "Use the right
tools for the job", not necessarily those exact words, but a point made
often in the COBOL group. Somebody of course nodded sagely at this pearl
of wisdom. Not always, but more often than not, that phrase translates
to "Use the free or cheapest tools you can get to do the job". Can't
knock people for that attitude, but I do wish they would come on in an
'honest' mode.
"Using the right tool" - here's one that came up recently from Brazil
in my Tech Support group. "How can I emulate an on-line Help file where
you key in some characters and then the entry is highlighted in the
Listbox ?".
Quite naturally a support person suggested, "Go to this site
www.xxxxx.com and check out their OCX".
I thought, "I betcha that's
possible in COBOL". It is. It was a piece of cake. Micro Focus has
values for Windows events, and it looked like some four were
possibilities. All I had to do was a quick test of the four to get the
one which would immediately trigger an event based on a single
keystroke.
Problem solved ! Having done that as an interest exercise, I can already
see where it can be RE-USED in real applications.
Note, none of the above has anything to do with the proselytizing of
components by Pete. Dashwood - I'm talking about REALLY using OO COBOL !
Roedy Green said:I merely stated that writing cross platform code in C or C++ takes
considerable effort. It does not happen as a natural side effect of
coding the way it does in Java. You need to find third party
libraries supported on all your platforms. You need to generate
separate executables. You have to keep your wits about you realising
that int means different things on different platforms. To get 32
bits on ALL platforms you have to use macros, and even then, there is
no guarantee of support.
You need to test separately, and you need a ton of compile time
macros to make the magic work.
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.
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?
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.