I was building a GUI in Java and discovered, to my annoyance, that the getText() method for the JPasswordField component has been deprecated. (It’s probably been deprecated for a WHILE and I just never cared before). So I use the getPassword() method instead.

Only getPassword() returns an array of characters (a char[]) instead of a String, which the rest of my code expects. I had a brain-fart and couldn’t remember how to turn one into the other. It happens. Rather than hunt through the API for which method turns a char[] into a String, I just Googled it. I found a nice discussion where experienced programmers jumped all over some guy for asking them how to turn a char[] into a String. He asked them instead of just reading the API docs for himself. Their response, predictably, was along the lines of “Read the API and stop asking stupid questions.”

I ALSO found that you could just do a String s = new String(char[]) , but that’s not what this post is about. Why am I bothering to post this, then?

Two reasons:

  1. Berating someone for wasting your time with a simple question on the internet is…wasting your time. This guy asked a question in a public forum. If you think it’s a stupid question, all you have to do is NOT FRIGGING ANSWER IT. Making the effort to berate someone does indeed waste time and bandwidth… but YOU are the one doing it. Not them. These people were wasting their own time and blaming this guy for it.
  2. If it’s easier for people to find answers to simple API questions on Google than it is for them to simply look in the documentation, maybe… just maybe… the problem is the documentation, not the people.

End of rant.

Popularity: 6% [?]

  • No Related Posts Found
  • One Response to “RTFM Doesn’t Help”

    1. StumbleUpon » Your page is now on StumbleUpon! says:

      […] Your page is on StumbleUpon […]

    Leave a Reply