Given how the new non-fragile ivars are implemented, it should be possible to add ivars anytime before the first instance is created (so load time should be OK), but that has apparently not been implemented, class extensions only work for code compiled together.
So I guess no dice, apart from associated objects or the old indexed-instance-variable tricks:
http://markmail.org/message/b5aqssv3iowcsw2i#query:+page:1+m...
Alas, those tricks break on bridged CF classes that have incorrect metadata:
http://markmail.org/message/yourm4nkghaf3bak#query:+page:1+m...
(Checked on 10.8, instance-size for CF objects still incorrect)
Edit: this is from the Apple naming guidelines, but it doesn't clarify that they always follow that convention for private methods: Avoid the use of the underscore character as a prefix meaning private in method names (using an underscore character as a prefix for an instance variable name is allowed). Apple reserves the use of this convention. Use by third parties could result in name-space collisions; they might unwittingly override an existing private method with one of their own, with disastrous consequences. See “Private Methods” for suggestions on conventions to follow for private API.
Not at all. The syntax was modelled after C++ which was what SUN wanted Java to replace at the time (generally it is a C-family style syntax).
Smalltalk itself has better syntax than any of the bunch.
>Better than obj-c but worse than nice languages like Ruby or Python.
Ruby and Python are not statically typed languages, which covers a lot of the simplicity in their syntaxes.
And while they did exist at the time, they were far from anybody's attention at the time Java emerged. It took 3-5 years after that for Python to make a strong appearance in some circles, and another 3-5 years for Ruby to emerge.
Also, if they were influenced by Obj-C then why on earth didn't they bring over the by far most useful feature of the language, caegories?! Or maybe categories were a later addition?
I have been developing Java for 15 years and ObjC only for two but categories are seriously the best thing since sliced bread. Anything missing in the libraries? Just add it!