Library Mania

Everything else that doesn't fall into one of the other PB categories.
Max.
Enthusiast
Enthusiast
Posts: 225
Joined: Fri Apr 25, 2003 8:39 pm

Library Mania

Post 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.
Athlon64 3800+ · 1 GB RAM · Radeon X800 XL · Win XP Prof/SP1+IE6.0/Firefox · PB 3.94/4.0
Intel Centrino 1.4 MHz · 1.5 GB RAM · Radeon 9000 Mobility · Win XP Prof/SP2+IE6.0/Firefox · PB 3.94/4.0
User avatar
Rescator
Addict
Addict
Posts: 1769
Joined: Sat Feb 19, 2005 5:05 pm
Location: Norway

Post 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.
Last edited by Rescator on Sat Aug 06, 2005 3:08 pm, edited 1 time in total.
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Re: Library Mania

Post 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!
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
User avatar
Rescator
Addict
Addict
Posts: 1769
Joined: Sat Feb 19, 2005 5:05 pm
Location: Norway

Post 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.
Dare2
Moderator
Moderator
Posts: 3321
Joined: Sat Dec 27, 2003 3:55 am
Location: Great Southern Land

Post 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.
@}--`--,-- A rose by any other name ..
User avatar
NoahPhense
Addict
Addict
Posts: 1999
Joined: Thu Oct 16, 2003 8:30 pm
Location: North Florida

Post by NoahPhense »

If you lib is good enough, sell the source with a tight developers agreement.

- np
User avatar
Rings
Moderator
Moderator
Posts: 1435
Joined: Sat Apr 26, 2003 1:11 am

Post 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 ;)
SPAMINATOR NR.1
User avatar
NoahPhense
Addict
Addict
Posts: 1999
Joined: Thu Oct 16, 2003 8:30 pm
Location: North Florida

Post 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.. ;)
jack
Addict
Addict
Posts: 1358
Joined: Fri Apr 25, 2003 11:10 pm

Post by jack »

I am not a fan of GPL style licences, either release the source to the public domain or keep it.
Justin
Addict
Addict
Posts: 948
Joined: Sat Apr 26, 2003 2:49 pm

Post 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.
User avatar
NoahPhense
Addict
Addict
Posts: 1999
Joined: Thu Oct 16, 2003 8:30 pm
Location: North Florida

Post 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
Dare2
Moderator
Moderator
Posts: 3321
Joined: Sat Dec 27, 2003 3:55 am
Location: Great Southern Land

Post 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? ;)
@}--`--,-- A rose by any other name ..
User avatar
Rings
Moderator
Moderator
Posts: 1435
Joined: Sat Apr 26, 2003 1:11 am

Post 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.
SPAMINATOR NR.1
Dare2
Moderator
Moderator
Posts: 3321
Joined: Sat Dec 27, 2003 3:55 am
Location: Great Southern Land

Post 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. ;)
@}--`--,-- A rose by any other name ..
Kale
PureBasic Expert
PureBasic Expert
Posts: 3000
Joined: Fri Apr 25, 2003 6:03 pm
Location: Lincoln, UK
Contact:

Post 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
--Kale

Image
Post Reply