Results 1 to 9 of 9
  1. #1
    Andre is offline Member
    Join Date
    Nov 2008
    Posts
    4
    Rep Power
    0

    Default Suggestions of crufty or otherwise bad APIs

    Hi everyone!

    I am working on a course project for a software engineering class that generally deals with "Usability of APIs". I have created some metrics that I wish to run a few Java APIs through and see how they measure up.

    To test out my metrics (for example, on average how many parameters are in each method call), I need to run some "good" and "bad" APIs through it. I'm sure everyone has some specific parts of the Java API (say, XML for example) that they think is either hard to use or just not done very well. I would be interested in hearing what everyone's pet peeves are about the Java API, but I am more interested in hearing complaints about third-party APIs that are really bad (for example, an imaging library that you've used in the past).

    So, what is everyone's most hated Java API, as well as most hated third-party API? Also, if you could give some indication of why you think it is especially bad ("I can never remember if I should call delete or remove"), that would be a huge help for my project.

    Thanks!
    Andre

  2. #2
    Nicholas Jordan's Avatar
    Nicholas Jordan is offline Senior Member
    Join Date
    Jun 2008
    Location
    Southwest
    Posts
    1,018
    Rep Power
    7

    Question timid answer

    This is sort of a leading question, not that it has no merit - we just run the risk of getting stuck in some deep hatreds and then not being able to put the flames back behind the gates. ( no pun intended )

    Un asked for compiler 'optimizations' are my pet peeve, and so by a wide margin. A close second is lack of shipping printable work to the browser that Average Unspecified Person can put to the printer, I have a short-stack of css / xhtml books from amazon that came in yesterday and are sitting here about to be read. Another is the "Double Checked Locking is Broken" idiom, which though documented and studied may in fact provide areas of research for you.

    Probably the greatest issue for me is bloated load times that so many seem to be insistent as being good work and totally needed. Phil discusses the matter in his MIT Press book on the popular PGP work. People would get and use the program. They would think it not working because it ran in a fraction of a split second. To avoid being swamped by needless help issues, it was necessary to put in a delay loop:while(--counter){System.print("computer working,...computer working,...computer working,...");}which neither served cryptographic purpose nor was of any real help to anyone.

    I find your avenue of research potentially appealing but have to ask if this is a doctoral thesis and if so what ( if any ) are your goals?......
    Introduction to Programming Using Java.
    Cybercartography: A new theoretical construct proposed by D.R. Fraser Taylor

  3. #3
    Andre is offline Member
    Join Date
    Nov 2008
    Posts
    4
    Rep Power
    0

    Default First reply

    Thanks so much for your reply! I actually posted this question in a few forums, and although there were many reads, you are the first to respond. That was kind of a shocker to me, but understandable after reading your "hatreds" response. Sorry about this lengthy reply, but I thought I should clear up a few things.

    I am a masters student at the University of Saskatchewan in Saskatoon, Saskatchewan, Canada. My research area is human computer interaction (HCI). I am taking this software engineering class because of the professor, who has three (three!) degrees from MIT. Since software engineering isn't really my thing, I decided to bring an HCI flavor to my software engineering course project and see usability where it seems no one else has looked at it. Although there has been lots of research into programming language usability, there is next to nothing in API usability (Josh Bloch has a great talk hosted at InfoQ (I can't post links..? That's kinda weird...) about the specific subject, but that's pretty much the end of the line).

    From the Win32 API, here is an example of what Bloch thinks is a bad API design (example taken from his talk):

    HWND CreateWindow(LPCTSTR lpClassName, LPCTSTR lpWindowName,
    DWORD dwStyle, int x, int y, int nWidth, int nHeight,
    HWND hWndParent, HMENU hMenu, HINSTANCE hInstance,
    LPVOID lpParam);

    The int x, int y, int nWidth, and int nHeight are what he focuses on (let's ignore naming and number of parameters for the time being). These are 4 ints which appear back to back in the function call. If you were to swap the size with the location (i.e., int nWidth, int nHeight, int x, int y), your program would compile and run hunky dory, but would take forever to track down why your window had such a funny shape and location. Had these been replaced by Point and Size structs, this issue would have simply vanished.

    My first goal is to get an A in the class, since this is a 60% course project. As far as research goals, though, my main contributions will be an investigation of the problem, a suggestion of some possible automatic metrics, and some initial results about how some APIs rank. The results are not meant to show how one API is "better" than another, but rather to show if the metrics I have developed can give us any insight into what programmers think are good designs.

    For example, if some people suggest that XOM is a great API but that the Java XML API is not so good, then do my metrics rank them at different places in the design space? I hope so, but it would also be a contribution to see that my metrics mean crap all.

    Some example metrics I'm going to look at:

    1) Average number of parameters per method
    2) Number of classes in the API
    3) How many overloaded methods there are in each class, and are they distinguished by parameter type, parameter number, or parameter ordering
    4) How deep is the class inheritance hierarchy

    And so on...

    Your feedback is great, and I agree with most of the issues you brought up (the double locking is especially interesting to me, since I just learned this technique in my concurrency class). Now that you see where I'm going with this, maybe I didn't pose the question in the right way? I'm actually looking for API names, specifically bad ones, so in that way my question is definitely a leading question, but that was kind of the point :)

    Thanks again for your response! (and sorry for my long post... grad students get a little chatty about their work hehe).

  4. #4
    labu sayung is offline Member
    Join Date
    Nov 2008
    Posts
    1
    Rep Power
    0

    Default hello

    hello im a new javamania can u teach me?

  5. #5
    Andre is offline Member
    Join Date
    Nov 2008
    Posts
    4
    Rep Power
    0

    Default

    And out of that whole huge post, I forgot to mention the most important part. I am looking at API usability (specifically, learnability) and not at the efficiency of the implementation or anything like that. Basically, does the design of the classes and the methods allow you to remember which method to use? Is the naming consistent, so that you can "guess" what the method name should be? That kinda thing..

  6. #6
    Nicholas Jordan's Avatar
    Nicholas Jordan is offline Senior Member
    Join Date
    Jun 2008
    Location
    Southwest
    Posts
    1,018
    Rep Power
    7

    Default

    pm me dude ( no slacker intended ) I have serious real-world work I can work you on.

    What your issue of 11:57 am yesterday resolves on is sorta like Alice in Wonderland drilling for dirt in some pasture somewhere.

    Maybe we can get ftr to bring in the "Famous Interview Question #Random.nextInt()....

    Wow, this could be fun. Eranga, can we dance with this guy?... A Ballet of Brutality in a Field of Dreams....

    wow - see my mission statement at docdubya dot com slash belvedere slash statement slash index dot html and see if we can escape the back-slashers.

    Your last response leads into NLP - which is work at the Docorate level, probably for Master's level work we can state that progress is time-domain limited: There is a certain rate, which may vary, at which the student can absorb concepts, documentation and tools. An un-recognized adjunct is that the brain literally burns calories - deep thought tends to get inefficient work due to depletion of caloric reserves then spin-locks on dwindling fuel being countermeasured by heavier effort.

    The 5-minute union break is actually a good solution.
    Introduction to Programming Using Java.
    Cybercartography: A new theoretical construct proposed by D.R. Fraser Taylor

  7. #7
    Andre is offline Member
    Join Date
    Nov 2008
    Posts
    4
    Rep Power
    0

    Default

    Hi!

    Well, I'm glad that someone has taken an interest in this. I am actually a little surprised that no one has jumped in and complained about some obscure API they have been using. Please note that forum rules state that people with 3 posts can not send private messages (i.e., me).

    I took a couple minutes and clicked through your website; seems vaguely reminiscent of the usenet days. Of course, I also had to Google NLP, since this is completely new to me. Interesting theory and set of models, but I believe this is over-thinking the issue.

    My supervisor suggested that I seriously consider taking up this project as a master's thesis, but this is not the direction I would like to follow in my research. I'm an HCI researcher, currently looking at touchscreen interactions, which is at a completely different level than this API usability research.

    I really enjoyed your quote: "A Ballet of Brutality in a Field of Dreams". Note that I am not a diluted student that thinks he can solve the worlds problems with a little course project. Reading through the literature, I found next to nothing that dealt with API usability (but did find some about programming language usability) and thought that this was a glaring hole in the research. My project will simply sprinkle some dust into the hole, not fill it :).

    Regardless, I am not sure where you are going with this :) Could you elaborate?

    Thanks!
    Andre

  8. #8
    Nicholas Jordan's Avatar
    Nicholas Jordan is offline Senior Member
    Join Date
    Jun 2008
    Location
    Southwest
    Posts
    1,018
    Rep Power
    7

    Talking Thank you.

    Quote Originally Posted by Andre View Post
    Well, I'm glad that someone has taken an interest in this. I am actually a little surprised that no one has jumped in and complained about some obscure API they have been using. Please note that forum rules state that people with 3 posts can not send private messages (i.e., me).
    Okay, maybe I can write a Servlet or somehting - too busy right at the moment. There are no shortage of complainers about API's so their absence here provides clues to the direction of UI work you mention later in the post. I have a Doctorate in Mathematics whom I met a Starbucks recently who wishes to explore a not dis-similar avenue, he wishes to engage some philosophy as a life avenue and in retrospect considers this would have been more fulfilling work. I directed that toward examination of ....

    You are a cs student, right? If so, please examine "Programming the Universe" by Seth Lloyd. In that work he mentions something of profound consequence to the work I am set on as a goal. We have today a supply of entrants who have only known the glass front panel of the tube, being rapidly replaced by some solid-state devices that resemble the mental solid-state that is obviously being displayed. Tell the person, " 7 / 16th's open-end wrench " and they turn to the Glass-Eyed Monster and grab a mouse by the tail....

    That provides an avenue of intrusion which for a business has no end of difficulties. I seek, hopefully now with your contribution of some kind, to devise an efficient correlation between eventual failure of whatever kind, the seriousness of the failure and whatever other metric we can identifiy vis-a-vis choices in the UI. We identifiy the shell ( user interface ) as anything the worker can see or point at during the routine use of the computer. IOW tech's toolkit not an entrant in the calculation.

    What this does satisifies a deep and central issue for me. I have a remarkable response time, which I have a gross measurement to be centered on 10 to 11 milliseconds. I as well have had to take the shame and blame for too many who are inefficent or incompetent and note that in general their response time ranges from several minutes to never happen at all.

    A tool which utilizes a color choice as part of the randomizer could be used to provide "choose password" tool that could be used in a Nation-Neutral sys admin's tool to identifiy candidates for closer inspection by error-detection algorithms. Since the carp are not participating in this thread we can discount multiple issues, but as example I provide anecdotal report:
    Recently I was at a major retailer of building materials. There I observed a supervisor who had been assigned to work my sale as the sale involved provision of a credit card on which I was neither signatory nor on the authorized buyer list. I was there to obtain critical needed materials on a pressure point moment in a ( dollar amount deleted for posting ) project. Basically I was burning well in excess of a thousand dollars an hour. ( exaggeration for clarity )

    The supervisor commented that the system was legacy and should be replaced by contemporary computing machinery.

    The basis of the remark was that the screen was a command line interface.

    I tried to explain that a fine-resolution, gui was of no central benifit on reliability and the machinery upscale used these cli's routinely. A gui could be used, but does not make any diff to the people who write code. That did not register on the op's mind.
    Source: me.

    The design and building of GUI's is notoriously difficult. I propose that the difficulty is deep in the mind of the operator and may be explored with significant effect.

    This is getting lengthy and I am about to be short on time so I will skip out on the next few replies, I think you could be effective working with my New Team Lead.

    Quote Originally Posted by Andre View Post
    I took a couple minutes and clicked through your website; seems vaguely reminiscent of the usenet days. Of course, I also had to Google NLP, since this is completely new to me. Interesting theory and set of models, but I believe this is over-thinking the issue.
    Well yes, I run deep. You will have to sift and discard some stuff. Copy-paste buffer runs fast. Tread carefull on NLP, it is a snake the Glass-Eyed Monster uses to trap the unwitting and the unwary.

    Quote Originally Posted by Andre View Post
    My supervisor suggested that I seriously consider taking up this project as a master's thesis, but this is not the direction I would like to follow in my research. I'm an HCI researcher, currently looking at touchscreen interactions, which is at a completely different level than this API usability research.
    I'm gonna fish-out on you here and not google HCI - to measure your response. Will google it later and see if I can come up with some good whiplines on it. That is what the Ph.D's are good for - pulling the details up and whipping them around.

    In short, if a Doctorate tells you on a fine-line issue some bland response -then we know that that area of research has been explored and provides no avenue of forwared progress.

    Quote Originally Posted by Andre View Post
    I really enjoyed your quote: "A Ballet of Brutality in a Field of Dreams". Note that I am not a diluted student that thinks he can solve the worlds problems with a little course project. Reading through the literature, I found next to nothing that dealt with API usability (but did find some about programming language usability) and thought that this was a glaring hole in the research. My project will simply sprinkle some dust into the hole, not fill it.
    Yes, we have a Full Blown Research Project awaiting .... can we Dance?

    Quote Originally Posted by Andre View Post
    Regardless, I am not sure where you are going with this :) Could you elaborate?
    The first post was exploratory, I am seeking avenues of work. Let's open it up a bit before casting the show.
    Introduction to Programming Using Java.
    Cybercartography: A new theoretical construct proposed by D.R. Fraser Taylor

  9. #9
    fishtoprecords's Avatar
    fishtoprecords is offline Senior Member
    Join Date
    Jun 2008
    Posts
    571
    Rep Power
    6

    Default

    Quote Originally Posted by Andre View Post
    I am looking at API usability (specifically, learnability) and not at the efficiency of the implementation or anything like that.
    Things like naming conventions of the arguments don't count much in my book. So what do you really mean by usability?

    For an API, I want one that will take as little as possible time to get the code working, or at least proportionate time. If the API does something simple, the calling and setup had better be trivial. If the API solves complex problems, then a bit more setup time, and RTFMing is OK. Examples:

    sorting an array should take no effort at all. Reading the response from a webserver and parsing all the information can be a bit more complex.

    Some well known examples of usability in Java don't meet my requirements. For example, when Enumeration was replaced with Iterator, one of the justifications was that the function names were shorter and more meaningful then the names in Enumeration. To me, that's what an IDE is for.

    Its not like we use vi to write code anymore

Similar Threads

  1. Suggestions required for solving a Java problem
    By bilal_ali_java in forum Advanced Java
    Replies: 3
    Last Post: 08-16-2008, 01:11 AM
  2. SMS Java APIs
    By a_turingmachine in forum Advanced Java
    Replies: 0
    Last Post: 08-12-2008, 04:33 AM
  3. Any Datastructure Suggestions For An Unbalanced Tree?
    By markus-sukram in forum New To Java
    Replies: 0
    Last Post: 03-26-2008, 02:25 PM
  4. Java APIs
    By chagla in forum New To Java
    Replies: 1
    Last Post: 07-23-2007, 10:19 AM
  5. Java application help and suggestions required
    By bilal_ali_java in forum Advanced Java
    Replies: 0
    Last Post: 07-18-2007, 03:11 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •