the trailboss abuses his CodeRanch power for his other stuff (power corrupts. absolute power corrupts absolutely is kinda neat!)
permaculture light bulbs permaculture electric heat permaculture cast iron permaculture wood burning stove permaculture solar food dehydrators
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Learning Java (open source) API's - Like a scientist or an end user ?

 
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If I see any java API (open source), is it advisable to look at the code of the
classes to learn what the code really does, Or do I only look at the docs and
learn how to use the API ? The latter is what I have been doing.
How have you been doing it ?

Think of it like this -
A car (API) is put before a physicist and a non-physicist.
The physicist might try to find out how the car works and even try to understand
its internals.
The non-physicist might be only interested in driving the car and maybe learning a
thing or two about the internals.
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You look at the documentation.

If you have to look at the source code, that means that the documentation is a failure. (Which is certainly a possibility -- there's no guarantee that any particular open-source project has good documentation.)

However your analogy is badly chosen. Java programmers are engineers, rather than scientists. And Java classes are (I mean, should be) designed so that their function is completely described by their API documentation. When you read about software engineering (note, not "software science") you'll see lots of references to the "contract" of a class or an interface. That word refers to some documentation which says what the class or interface implementation is supposed to do.
 
Rancher
Posts: 1044
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

justin smythhe wrote:If I see any java API (open source), is it advisable to look at the code of the
classes to learn what the code really does, Or do I only look at the docs and
learn how to use the API ?



I have been happily using Apache Velocity Engine, a free open-source templating engine since many years.
I must admit to have never ever been forced to look into its sources due to its being properly documented.
http://velocity.apache.org/

On the other hand I was once forced to look into the (disassembled) code of an (by the way obfuscated) commercial product in order to find out some not properly documented trait of its behavior.
 
Ranch Hand
Posts: 630
Android Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
justin smythhe, You ask question which arise in my mind also when i see java API (open source) or open source projects also...


Think of it like this -
A car (API) is put before a physicist and a non-physicist.
The physicist might try to find out how the car works and even try to understand
its internals.
The non-physicist might be only interested in driving the car and maybe learning a
thing or two about the internals.


Paul Clapham's one sentence i not understand...

However your analogy is badly chosen. Java programmers are engineers, rather than scientists.


I agree with further statements written by him...
For example i am java programmer i can write program in java. but now i want to know how it works...if we take example of car...like by after starting engine...shifting gear & blah..blah... & car moves...OK
But now as physicist i want to know how actual java program run...then i read about openjdk...bytecode...more & more deep...& so java program run...(till date i not find out way to get debug stack in such deep...)
question is, Engineer study about science or something else?
If java programmer are engineers then should he/she think like 'physicist'(in above quote)...then it wrong?

...software engineering (note, not "software science")...


I know by google i can get lots of info about both...but can in easy words anyone explain here?
I apologized in advance if i wrong some where here...
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic