Why Apple Has Been Neglecting The Java-Cocoa APIs

March 22nd, 2005

Pretty much no-one used them.

Yeah it’s right out there in the conspiracy theory side of things but I’m pretty sure that’s the main reason Apple hasn’t been too keen to put engineering time into developing Java wrappers for the Cocoa APIs.  Lots of people thought they were a cool idea and started using them, then one by one they realized it would just be so much easier to use Objective-C since that’s what the APIs were designed for in the first place.  Jump on Apple’s java-dev list and ask whether or not you should use the Java-Cocoa bridge for an application and the advice that you’ll get is to just learn Objective-C and you’ll be much better off.

So while James Duncan Davidson provides some good points that may have weighed into Apple’s thinking, I’m pretty certain the key reason is just that there was a massive lack of interest outside of the initial “wow that’s cool” reaction.

Oh and to respond to the original post:

Who knows, maybe someone will send me an email showing me how they accessed the WebView from Java.

Google called and suggested you search for “webkit java” and you might just Dmitry Markman has worked out how to use WebKit from Java (hint: it’s the first result).  Oh and of course, Apple provided a specific API so that you could embed generic Cocoa components in Swing interfaces, CocoaComponent.  Also, JDIC provides a browser component that uses a native rendering engine (IE or Mozilla typically) on Windows and Linux as well.

Oh and one more hint - when Apple says that a framework is private, it means they are going to change or remove it in future versions so if you use it, expect stuff to break.  It would probably be better to take advantage of the fact that Apple added support for mixing C and Objective-C and just write your own Objective-C wrapper for a C XQuery API, that or just use the C API directly.

How Do Browser’s Compete?

March 17th, 2005

Monsieur Scoble asks:

Finally, I’m gonna ask a provocative business question of Opera (and other browser manufacturers): What’s your business again? If all the browsers have the same underlying features, and they should only add things that are standards, what differentiation are you offering your customers and investors? Are you saying Firefox’s developers can’t propose anything new that’d push the Web forward? Hey, how about some linking technologies like Greasemonkey? Is Firefox not allowed to add anything like that that the W3C didn’t propose and that the WaSP didn’t approve of?

They don’t have to innovate in how they render content, there’s a whole heap of stuff that can be done in the user interface realm.  That’s how tabs came about and they’ve been a raging success - without any need for or repercussions on standards.

Then they can compete on speed and how standards compliant they are.  Maybe start implementing more standards - RSS, Atom, MathML, SVG, XSLT, tons of ways to be a better browser in the rendering department.

Then they can compete on security and stability.  Plenty of work to be done there in all browsers.

To get you started, how about coming up with a way to reflect the fact that my browsing history isn’t just a straight timeline and make it easier to see where I’ve been and navigate through it?

What about making it easier to know which tab I want when some stupid site uses the same title for every page?

What about making printing better?  Printing web pages is pretty awful at the moment, give me the ability to customize how the page prints somehow, maybe start by just letting me go through and delete content that I don’t want to print like ads and navigation bars.  Heck, even just giving me the ability to “crop” the page would be a huge benefit since most navigation elements are at the top, bottom or sides of the page.

I’d also love to see IE come with a recent copy of Java from Sun too - they seem pretty keen to have it included and Microsoft is meant to be targeting compatibility…

Oh and make sure it loads instantly.  That’s the reason I use IE for a heap of what I do - it loads faster than any other browser and still gives me enough of a unique instance that when the code I’m testing crashes the browser the other windows are unaffected.

There you go, off the top of my head I’ve just kept your browser development team busy for the next couple of releases at least.  Call me when you’re ready to put out IE 9 and I’ll give you some more ideas, my mobile number isn’t on my blog but my email and Skype user name is or you can toe the company line and give me a yell on MSN, my username’s AJOfOZ@hotmail.com.

Person To Watch: Joshua Marinacci

March 17th, 2005

