views:

845

answers:

19

In the last few years I've become very bad at memorizing API functions, how to use them, etc b/c I can get a reminder very easily using search engines (or StackOverflow), and do copy / paste / modify. I'm starting to feel like I'm relying too much on it.. sometimes to the point of getting stuck if I don't have access to the Internet :-)

Do you think it's a bad idea to substitute your memory with the Internet? Do you make a conscious effort to memorize API's ?

I realize it's a weird question... but I'm interested in surveying what good programmers do out there.

+10  A: 

I personally don't think there's anything wrong with this as long as you don't completely depend on copying and pasting (You should definitely understand whatever it is you're copying and pasting), and can comfortably lookup and understand code documentation when you need to. When I find a snippet of source online that I could use, I type it out myself instead of pasting, to make sure I understand each line. This helps you remember how you solved said problem, so that when you encounter that problem again or a similar one, you'll have something to build off of. It's easier to remember things when you understand them than when you're merely copying and pasting, in my experience.

Jorge Israel Peña
Of course.. you should always understand your code. But perhaps one would be a faster programmer if used more the memory. There is a lot of time lost opening the browser, searching... figuring out the right hit and copying.
Nestor
I guess it depends on the situation and the programmer then. Some people have become adept at searching, they know exactly what to search for and what results should have priority. Merely glancing at the examples/documentation makes things 'click'. If you're taking so long because you honestly don't know what to do, therefore depend solely on the Internet, then there's a problem.
Jorge Israel Peña
I became very good at searching and finding what I need. Most of the times I can even remember where I found something in the past. But still.. the search time is significant.
Nestor
@Nestor, you have just outsourced your memory xD
rockacola
+2  A: 

Why not? Make the computer do the work so we can get more function points out the door faster and more accurately. Autocomplete of objects/methods? great. Popup documentation? wonderful. I can't remember it all. All those gigahertz waiting to be used? Make them do something for us.

However I do fear how I would ever be able to answer any coding interview questions.

The downside of copying someone's code off a website is the subtle bugs in may include like ignored null variables, bad pointer/memory management or ignored exceptions. Always read through any posted comments before blindly copying a chunk of code.

james
+1  A: 

Yes. I overcome it with Google.

Russell Newquist
A: 

Memorization comes with repetitive usage. Any other way is forcing it.

Jed Smith
Well.. good memory is like going to the gym. If you don't force it a bit everyday.. you lose it...
Nestor
A: 

If you understand the problem and you have solutions for it, I thinks it's okay, api's are not as important as how you solve the problem, however you must understand what you are coding, even is don't remember the name of the class or function

Examples: When to use Vector or ArrayList

MexicanHacker
+2  A: 

I think it's good practice - just as we have moved away from extracting square roots by hand. This is part of our evolution towards an information-based organism and Wikipedia and SO are excellent examples of good practice. It will make most of us much more effective and innovative.

peter.murray.rust
+15  A: 

It's a side effect from intellisense and almighty search engine... you can try something I am doing:

  1. Try to use brain for at least 15 seconds before look up references or google
  2. Print cheatsheets of common use APIs, place on wall behind your monitor and repeat step 1
  3. Use text editor for minor code changes instead of launching your IDE
  4. Type out codes instead of copy and paste

Comments are welcome as I am also trying to overcome my habbit of not using my memory.

rockacola
I like your approach rockacola.
Nestor
@Nestor, in the end it is actually a training for discipline rather then memorization. Programmers are smarty and you knew it ;)
rockacola
May be I chose the answer I was expecting from the beginning... so yes.. I'm biased... but I've got great comments from most people. Thanks! It was a fun question.
Nestor
I agree that intellisense encourages this bad behaior. That's part of why I avoid using it.
Paul McMillan
In a similar tale of memory-assistive-technology-gone-bad (and the reason I've completely disabled this "feature"): one day I discovered I always spelled the word 'insidious' wrong and never knew it. Auto Correct would always automagically fix it for me without ever letting me know to learn from my mistake. (Ironic, actually.)
daveidmx
A: 

You could try using a good reference book instead of using the internet most of the time.

I tend to memorize better looking up something this -old school- way. I guess there may be some logic behind it since it seems a little more cerebrally intense.

ChristopheD
I decided a few years ago to sto buying technical books.. unless it's extremelly necessary. They become obsolete very quickly and it's hard to throw them away :-)
Nestor
+1  A: 

I think it's more the way you think and approach a problem than how well you remember APIs. Google/cheatsheets/journals are like extensions of your memory.

