Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I find methods?

Here's a somewhat general computer question. I've always been able to follow the LOGIC of programming, but when I go to code something, I always find that I don't know some method or another to get what I need to get done. When I see it, I always think, "OF COURSE!".

How do you go about finding relevant methods for your programming needs that are "built-in?" I don't enjoy re-inventing the wheel, but I find it difficult to find what I need to do what I want to do.

like image 553
joe Avatar asked Dec 02 '22 04:12

joe


2 Answers

First try Google:

You can use google to search your required method. For example If I want to search a value in array in PHP then I go to Google and type "Search values in array in PHP". I find my required function at first place.

Then try Standard Documentation:

Try standard documentation to search for your required method. For example if my problem is related to strings in PHP then I go to String Functions documentation and find the required function.

Finally try Stackoverflow:

Otherwise you can ask your problem at Stackoverflow for your required methods and libraries. You will always get a shortest way.

like image 104
Naveed Avatar answered Dec 05 '22 18:12

Naveed


What you are asking here is for the best way to do research. Well, that's hard skill to explain, even more so to teach.

Nevertheless here are some tips:

  1. Go to a search engine. It makes no sense to start in a place like MSDN, since all of its content is indexed by the search engines anyway. Phrase your question several different ways.
  2. As you learn more about the issue you will learn new vocabulary about it. Use that new vocabulary to do even more searches.
  3. If the searches turn out empty, switch to browsing a specific section of the official documentation that you think is the most related to what you are doing. If nothing else, it will expand your horizons around the issue and give you more vocabulary to do more searches.
  4. Finally, if all else fails ask a question on StackOverflow explaining what you want to do as clearly as possible.

Note that if there's a simple API that does what you need, you will rarely reach step 4.

like image 25
David Reis Avatar answered Dec 05 '22 18:12

David Reis