swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Swarm-Support] Followup: found work-aroundfor missing~/swarmarchive


From: Marcus G. Daniels
Subject: Re: [Swarm-Support] Followup: found work-aroundfor missing~/swarmarchiver.scm too
Date: Mon, 21 Aug 2006 01:00:58 -0600
User-agent: Thunderbird 1.5.0.5 (X11/20060808)

Bill Northcott wrote:
As a result Objective-C programmers obsessively test for nil if there is any possibility that an object may not be available. That seems to me a good habit that Swarm Objective-C programmers should also cultivate.
Not really sure what kind of object is? Well, lucky you, you get to write a bunch of code to adapt to all possible cases including the one of no case at all and you get to conflate that signal inside of the one that carries the real one as well. But wait, is it the error signal even a real one? Why was there a nil object in the first place? Perhaps nil is supposed be a placeholder for some dead object in a fixed size thing? Or maybe it is just a bug. My experience is that modelers are thinking about other things and that it is usually a bug. Adding in a nil_method function or a conditional is far safer than having messages simply ignored silently. I understand that MacOS X runtime compatibility and/or similarity is a goal for you, but there are far bigger obstacles in your path than this little thing. You've got to implement or ditch phases, for example.

Swarm also does Java, and so here the underlying Objective C code is just a means to an end. Java users will expect null pointer exceptions.

Is this not the whole point? There exists a Java interface for people who want/need the software to keep them on a tight leash and sweep up behind. The downside is reduced functionality. That is a basic trade-off in any computer language.
That's not the point. The Java interface was and is for people that want to make Swarm simulations using that popular language using it's popular tools and libraries. Having a Java virtual machine, and vast Java libraries, opens up many more possibilities than Objective C alone. Sometimes low-level control and transparency are needed, and then C coding is more useful. Depends on the problem. With Swarm you can do them both at once, even. The `right' behavior for exception handling depends on your perspective. Ideally there would be tight integration with exception handling features in multiple languages, but that's a lot of work.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]