It has been almost six months since I've started using Qt and one thing that helped me memorize some common APIs were patterns. After using Qt for some time I've started noticing there are a lot of things in common between methods in various objects. Call behavior, various parameters and so on.

frgtn
Voting up since I've had very similar experiences with QT. It helps if the API calls (in one lib) are internally very consistent (which is ~mostly~ the case when considering QT, but not in a lot of other libs i've worked with alas...)
ChristopheD
A: 

I think the important thing is knowing what is available to you via the API or framework you're using. For example, if you know that the .NET Framework has an API for converting text streams to and from various encodings, then you won't waste time implementing it yourself. Sure, you'll spend a few moments probing intellisense or googling, but this time is fairly negligible.

Annabelle
Oh yes... let's not forget intellisense... I think that feature is making me incapable of liking dynamic/scripting languages! :-)
Nestor
A: 

I hate to post a similar response to ChristopheD's. However, I learned how to program with Visual C++ without having an internet connection. I used the MSDN, a C++ book and Teach yourself VC++ in x days. It was tough and frustrating. It also took me much longer to develop than if I had Google at my finger tips. (At that time, Google wasn't arround) What I did get out of it was that I could develop what I wanted and I knew how to find help through the resources given.

monksy
+1  A: 

I personally use the documentation, editors code completion , google etc. etc., almost anything except trying to memorise the API.

I used to know such Arcane APIs as IBMs DLI database API or Java JNI interface by heart, but these days I work with just too many languages with too many APIs to have any hope of remembering any of it.

One week I couple of years ago I wrote code in: JCL, COBOL, Rexx, SQL (DB2), Asemmbler(OS/390), C, Java(plain), J2EE, perl, php, html, css, SQL (sqlite), xsd in a single week!

The biggest problem I find is when languages are similar but not quite the same. is Length($var); valid in perl or php? Is DATE('1999-12-31') valid in sqlite? I just dont know anymore.

Rather than sweat it I just admit I am old and slow and keep the manuals open.

Knowledge of how to structure and shape a program is in the end more important than knowing how to spell "substr" in any given language.

James Anderson
+3  A: 

Knowledge is of two kinds. We know a subject ourselves, or we know where we can find information upon it. - Samuel Johnson, 1775 (reference)

As long as you thoroughly understand the material when you find it, I don't see a problem. In fact I run Tomcat on my dev machine with a page full of handy links. e.g. The Javadoc for String is never more than 2-3 clicks away.

Michael Easter
and the third kind is knowing the sayings about the kinds... +1 for your quote and your Tomcat memory-helping server!
Nestor
+5  A: 

Intentionally memorizing an API is called procrastination IMO. Either it will come with regular use, or you're not using it enough to justify the time and effort of memorizing it.

If Google doesn't do it for you, download API docs in PDF or whatever, and use a desktop search utility. And don't forget to add your own notes and index them too.

Steve314
A: 

You can basically visualise the web page you used the API on, and how it behaved. Visualisation is a natural aspect of our brain that gets under utilized everyday.

Thanks, Tony. www.webcloudsolutions.net

Tony
what?? what are u talking about Tony? Have you read the question?
Nestor
I was addressing the question: "Do you make a concious effort to memorize API's?". And so my point is one of the ways I force myself is "visualise" a page, on a previous project which I used an API on, then later use a search engine as a last resort. Hope this makes sence..Using search engines to find stuff certainly makes us lazy - as we employ copy/paste and call it our own :).
Tony
A: 

If you're not using the computer to replace or augment tedious or difficult functions the human brain, or vast amounts of manual labour would usually be doing--- what ARE you using your computer for?

Breton
A: 

The same thing has happened to me, but I see no particular problem with it.

The brain is a fixed capacity resource just like the computer (at least in the short term), and the less brain resources we need to spend on remembering cryptic APIs and argument ordering, the more resources are spare for more interesting or important matters like architecture, usability or features.

I agree that you need to understand what you are doing, so you can fix it when it doesn't work correctly. But with that caveat, the more brainless we can make coding the better.

I like a quote from Alfred North Whitehead (early 1900s):

Civilization advances by extending the number of important operations we can perform without thinking.

I humbly suggest that autocomplete, Google etc. is part of this development, and that we are actually contributing to the advance of our civilization (nothing less :) by not spending precious brain resources on memorizing APIs unless we have a good reason to do so.

j-g-faustus
A: 

I look at it as having a small cache of data in my memory pertinent to the task at hand. If i don't find a given piece of info in that cache, i do a "soft page fault" into my memory to try to find the data. If it's not there, i'll "hard page fault" onto the web to get what i need.

RCIX
A: 

things are is layered , record only core layer knowledge to your brain (methods).