5 Replies - 1493 Views - Last Post: 02 June 2007 - 06:00 AM

#1 skyhawk133  Icon User is offline

  • Head DIC Head
  • member icon

Reputation: 1865
  • View blog
  • Posts: 20,278
  • Joined: 17-March 01

Amazingly good APIs

Post icon  Posted 26 May 2007 - 11:15 PM

Paul Buchheit criticized Java imaging APIs as they require "closer to 100 lines of Java" just to do a simple image resizing, that in Python can be done in three lines: i = Image.open i.thumbnail i.save He also ... via Java.net Weblogs
Is This A Good Question/Topic? 0
  • +

Replies To: Amazingly good APIs

#2 NickDMax  Icon User is offline

  • Can grep dead trees!
  • member icon

Reputation: 2250
  • View blog
  • Posts: 9,245
  • Joined: 18-February 07

Re: Amazingly good APIs

Posted 01 June 2007 - 04:52 PM

I have to admit that one of the things I don't like about java is all the technical details of the HUGE set of APIs. It is not that I am mad that they are too low level, rather I get irritated when I work out a solution just to find out that I have duplicated functionality that was already available in another API that I didn't see.

Some high level API's are nice, but they often make you conform to them, rather than giving you the functionality that you really want.
Was This Post Helpful? 0
  • +
  • -

#3 Amadeus  Icon User is offline

  • g+ + -o drink whiskey.cpp
  • member icon

Reputation: 248
  • View blog
  • Posts: 13,506
  • Joined: 12-July 02

Re: Amazingly good APIs

Posted 01 June 2007 - 04:55 PM

Well, it`s not always a fair comparison, as the examples given are also a matter of design. You can create a wrapper for java image APIs that would allow the manipulation to be done in three lines (once you created the wrapper, of course).

That being said, java image APIs have never been what one would call user friendly. :)
Was This Post Helpful? 0
  • +
  • -

#4 William_Wilson  Icon User is offline

  • lost in compilation
  • member icon

Reputation: 205
  • View blog
  • Posts: 4,807
  • Joined: 23-December 05

Re: Amazingly good APIs

Posted 01 June 2007 - 05:17 PM

they aren't the easiest, you're right, often when I deal with images in java, i get the byte stream first then deal with it that way, as many operations are available in that way as well.
Was This Post Helpful? 0
  • +
  • -

#5 Nova Dragoon  Icon User is offline

  • The Innocent Shall Suffer, Big Time
  • member icon

Reputation: 36
  • View blog
  • Posts: 6,169
  • Joined: 16-August 01

Re: Amazingly good APIs

Posted 01 June 2007 - 06:11 PM

Python is great, it practically writes itself.
Was This Post Helpful? 0
  • +
  • -

#6 1lacca  Icon User is offline

  • code.rascal
  • member icon

Reputation: 44
  • View blog
  • Posts: 3,822
  • Joined: 11-August 05

Re: Amazingly good APIs

Posted 02 June 2007 - 06:00 AM

Finally I see that the image processing APIs were a pain not just for me. It happened a couple of times, that when I wanted to accomplish something I went around downloading libraries and a lot of stuff, reading APIs, etc. And when I was almost ready with my 100 lines of code, I've realized that there was a much easier way...
So yes, there is definitely some mess in the documentation here. However the comparison with Python is a bit childish. Sure there are those 3 lines of code versus the 100, but the 100 exposes much more power, and this is the main difference between a scripting language and a lower level one. However I wouldn't be surprised to see that the 100 lines could be written in about the same time as the 3 (well, sort of...), since they are doing quite simple things (and probably you already have wrappers for 80 percent of them if you are in the business for more than a month or so).
Anyway it could become a long rant, but I really hate it when people are running around comparing apples with pears, but you can see it in professional forums/blogs/publications a lot. It's like those hyped stories, that EJB3 is dead, it's overly complicated, and you should use Ruby or whatever. These are written by people who think that there are fit all solutions - and whatever they write is usually right in their little universe, but they can't see that there are other situations where things work differently and they would have to reinvent everything, or it would be simply impossible, or at least a heroic effort to accomplish some things. I think usually there is no universal solution, so the main question is finding out what is good for what, and usually finding the right tool to solve a problem can save a lot of time.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1