Victor Ng writes about Python's tuple syntax for length one tuples.
Not that I use a lot of explicit length one tuples, but here's something you can do instead. Redefine the tuple
function to accept non-sequences. If so, just put them in a length one tuple.
Then you can express an explicit length one tuple as
def tuple(x):
try:
return original.tuple(x)
except TypeError:
return original.tuple([x])
tuple(x)
In terms of big picture ideas, open source is running out of things to copy. Here's something that hasn't been done yet.
Interesting claim about big picture ideas. I never thought of that.
I do agree that "smart clients" is a ripe area for innovation. I never used OpenDoc.
I wonder if Eclipse is a good platform for these ideas?
Are checked exceptions a good thing? Do they break encapsulation?
I don't think checked exceptions are necessary. I think they can provide value.
But the cost of maintenance of static checking in Java is not worth the cost. What is my evidence?
I am more productive in Jython, which is capable of dynamically handling checked exceptions at runtime without the cost of static checking.
Let me illustrate my point with an analogy.
Consider an application command processor. The application has many functional areas. Each functional area has multiple commands that can be processed.
I can define a command abstraction and a command processor that works on the abstraction, independent of the specifics of any one command and any functional area.
In this case the commands are encapsulated and the command processor only has to be written once. New commands can be added at any time.
Now say the commands have names. And say that optionally a command can be designated as "checked", i.e. that at compile time the command processor must declare its awareness that some functional area is providing such commands.
Has encapsulation been broken? No. The problem is that named encapsulations are checked at compile time.
Is this a good thing? You decide the value.
Does it have a cost? Yes. The command processor has to be updated whenever a checked command is added to the system.