Re: GoTo in Java
- From: "Pete Dashwood" <dashwood@xxxxxxxxxxxxxx>
- Date: Sat, 28 Jan 2006 12:35:21 +1300
"Richard" <riplin@xxxxxxxxxxxx> wrote in message
news:1138390683.396793.322920@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>> Someone else then translates it to
>> C++. Then I come back, and notice there's a C++ version now. I tell my
>> IDE
>> to translate it to Java, and get something not too bad. I can clean it up
>> a
>> bit, and add it to the docs too.
>
> While that mechanism may be a nice toy for learning different languages
> it would be useless for production code. Who is going to ensure that
> your 'cleaned up' Java now works the same as the Fortran code. If a
> change is made to the C++ how does the Java get the same change.
>
> In may examples what is the Java equivalent of 'for record in file:' ?
> It is several lines of class methods and a while loop. If the Java is
> modified then how could it ever get back to being just the one line ?
>
> Source code translations have been tried for several decades and they
> just don't work. For example you cannot translate C code into Java and
> expect it to magically become object orientated.
>
I've been following this thread with some interest and I understand what
Oliver is trying to do. It is a noble idea, but I think Richard has hit the
nail on the head in this (and previous) posts.
The effort involved in source transalation, and the risks, do not match the
rewards.
The point that is being missed entirely here is that the real solution is to
NOT maintain source code. (In any language...)
Because of its COBOL and procedural programming roots, this forum is excited
by language discussions and the problems attached to source languages. Yet I
see people every day, with no knowledge of ANY programming labguage (apart
from scripting, which is not maintained in the traditional sense of code
maintenance) producing really impressive applications that run on the web,
access databases, share information, and produce reports.
Component based development means you write code once and do NOT maintain
it. (I know there are many places that don't adhere to this and they try and
maintain the components. There is only marginal gain over a normal source
code maintaining shop if you do this.) The idea is to decompose
functionality to lower levels than has traditionally been the case, write
flexible generalised solutions to these low level functions then leave them
alone! All you have to do is build the components into applications. You
should never change a component once it is written and its methods, events
and properties are established. If you need to 'enhance' it write a wrapper
that interfaces to it and extends it for that specific case, or write a new
component.
The true benefits of code reuse are not gained if you keep rewriting the
code. Encapsulate functionality and reuse it. Do it once; do it right.
Fortunately, modern evironments are so component rich (even though many
people do not realise the thousands of components that are provided free
with your OS) that people are starting to simply plug things together and
achieve impressive results. Scripts do not require thousands of lines of
procedural code to achieve what WOULD require thousands of lines of
procedural code, and maintenance is not a problem.
The rule of source code is over. The future belongs to object code. It will
be developed (once :-)) in whatever language is most appropriate for it and
things like ILs and CLRs will level the playing field. I have one
application where components written in VB, C++, and PowerCOBOL all play
together nicely on a single windows screen. The user is unaware of what the
functionality is written in (and doesn't care), and I have NEVER changed
these components in any way. (I couldn't if I wanted to, because I don't
have the source for some of them...) This application has been live for
several years, has had enhancements made to it, and has had some minor
changes to its functionality. New screens have been added and some of the
components mentioned appear on the new screens as well (there is only ever
one copy of them in the system). The less source code you have to look
after, the less risk to your investment.
Maintining source code is yesterday's technology.
Having said that, I do realise that 'today' we have a huge investment in
procedural source that HAS to be maintained so I don't think this discussion
is pointless...:-)
But I also think people need to start thinking 'beyond the square'. Todays
kids are doing it. In 50 years the idea of sitting down and 'programming' a
computer line by line, will be a quaint curiosity, like us using flint tools
or speaking Latin in the Supermarket.
Pete.
.
- Follow-Ups:
- Re: GoTo in Java
- From: Michael Wojcik
- Re: GoTo in Java
- References:
- GoTo in Java
- From: Howard Brazee
- Re: GoTo in Java
- From: Oliver Wong
- Re: GoTo in Java
- From: Frank Swarbrick
- Re: GoTo in Java
- From: Oliver Wong
- Re: GoTo in Java
- From: Richard
- Re: GoTo in Java
- From: Oliver Wong
- Re: GoTo in Java
- From: Richard
- GoTo in Java
- Prev by Date: Re: GoTo in Java
- Next by Date: cobol code assessment
- Previous by thread: Re: GoTo in Java
- Next by thread: Re: GoTo in Java
- Index(es):
Relevant Pages
|