Re: Which is easier? Translating from C++ or from Java...

2005-03-29 Thread Peter Herndon
If you have three different implementations, and can read all three of
them well enough to understand the code, use all three.

If you are going to port software from one language to another, and
want to reimplement it properly in your target language, you won't be
porting word-for-word anyway.  So use all three sources to find out
what the problems were in the domain, and how they each solved them.
Using that knowledge, figure out the best way to tackle those same
problems in Python -- if those problems even exist.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Which is easier? Translating from C++ or from Java...

2005-03-29 Thread Patrick Useldinger
cjl wrote:
I've found a third open source implementation in pascal (delphi), and
was wondering how well that would translate to python?
Being old enough to have programmed in UCSD Pascal on an Apple ][ (with 
a language card, of course), I'd say: go for Pascal!

;-)
--
http://mail.python.org/mailman/listinfo/python-list


Re: Which is easier? Translating from C++ or from Java...

2005-03-29 Thread Bill Mill
On 29 Mar 2005 11:02:38 -0800, cjl <[EMAIL PROTECTED]> wrote:
> Hey all:
> 
> Thanks for the responses...
> 
> I've found a third open source implementation in pascal (delphi), and
> was wondering how well that would translate to python?

cjl, I think that the responses on the list so far collectively point
the the correct answer: mu.

pick your favorite, or the most well written, or the clearest code, or
the one that contains the most 'e's, and try to translate it.
Whichever you choose, dig deep enough to get to the underlying meaning
of what's going on so that you don't end up writing another language
in python. If you do this, it doesn't matter which of the three you
pick.

Peace
Bill Mill
bill.mill at gmail.com
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Which is easier? Translating from C++ or from Java...

2005-03-29 Thread cjl
Hey all:

Thanks for the responses...

I've found a third open source implementation in pascal (delphi), and
was wondering how well that would translate to python?

-cjl

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Which is easier? Translating from C++ or from Java...

2005-03-29 Thread Patrick Useldinger
[EMAIL PROTECTED] wrote:
Patrick Useldinger wrote:
Depends on what language you know best. But Java is certainly easier
to
read than C++.

There's certainly some irony in those last two sentences. However, I
agree with the former. It depends on which you know better, the style
of those who developed each and so forth. Personally, I'd prefer C++.
Not really.
If you know none of the languages perfectly, you are less likely to miss 
something in Java than in C++ (i.e. no &, * and stuff in Java).

However, if you are much more familiar with one of the two, you're less 
likely to miss things there.

-pu
--
http://mail.python.org/mailman/listinfo/python-list


Re: Which is easier? Translating from C++ or from Java...

2005-03-29 Thread Roy Smith
[EMAIL PROTECTED] wrote:

> There is a difference between theory and practice.

You know the difference between theory and practice?  Well, in theory, 
there is no difference :-)
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Which is easier? Translating from C++ or from Java...

2005-03-28 Thread alainpoint

Patrick Useldinger wrote:
> cjl wrote:

> Depends on what language you know best. But Java is certainly easier
to  read than C++.


There is a difference between theory and practice. In theory, Java is
easier to read than C++.
In practice however, the average Java programmer is MUCH less talented
than the average C++ programmer (let alone the average Python
programmer). The upshot of all this is that in practice (and my own
personal experience: we use both C++ and Java), Java code is bloated
with design patterns, obfuscated with many layers of indirection,
etc...
As a summary, Java code can most of the time be thrown away and
re-written from scratch (the fastest way). C++ code on the contrary can
easily be ported/wrapped.
Of course this is a matter of personal opinion. I love neither Java nor
C++. C is for me the purest language and there is no match when
combined with Python !

My 2 cents

Alain

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Which is easier? Translating from C++ or from Java...

2005-03-28 Thread Roy Smith
In article <[EMAIL PROTECTED]>,
 "cjl" <[EMAIL PROTECTED]> wrote:

> Hey all:
> 
> I'm working on a 'pure' python port of some existing software.
> 
> Implementations of what I'm trying to accomplish are available (open
> source) in C++ and in Java.
> 
> Which would be easier for me to use as a reference?
> 
> I'm not looking for automated tools, just trying to gather opinions on
> which language is easier to understand / rewrite as python.
> 
> -cjl

My guess is you'd be better starting from the Java as a reference.  So much 
of C++ code tends to deal with low-level stuff like memory management and 
pointers.  At least in Java you won't have any of that stuff to wade 
through.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Which is easier? Translating from C++ or from Java...

2005-03-28 Thread Stefan Seefeld
[EMAIL PROTECTED] wrote:
Patrick Useldinger wrote:
cjl wrote:

Implementations of what I'm trying to accomplish are available
(open
source) in C++ and in Java.
Which would be easier for me to use as a reference?
I'm not looking for automated tools, just trying to gather opinions
on
which language is easier to understand / rewrite as python.

Depends on what language you know best. But Java is certainly easier
to
read than C++.

There's certainly some irony in those last two sentences. However, I
agree with the former. It depends on which you know better, the style
of those who developed each and so forth. Personally, I'd prefer C++.
I don't think the OP was asking for personal preference, and so I happen
to agree with the reply: parsing Java is definitely *much* simpler than
parsing C++, no matter how well you know either. As far as manual translations
go, that is much less a matter of ease of parsing but instead how closely
programming idioms match between the two languages that are involved.
And that obviously also depends on the specific code that needs to
be rewritten and the style it is written in (i.e. for example OO vs. templates,
etc.).
Regards,
Stefan
--
http://mail.python.org/mailman/listinfo/python-list


Re: Which is easier? Translating from C++ or from Java...

2005-03-28 Thread Kent Johnson
cjl wrote:
Hey all:
I'm working on a 'pure' python port of some existing software.
Implementations of what I'm trying to accomplish are available (open
source) in C++ and in Java.
Which would be easier for me to use as a reference?
I haven't touched C++ in a long time, my experience porting Java to Jython is that it mostly 
involves deleting stuff :-)

I hacked together a script that does a lot of the work by applying a bunch of 
regex replacements.
Kent
--
http://mail.python.org/mailman/listinfo/python-list


Re: Which is easier? Translating from C++ or from Java...

2005-03-28 Thread [EMAIL PROTECTED]

Patrick Useldinger wrote:
> cjl wrote:
>
> > Implementations of what I'm trying to accomplish are available
(open
> > source) in C++ and in Java.
> >
> > Which would be easier for me to use as a reference?
> >
> > I'm not looking for automated tools, just trying to gather opinions
on
> > which language is easier to understand / rewrite as python.

> Depends on what language you know best. But Java is certainly easier
to
> read than C++.

There's certainly some irony in those last two sentences. However, I
agree with the former. It depends on which you know better, the style
of those who developed each and so forth. Personally, I'd prefer C++.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Which is easier? Translating from C++ or from Java...

2005-03-28 Thread Patrick Useldinger
cjl wrote:
Implementations of what I'm trying to accomplish are available (open
source) in C++ and in Java.
Which would be easier for me to use as a reference?
I'm not looking for automated tools, just trying to gather opinions on
which language is easier to understand / rewrite as python.
Depends on what language you know best. But Java is certainly easier to 
read than C++.

-pu
--
http://mail.python.org/mailman/listinfo/python-list