Subject:
|
Re: Why Java for Robots (was NXT and bluetooth enabled phones)
|
Newsgroups:
|
lugnet.robotics
|
Date:
|
Sat, 21 Jan 2006 00:32:21 GMT
|
Viewed:
|
1859 times
|
| |
| |
On 17/01/06, PeterBalch <lego-robotics@crynwr.com> wrote:
> And what use are Objects anyway? (Heresy!?)
>
> I use them all the time in Delphi and they're great because 99% of the
> objects I use are associated with something that appears in the user
> interface. I drag a button into the window and an object appears in my
> program that I can talk to.
<Snip>
Be careful with Delphi analogies - Delphi and VB tend to be very UI
oriented and beware that you dont write off concepts by only seeing
them from that point of view. When it comes to building models of a
world, and interacting them or units which follow subsumption
architecture, having objects with messages between them happens to
make sense. They also happen to work very well for representing
objects for design and simulation. They are also a neat way to take a
piece of data and then represent all the ways to manipulate it. Try
writing some of the back ends that Delphi and VB UIs are normally run
against.
> How useful is that in a robot? Sure, I could
> have an object that corresponds to a pushbutton or Sonar but does that make
> programming easier? Easier than just a library of subroutines? I haven't
> found it so.
>
> Objects are wonderful in their place. I just don't think their place is in
> small robots. If I'm writing a Windows business application (yuk) where,
> say, clients arrive, have transactions and depart then Objects would be the
> way to do it. But robots aren't like that.
>
> Especially not if Objects require the huge overhead of a heap and garbage
> collection. <snip>
> It seems to me that it would be perfectly possible to write something that
> looked superficially like Java-plus-objects but where everything was
> statically allocated. (Am I right? I know lots about writing compilers but
> very little about Java. Because Java is a better designed language than
> C++, it should compile to smaller code. Pascal is even better in that
> respect.)
Peter, did you ever look up the ooPIC? I suggest you take a look at
it. It really is a device which uses objects, in the context of
robots, with a pushbutton, or a motor object and so on. It uses what
basically amounts to static allocation (no gc), and is running on a VM
(as was the original RCX firmware) dressed up with a syntax to look
superficially like Java (or VB or C).
I have to admit - I rather like the ooPIC, its sold with clear
labelling that it is not really a Java or C box, but what it does, it
does quite well - especially when you start to use VC's.
OO has its place, and there are other times when simple C will do me
just fine. Having worked on a browser based entirely in C - you can
write pure C with an object oriented point of view - its just more
painful to do so than with Java.
--
Danny Staple MBCS
OrionRobots
http://orionrobots.co.uk
(Full contact details available through website)
|
|
Message is in Reply To:
2 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|