He’s popping up in a few interesting places of late.  He’s been hired by Sun to work on the Swing team and promptly showed up on the WinLAF mailing list to talk about moving their bug fixes to the Windows L&F into the official Swing codebase for release in Mustang (accompanied by talk of how to make it easier for the WinLAF folks to contribute fixes more directly to the Swing codebase.  Then today he turned up on the Mac Java-Dev list asking questions related to making Java apps look right on OS X.  Then of course he’s behind the Flying Saucer pure Java XHTML renderer which is really quite awesome (it was very strict about standards compliance last I checked so should make even Byron happy).

Now I don’t mean to suggest that all these projects are actually Sun related or start unsubstantiated rumors but having followed Joshua’s blog on Java.Net he definitely seems like an excellent addition to the Swing team and I’ll be very interested in seeing how his project of improving the Windows L&F goes.  Hopefully if he keeps asking questions about Mac UIs we won’t see the any more boneheaded assumptions creep into Java like that whole menus go in frames assumption that makes life difficult for Java developers on Mac OS.  Hopefully they’ll be able to use his experience with Flying Saucer to improve the Swing Text APIs HTML support (it’s currently stuck at HTML 3.2).  (Hint: If you’d like to add support for floating DIVs for me that’d save me the trouble…)

That said, there’s already some pretty awesomely talented people on the Swing team and they’ve definitely learnt a lot from the early days of Java so hopefully the new APIs that get added in will be a little more Mac friendly even without Joshua’s help.

Security Companies Are Getting Ridiculous

March 16th, 2005

There used to be a time when if a security advisory came out you should pay attention and take immediate action - it seems more and more these days most security advisories should be ignored because it’s just some brain-dead, wanna-be security company desperate for attention.  The most recent example of this is the so called “infection” is this piece of trash from Vital Security.

People, when a security dialog comes up with 3 exclamation marks you probably shouldn’t say yes.  I mean seriously, if you’re stupid enough to run untrusted code with full permissions, I just have to link to a .exe to own your machine.  Users should be allowed to use their computers, they just have to be taught not to trust unknown sources of software and not say yes to random dialogs that popup.  This is not a technological issue, it’s a problem of education.  Previously you used to have to teach people not to delete the Windows or System Folder because if they did the computer wouldn’t boot.  Now you have to teach them to not trust things by default.

For the record, any browser which doesn’t correctly run the applet and display the security to the user has a bug in it - it is failing to activate a plugin (or doesn’t have a Java plugin).  There is a lot of software that runs as a signed applet, from online content editors used heavily on intranets to conferencing software for sharing desktops and applications etc.  Not supporting this technology seriously impairs a significant amount of business software.  Note that Java isn’t the problem here, you can sign JavaScript to give them full permissions as well, not to mention plain applications, firefox extensions, browser helpers and a huge number of other things that provide mechanisms to allow applications to interact with the user’s data and provide functionality outside of the normal HTML sandbox.  That’s not a bad thing, you couldn’t distribute software over the internet without that functionality - you couldn’t download OS updates, you couldn’t download a Linux distribution, you couldn’t share perl scripts (or python or ruby or asp or php or whatever).  People want to be able to do this and it is fundamental to computing that code can be transferred over the network and executed if the user desires.  Heck, I’m using a signed Java applet to write this post so I get on-the-fly spell checking, WYSIWYG editing and the ability to import files from my hard drive, save a back-up copy to my hard drive, pull resources from sites other than the one the applet loaded from and a range of other things that make my life easier and aren’t possible while stuck in the standard applet sandbox.

It’s also worth noting that adding more warning dialogs won’t solve this problem - Windows XP SP2 added a second warning before you can run an exe you downloaded from the internet.  Why?  They heard you the first time and decided to run the software.  What makes you think the second dialog is going to make them less likely to just say yes?

A similar problem often comes up when deleting things.  It seems like a good idea to require confirmation before deleting anything so that users don’t accidentally delete stuff.  This just doesn’t work.  People get used to the dialog and automatically agree to it without thinking.  All you’ve done by adding that dialog is require the user to perform two operations when they really want to delete something - they’ll make just as many mistakes when deleting.  What you should do is allow the user to undo their mistake.

Oh dear, I just noticed that this is the same guy who made a big fuss over spyware installing the .NET framework.  Sigh.  Once you have malware on your computer, you’re boned.  If you got off with just having .NET installed you should consider yourself lucky - it could have wiped your harddrive or added your computer to a DDOS bot-farm and used a ton more bandwidth or anything else it felt like doing.  Why is it surprising that spyware would install its dependent libraries?  Why is it surprising that spyware isn’t desperately trying to save the user’s disk space?

The worst part is this guy doesn’t even seem to realize he’s an idiot.

Not Much Happening These Days…

March 13th, 2005

Well that’s not true, there’s a lot going on in my life - I’ve been really busy, but there’s not much going on in the tech industry and the “blogosphere” that’s interested me enough to post anything.  There haven’t been all that many posts recently that I’ve really read either, mostly I’ve just been skimming everything that comes through the RSS feeds.

Oh well, at least the offline world is interesting at the moment.