Go Down

Topic: WHy not include your libraries (Read 2167 times) previous topic - next topic

rtrathbone

I have been bashing around in Arduino for a short time now. My back ground is in programing industrial PLC's (ladder and block), so naturally Arduino should be a good hardware transition, if I can adapt myself to the code.

The real gripe I have with the IDE or the Arduino community is that if your leveraging of a donor project (from intructables etc)to catapult your own tests, the download never compiles without errors and the libraries are generally missing?

Surely I am overlooking the obvious? and I would love a push in the right direction.

PLEASE NOTE: I match up the hardware selection as per the original documentation and always replace the <file> with "file" and make sure there tabs are present in the IDE work pane-still consistently get errors.

AWOL

#1
Mar 11, 2015, 12:43 pm Last Edit: Mar 11, 2015, 12:46 pm by AWOL
The lesson is, therefore, don't use Instructables as donor projects ;)

Seriously, take your gripe to Instructables - if they don't include the libraries, I don't see that as a failing of the Arduino community.

aarg

#2
Mar 11, 2015, 12:51 pm Last Edit: Mar 11, 2015, 12:52 pm by aarg
At least one reason for not including third party libraries in a project (as a package), is that updates and bug fixes for them won't be included. You'd often be getting an obsolete version.
  ... with a transistor and a large sum of money to spend ...
Please don't PM me with technical questions. Post them in the forum.

Delta_G

If you were willing to tell which code you were having trouble with, someone around here could probably help you get it to compile. 
|| | ||| | || | ||  ~Woodstock

Please do not PM with technical questions or comments.  Keep Arduino stuff out on the boards where it belongs.

keeper63

At least one reason for not including third party libraries in a project (as a package), is that updates and bug fixes for them won't be included. You'd often be getting an obsolete version.
This could be argued the other way, too: Say the project uses a particular function/method in the library that in a future update is removed...boom, project suddenly fails to work for people.

Ideally, the project should include all code needed to compile the project, with notes/documentation about which versions of libraries, etc are being used. That way, should a method/function change in the future, you still have the original code to review, and patch or fix whatever is needed to get the project to work with the current version of the library.

Also - in a few cases (maybe more) - libraries are named the same, perhaps for the same purpose (or maybe not) - and such libraries may even be named similar to "official" libraries! In such a case, the library the project is using may have completely different methods or functions than the official library (or other libraries sharing the same name). Thus - having the library included, again, would alleviate this problem, and perhaps make porting to an official library easier (maybe the project was created before an official library for the function was selected - or it could just be another one of those "not-invented-here-I-must-reinvent-the-wheel" things that programmers do - rightly or wrongly).
I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.

westfw

Quote
Ideally, the project should include all code needed to compile the project, with notes/documentation about which versions of libraries, etc are being used.
This quickly gets absurd for projects that have the complexity of the typical arduino project.  After all, "all code" includes the IDE, compiler, Java, and OS to run on various computers.   You wouldn't want every github arduino project to include an IDE .zip file (though it might be nice if they always documented which version they used!)

(This is a real problem for software companies, and they DO try to control ALL the tools.  (including the code-controlling tools, of course.  This is one of the things that you need an "IT department" in addition to and separate from the "developers.   Open source is considerably less careful.  I was recently looking at some classic code ("gdb stubs" for the 68k; part of the Gnu Debugger project, tightly associated with gcc.  In current gdb distributions, no one has modified this code in quite a long time, and it's quite obvious that it hasn't compiled under a current version of gcc in about a decade...)


keeper63

This quickly gets absurd for projects that have the complexity of the typical arduino project.  After all, "all code" includes the IDE, compiler, Java, and OS to run on various computers.   You wouldn't want every github arduino project to include an IDE .zip file (though it might be nice if they always documented which version they used!)
When I was speaking of "all code" - I wasn't implying the the entire system - just mainly the code for the ATMega (or whatever microcontroller). I wasn't even necessarily implying for inclusion of the main Arduino include library or anything, either (though that might be useful) - just some kind of documentation of version, etc of the Arduino IDE, etc used would be ok.

But everything else (other libraries) - it might be useful to include the source, or have it available in some fashion - even if it could compile against included versions.

I don't think that would get too much out of hand for most projects. Most Arduino projects are not anywhere as complex as some of the stuff I have worked on in my software development career, and any of those projects could have easily included everything and been downloaded (had they been open source, of course).

(This is a real problem for software companies, and they DO try to control ALL the tools.  (including the code-controlling tools, of course.  This is one of the things that you need an "IT department" in addition to and separate from the "developers.   Open source is considerably less careful.  I was recently looking at some classic code ("gdb stubs" for the 68k; part of the Gnu Debugger project, tightly associated with gcc.  In current gdb distributions, no one has modified this code in quite a long time, and it's quite obvious that it hasn't compiled under a current version of gcc in about a decade...)
Yes - version control is a big and hairy issue for any software - company owned/developed or otherwise. A big part of doing right is to establish the ground-rules early (ideally before any software is written), enforcement of the correct usage of the rules, and have plenty of documentation about everything. Setting up some kind of packaging and deployment system to help solve dependencies and such can be helpful as well.

Even so - these kinds of solutions and practices have been tried, with only limited success - it is a very big problem, certainly.

That said - on the scale of these small individual projects - there isn't even a hint of any kind of such discipline. For most of them, everything is "yolo" and "let the poor sod who downloaded my code figure it out". That is sadly the norm, and not the exception.
I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.

westfw

Usually you want to use the latest versions of all available libraries, up until it actually becomes incompatible in some way.   :-)

Some libraries have licenses that explicitly forbid redistribution with 3rd party code.  Microchip libraries are famous for this issue, and I think this is the reason that you have to download LUFA separately if you want to build the Catrina bootloader...

rtrathbone

Thank you to all that have responded.

AWOL, I never meant to offend you or the Arduino community, but I refer to instructables as an example. I'm glad you are always so proficient to include or document with great detail all your libraries with all your projects.

aarg, I understand the bug fix as a great option, however if I compiled an effective project today, a bug fix tomorrow may render it useless.

Delta_G, I don't expect anyone to do my work for me, but help is always much appreciated. Some good examples were I cannot compile:
http://www.hardcopyworld.com/ngine/aduino/index.php/archives/670
http://www.instructables.com/id/Make-an-Oscilloscope-Using-the-SainSmart-Mega2560-/


cr0sh, thanks you have clarified this in practical common sense,  I am intrigued on your second comment "I wasn't implying the the entire system" is this the part I don't understand? when I write a successful project any accompanying files(libraries) go with. I could save as a whole share a friend and they could just open and execute-nothing more to do. Isn't this best practice?

westfw, I agree, it would be nice to include it all-although I think in modern times the these files are still considered small when you look at all the other data we move and keep every day.


Go Up