Java (or any) programming language library functions

SJP0tato

Senior member
Aug 19, 2004
267
0
76
Hi guys,

I'm in my senior year of my CSE degree, with almost all of my programming experience obtained from school projects. Something I've always wondered is how do programmers possibly get familiar with all the library functions of languages (Java being what I am most familiar with currently). It seems like there's always a method I'll be writing, and take several hours or sometimes days to work out how to code something that works, is efficient, and is decently readable. Then a few days later I'll see that someone else spent 5 minutes, used a few library functions and accomplished the same thing.

As much satisfaction I get from figuring it out on my own (the "hard" way), I always wonder how it is people know exactly what library functions are available, and when they would best be applied. I'm vaguely familiar with the java api documentation, but it only seems to come in handy to remind me of the functions I'm already familiar with, not learning what's out there & might possibly be helpful.

I guess I'm just wondering what some of you guy's suggestions would be as to a good way to learn these seemingly endless library functions, or maybe if there's a better way of searching that would be more useful (sometimes I'll google a few keywords of what I'm trying to get a method to accomplish & hope for the best).

Thanks guys! :)
 

UCJefe

Senior member
Jan 27, 2000
302
0
0
experience.

If you find yourself coding basic data structures (hash tables, queues, etc), chances are someone else has already done it. Other than that, if you know you are going to be using say sockets, just browse through the sockets API and see what's available. Start at a high level and just drill down. Even if you don't go into depth chances are something will stick and later when you are trying to do something you might remember that you say some function that would do it for you.

Really it's mostly all experience though, and like you mentioned... Google. :)
 

SJP0tato

Senior member
Aug 19, 2004
267
0
76
Really it's mostly all experience though, and like you mentioned... Google. :)

Hehe, that's what I was afraid of. Well, I guess the only solution is to get going on coding anything/everything. :p
 

kamper

Diamond Member
Mar 18, 2003
5,513
0
0
Java's not much of a problem. The api docs are great. It's probably mostly a mindset. When you need to accomplish something your first thought shouldn't be "how can I do this from scratch?" but "is this a common enough problem that someone's already solved it?" Usually somebody's already done it and usually that solution is good enough. You said most of your experience is through school projects. Well, if you get a job as a programmer you have a chance to learn api's from professionals (and if you don't you won't be working long ;)). Of course, I'm probably not qualified to advise: you're farther along in your schooling than I am :eek:
 

Barnaby W. Füi

Elite Member
Aug 14, 2001
12,343
0
0
Originally posted by: kamper
Of course, I'm probably not qualified to advise: you're farther along in your schooling than I am :eek:

Eh, considering the accessability of programming, I don't think anyone needs to be formally qualified really. I find myself thinking "man this guy is a dumbass" about CS grad students, when I myself haven't taken a single college CS class. :Q
 

SJP0tato

Senior member
Aug 19, 2004
267
0
76
Originally posted by: BingBongWongFooey I don't think anyone needs to be formally qualified really. I find myself thinking "man this guy is a dumbass" about CS grad students, when I myself haven't taken a single college CS class. :Q


This is definately true. I'd guess 95% of the cs/cse students that come out of school great at programming were already great at it before they even started (great being subjective, but that they can actually read/understand/write code in general). People outside the computing/programming world never understand when I tell them I'm learning the theory of programming, not actually how to program in any way whatsoever. Hehe, sorta like learning how to drive a car and how to deal with all situations when you've had maybe 5 minutes total time behind the steering wheel ever. :)

I think I figured out how to tackle this...I think I'm just going to start learning what I can about the easiest/most common things used (strings, arrays, ect), and work outwards from there. Last night I played with strings & the api documentation & learned a few neat little tricks already, I'd have to say it was the most fun/rewarding programming I've done to date.
 

cchen

Diamond Member
Oct 12, 1999
6,062
0
76
Usually what I do if I'm working on something in a language I'm not very familiar with is google what I'm trying to do to see if there's already something written or something already built into the language.
 

DT4K

Diamond Member
Jan 21, 2002
6,944
3
81
I've got a VB6 app that has about 20 different Windows API calls in it. I don't really know how any of them work. Some of them are from a great book we have called "VB tips and tricks". Most of them I found with google and just copied the code. In most cases, it's a matter of trying to solve a problem and thinking "there has to be a way to do this, I'm sure somebody has solved this problem already".