Page 1 of 2

Library Mania

Posted: Sat Aug 06, 2005 2:47 pm
by Max.
Sorry if it sounds offensive, and it for sure shall not be a dig at anyone using or creating libraries, but I can't understand the current library mania (aka "use libraries at any price for everything").

For sure, a library is nice if the result cannot be achieved easily in PB itself (or if some existing C source code gets wrapped), but why would one limit himself to some external commands if there is the choice?

Libraries-written-in-PB contras:

- lack the flexibility of source code (adding features, ironing out errors)
- are dependend on maintenance of the provider (linker errors, compatibility issues)
- no chance to learn from the source code & experience of others

pros:

- source is somewhat protected if it is a unique idea that shall not be shared open sourced.

The only reason I can imagine is that it appears to be more "cool", as if it was a built-in function. But over time, there were enough troubles with libraries and their development; to name some:

- commands added to PB conflict with existing (older) libraries
- download links for libraries not valid anymore (for example because the coder left the community)
- library not compatible with newer linker versions
- bugs in libraries that never got ironed out
- dependencies that can get/got invalid over time


Anyway, just some thoughts. Anyone is entitled to use or not to, whenever he likes.

Posted: Sat Aug 06, 2005 3:06 pm
by Rescator
Very good points there!

Myself I prefer to keep my "libraries" in the form of include files rather than pb libs.

And so far all my released code has been in the form that could easily be pasted into a include file.

As you said, if it's "proprietary" code, I may not do it that open,
but instead most likely use a dll instead.

This is why I really like the open source purebasic library effort currently going on,
it allows "quick fixes" or adaptions to the current project.
Improvements made can be shared back with the PureBasic open source library effort.

Re: Library Mania

Posted: Sat Aug 06, 2005 3:07 pm
by PB
> I can't understand the current library mania

I'm a bit the same. I only use libaries if I absolutely have to (currently, only
one: Paul's RC4 lib). This scares me because my app now depends on Paul
to keep it alive. I'd prefer to use a Procedure, but I've never seen one that
makes it as easy to use as Paul's lib.

The thing is, with each PureBasic update, there is a chance of libs breaking.
This happened once before with the RC4 lib, and it needed an update. What
if Paul wasn't around anymore? My app would be dead, or at least I'd have
to keep using an old version of PureBasic to keep using that lib. It's scary!

Posted: Sat Aug 06, 2005 3:19 pm
by Rescator
Take a look at viewtopic.php?t=14044
for a RC4 based encryption that allows streaming encryption even. (as RC4 is a stream chiper after all).

Should also be a to/from hex example as well.

Also search for RC4 on the forum for a few other posts (some whom inspired me to make that code as well)

So it's not that hard to make a ARCFour (RC4) include that provides all the features you need.

The code in that post btw can easily be replicated in PHP,
thus allowing a nice client/server compatibility too.

Posted: Sun Aug 07, 2005 12:21 am
by Dare2
Good points, Max.

I don't use them, my user library folder is empty.

In fact if I can't maintain 3rd-party code myself I don't use it, otherwise I and my clients are reliant on somebody else who is known only as an alias on these boards.

And if I can maintain it, it is used as an include file or, non-PureBasic, a DLL.


To the plusses, though, we should add that user libs do provide a way for code written in C, etc to be made accessible in a "natural" way.

Posted: Sun Aug 07, 2005 1:59 pm
by NoahPhense
If you lib is good enough, sell the source with a tight developers agreement.

- np

Posted: Sun Aug 07, 2005 4:56 pm
by Rings
i have released all my libs as Opensource, so everyone can learn from it, modify for his needs or enhanced that.
But it should be OpenSource.


A lot of libs here are 'hacked' together from Tips&tricks.
Also most of those libs are not complete Open(source).
A shame if the also want money for it ;)

Me too also did not use such libs.
But hell, everyone can do as he wants.

Remark:
Seems that we 'european' did more like OpenSource
than other guys ;)

Posted: Sun Aug 07, 2005 6:13 pm
by NoahPhense
I agree with you Rings. But on the other hand, if I'm making a DLL for the
sole purpose of making money from it.. Then no, there will be no source.

- np

* ps - I haven't made any $$ yet.. ;)

Posted: Sun Aug 07, 2005 6:32 pm
by jack
I am not a fan of GPL style licences, either release the source to the public domain or keep it.

Posted: Mon Aug 08, 2005 10:35 am
by Justin
The only true feature of a lib in my opinion is that only the used procedures will be included in the final exe. All the pb optimizations for small exes can become useless in a real world application because is a common practice to have generic includes/libs to perform common tasks and your exe will be filled with unused code. i hope pb 4 can create libs i wonder why in the world is not supported if taibite can do it.

Posted: Mon Aug 08, 2005 12:53 pm
by NoahPhense
Justin wrote:The only true feature of a lib in my opinion is that only the used procedures will be included in the final exe. All the pb optimizations for small exes can become useless in a real world application because is a common practice to have generic includes/libs to perform common tasks and your exe will be filled with unused code. i hope pb 4 can create libs i wonder why in the world is not supported if taibite can do it.
It can, just not in pb native code.

Unfortunately, I'm not swift enough to create my libs in C, nor would I want to. But either way, worst case scenario for me, is that I would be distributing DLL's.. vrs LIBs..

- np

Posted: Mon Aug 08, 2005 3:36 pm
by Dare2
jack wrote:I am not a fan of GPL style licences, either release the source to the public domain or keep it.
I agree.



BTW, I told a fib, above, when I said my userlibs where empty. :oops:

Rings' post reminded me that I currently have PBOSL in there! I should start to use some of that stuff! Esp the fastfile stuff which has always been tempting - but what if Rings had stepped out in front of a bus? That would have been pretty selfish as who would then fix the thing if it broke? ;)

Posted: Tue Aug 09, 2005 9:26 am
by Rings
Dare2 wrote:Rings' post reminded me that I currently have PBOSL in there! I should start to use some of that stuff! Esp the fastfile stuff which has always been tempting - but what if Rings had stepped out in front of a bus? That would have been pretty selfish as who would then fix the thing if it broke? ;)
are you a coder or a wining child ? ;)
There are a lot of talented coders around here
wo could change also my stuff.
That is the good part of OpenSource.

Posted: Tue Aug 09, 2005 11:55 am
by Dare2
Rings wrote:are you a coder or a wining child ? ;)
  • [ ] Coder
    [x] Child
:D

Yep.

The point being that until it was OS, if it broke it could not have been fixed!

And yep, now it is OS it is safe to use. ;)

Posted: Tue Aug 09, 2005 12:28 pm
by Kale
I always try and steer clear from third party libs, i like to have the source available for future maintenance.

Some of my apps do use other people's libs and to be honest its a pain in the arse when errors occur with them due to a PB update.

Give me code any day! :D