Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java library over crowded

 
Prasanta Chinara
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does anyone share the same opinion that the Java language library is over crowded?

NO offense intended to the designers or any Java lovers; I feel highly overwhelmed to remember everything for real life use or for the SCJP exam.

--------------------------------
Ex1:
class String (methods):
1. int indexOf(int ch)
2. int indexOf(int ch, int fromIndex)
Method(1) can be easily acheived by int indexOf(int ch, 0) ;
--------------------------------
Ex2:
class File (static fields):
1. static String pathSeparator
2. static char pathSeparatorChar
One would be sufficient.
--------------------------------

C, as a language for example so elegantly handles the API.

'appreciate any thoughts.
 
Srinivasa Raghavan
Ranch Hand
Posts: 1228
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No. In my point of view it's not. Think in OOPs perspective.
C, as a language for example so elegantly handles the API.

I have seen many people struggling in pointers , memory leaks while working in 'C'. By this I doesn't mean to say 'C' is not so good. Each language has it's own pros and cons.
[ July 27, 2005: Message edited by: Srinivasa Raghavan ]
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24212
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Java API is quite large.

Originally posted by Prasanta Chinara:

C, as a language for example so elegantly handles the API.


But C's original library was tiny, and didn't do much. The ISO standard effectively doubled the size of that library to deal with wide characters -- and it still didn't do much!

Whereas it's true that some methods could be eliminated -- and many could -- I don't find your examples very convincing, especially the first one. You could pass a second argument of 0 all the time -- but why should you have to? It really only matters to people trying to memorize the API. Everyone else appreciates the convenience.
 
Tony Morris
Ranch Hand
Posts: 1608
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Overcrowded? Or poorly designed?
I agree with the latter. Apparant "overcrowdedness" is a symptom of poor design. A clearer, consistent design appears clear and consistent, regardless of its size.

The fact that the J2SE API Specification is poorly designed is a major pitfall that often goes unnoticed (often times, the symptoms are attributed to some other consequence of the brokenness); worse still, other people design software in a similar fashion, sicne it forms the basis of how they define "correctness" as if it were some authoritative source. Objective analysis skills are missing in the API Specification; do not inherit them!
 
Marcus Green
arch rival
Rancher
Posts: 2813
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Comparing thes standard C API with the Java API is not relevant. The Java API covers a vastly wider range of functionality than the C API.

It makes more sense to compare one of the C++ libaries such as MFC, GTK, wxWidgets, QT or even Visual Bisic. In my limited experience of MFC the Java API is much, much easier to understand. I would be interested in a comparison with the new .NET framework libraries though.

I would suggest that an example where of an over complex Java API is the GridBag layout manager. Interestingly I believe this was designed outside Sun.

Anyway this is not really relevent to Programmer certification so perhaps someone with the right level of magic would close it or move it somewhere moer relevent.
 
Akhilesh Trivedi
Ranch Hand
Posts: 1608
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would suggest that an example where of an over complex Java API is the GridBag layout manager. Interestingly I believe this was designed outside Sun.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic