wood burning stoves
The moose likes Beginning Java and the fly likes Why java is unknown Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Why java is unknown" Watch "Why java is unknown" New topic

Why java is unknown

Steve Trigero

Joined: Dec 04, 2008
Posts: 9
I've heard about java for a long time, but have yet to run across a java programmer in my almost 30-years of programming experience. Which seems odd. But so be it. So I finally have a need to learn java for a new project I have, and let me tell you, figuring out what one needs, to learn and develop a java app is no easy matter. The Sun web site is absolutely mind numbing. You can't find stuff, you can't figure out what of the umpteen downloads possible you really need. Nothing is intuitive or explained. And try finding documentation. And if you do, try to download it. And worse yet, try to find something in it. For example, You would think a simple built-in function like Math.random() would be fairly easy to find. Why, it must be in the math class, how hard could it be? Go look in the java.math class, 3-methods an no random. What gives. Where else would you put math functions? No other class indicates it would have math functions in it, at least based on the class name. So I start looking in individual classes. After some time I get to the java.util class. Look! a random() function. But I can see that it's a different random function. But at the bottom of the description is a little note with a link that says "math.random() may be simpler to use." So I click on the link and end up in what appears to be the java.lang.Object.math class. And lo-and-behold, there is the random function I've wasted half a day trying to find. I don't know why I didn't think to look there? Seems intuitive to me. NOT! And when I go look at the documentation index, in the list of what is called "All Classes", there is no java.lang.Object.math class listed, nor is there a java.lang.Object class listed. I wonder what "All Classes" really means? So I go back (thank god for the back button, or I could never find it again) to the java.lang.Object.Math class and click on the link to java.lang.Object. One would think that once in this class you would see "Math" listed there. And you would be wrong. So unless one already knows about the java.lang.Object.Math class, how does one find this obscure class? As far as I can tell, you have to stumble around until you stumble across it by accident. But if you don't know what is in it how will you know when you've found it. Ah!, the conundrum.
And this is but one small example. I now see why Sun is failing and why I don't run across java programmers. Java RIP.
Jelle Klap

Joined: Mar 10, 2008
Posts: 1951

In my opinion the Java API is fairly easy to navigate and, for the most part, very clearly documented. If you follow the previous link the first thing you should see is a list of packages. The short description should provide some insight as to the kind of classes you will find in a particular package:

Contains the collections framework, legacy collection classes, event model, date and time facilities, internationalization, and miscellaneous utility classes (a string tokenizer, a random-number generator, and a bit array).

One click away the Random class is listed. I wonder what that does?
Let's take a look. Why, its purpose is to is to generate a stream of pseudorandom numbers. The Javadoc also contains a reference to the java.lang.Math class (one of the fundamental classes) and its random() method. But wait, there's more! A direct known subclass is also specified here: SecureRandom - the go to class for all your security critical randomness needs.

That's wasn't too difficult, was it? Still it will take anyone unfamiliar with Java time to get familiar with its extensive core API. There's just no way around that. However, in most cases a Google search will provide the necessary clues to get you where you need to go fairly quickly.

With all this in mind, and that fact that you're a programmer with 30 years of experience, I find it hard to believe you stumbled around for half a day looking for this basic feature.
[ December 05, 2008: Message edited by: Jelle Klap ]

Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life.
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
So how would you have found a random number generator for C (or whatever language you usually work with) ?

(As an aside, the 30 years of experience aren't entirely relevant - Java wasn't released until 1996.)
Christophe Verré

Joined: Nov 24, 2005
Posts: 14688

You'll find plenty of books on Java for beginners in the bunkhouse.

[My Blog]
All roads lead to JavaRanch
Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24199

Y'all like pie?

[Jess in Action][AskingGoodQuestions]
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
> I now see why Sun is failing and why I don't run across java programmers. Java RIP.

now that it's official, will the last person please turn off the lights.
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 15081

Hello Steve,

Welcome to JavaRanch.

If you've never had anything to do with Java then I can imagine that it can be difficult and frustrating to get started with it. It looks like you've found out that you need the JDK and you've probably written yout first Java programs already. Here are some links to get you started.

Sun has an elaborate set of tutorials - a great place to start for anyone who wants to learn Java.

Have a look around in a bookstore. Java is a very popular programming language which is very widely used (despite that you've never met a Java programmer), so there are thousands of books on Java. One popular book is Head First Java, for example. We have a list of book reviews here on JavaRanch.

The Java Beginners FAQ contains more information and links.

And JavaRanch is here to help you learn Java, so feel free to ask any questions you have here.

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
fred rosenberger
lowercase baba

Joined: Oct 02, 2003
Posts: 11955

step 1) Google search on "java random". First link is to java.util.Random. read page, finding comment that "Many applications will find the random method in class Math simpler to use."

step 2) Google search on "java Math random". First link takes me to java.lang.Math. Scroll down list of methods, and find random().

total time: < 1 minute.
[ December 06, 2008: Message edited by: fred rosenberger ]

There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Campbell Ritchie

Joined: Oct 13, 2005
Posts: 46337
I would agree with Jesper that the structure of the Sun website can be confusing for a newcomer.
Piet Verdriet
Ranch Hand

Joined: Feb 25, 2006
Posts: 266
I'd like to buy a new line character, please.
Campbell Ritchie

Joined: Oct 13, 2005
Posts: 46337
Please, Piet

That sort of request is only permitted on 1st April.
I agree. Here's the link: http://aspose.com/file-tools
subject: Why java is unknown
It's not a secret anymore!