?

Log in

No account? Create an account

anatomy · of · distance


Java (or, how things change while you've been away)

Recent Entries · Archive · Friends · Profile

* * *
I looked at Java today for the first time since the days of Java 1, AWT and the Blackdown Linux JDK. (Not counting the times when I tutored Java programming courses a year or two ago.) Anonymous inner classes are something I hadn't seen before, and a bit unexpected to someone to whom Java was essentially C++ with training wheels.

         frame.addWindowListener(new WindowAdapter() {
            public void windowClosing(WindowEvent e) {
                System.exit(0);
            }
        });

I wonder whether Microsoft ripped this particular syntactic quirk off for C#.

Current Music:
Belle & Sebastian -- Step Into My Office Baby
* * *
* * *
[User Picture]
On October 9th, 2003 02:51 am (UTC), sigma commented:
Believe it or not, they didn't implement that specific 'feature'. After being a Java programmer now for something like 7 years, I love AICs for the fact that they are a rapid-development boon. I hate the way they create extra class files in the package structure when compiled.

However, as a side note, C# isn't much better. They have this structure, called a delegate, that allows you to essentialy create a pointer to a method that fits a predefined signature and then
call it later. That's cool.

What is not cool is that variable supports addition and subtraction methods which add methods to the list that will be called when invoked. And, AFAICT, there is no way to get a list of the methods called nor the order in which they will called unless you did the 'addition' and 'subtraction' yourself, which means if you get a delegate from a third-party, you really have no idea what its doing...

* * *

Previous Entry · Leave a comment · Share · Next Entry