go away spammer

Author Topic: What's the point of a library?  (Read 1674 times)

0 Members and 1 Guest are viewing this topic.

Offline vipulan12Topic starter

  • Robot Overlord
  • ****
  • Posts: 181
  • Helpful? 0
What's the point of a library?
« on: March 13, 2013, 05:52:38 PM »
What's the point of a library?

Offline waltr

  • Supreme Robot
  • *****
  • Posts: 1,944
  • Helpful? 99
Re: What's the point of a library?
« Reply #1 on: March 13, 2013, 07:33:41 PM »
I'll assume you mean a software library.

Instead of writing a function to do a particular task every time you write it once and then reused it each time it is needed. When you buy/download a compiler it usually has a number of functions "built-in". These are in libraries.



Offline vipulan12Topic starter

  • Robot Overlord
  • ****
  • Posts: 181
  • Helpful? 0
Re: What's the point of a library?
« Reply #2 on: March 13, 2013, 07:41:14 PM »
could you give me an example so i could better understand the concept
thanks

Offline Azraels

  • Full Member
  • ***
  • Posts: 57
  • Helpful? 1
Re: What's the point of a library?
« Reply #3 on: March 13, 2013, 08:16:49 PM »
Think of a regular library. Whats it there for? So that you can go and look up information on a certain topic and not have to go out and do research someone else has already done.

So lets say you want to use a servo. Do you just hook it up to your mcu and and it knows what to do with it already? No.
Do you go and write all that detailed code that tells the mcu exactly what to do? No.
You use the library in which someone has already written the hard code and all you have to do is simple commands. You tell your compiler you want to use the servo library to do so and so with said servo. What really happens is when you compile your code, the compiler goes to the servo library and retrieves all that extra info it needs and throws it into the program to control that servo that someone has already written.
Hopefully that explains it.

Have you ever taken a programming class? If not, look up Stanford University's Programming Methodology Class on Youtube. Start on class 1 and work your way through.  It is Java but it will give you a good base for further learning and the teacher is pretty interesting. You can also get the class schedule and example from Stanford's Website. Its all free!!
If your first post is, "I want to build a super complex robot with object recognition, etc..but I have never done programming or electronics...etc." 
Your doing it wrong. Start Simple and Work Up.

Offline Azraels

  • Full Member
  • ***
  • Posts: 57
  • Helpful? 1
Re: What's the point of a library?
« Reply #4 on: March 13, 2013, 08:23:25 PM »
And a preemptive, "Where is that?"

Lecture 1 | Programming Methodology (Stanford)
If your first post is, "I want to build a super complex robot with object recognition, etc..but I have never done programming or electronics...etc." 
Your doing it wrong. Start Simple and Work Up.

 


Get Your Ad Here