Re: comparison between portability libraries?




"Friedrich Dominicus" <just-for-news-frido@xxxxxxxxxxxxxxxxxxxxxxx> wrote in
message news:8764lssc2r.fsf@xxxxxxxxxxxxxx
"cr88192" <cr88192@xxxxxxxxxxxxxxxxxx> writes:

"Friedrich Dominicus" <just-for-news-frido@xxxxxxxxxxxxxxxxxxxxxxx> wrote
in
message news:87sloxeha6.fsf@xxxxxxxxxxxxxx
well what's your opintion about diverse offers then?

- libapr
- libcurl
- libxml2
- libpcre
- glut
- glib
- libssl (eay)

most of these offer functionality that is imo a minor issue to
implement...
Ok, let's see

glib contains code for all kind of data structures, an minor issue to
implement?

can't see what would be that hard.

maybe daunting, if one wants to implement everything, but one can implement
what they need, and thus need to implement less.


consider as a simple case, a hash table. I use these things all the time,
but I have pretty much never made any centralized code for them. why?
becuase, they are trivial to a point of not even needing to reuse the code.
the exact algo (hashing function, lookup and insertion behavior, ...) can be
varied for the particular use, but it is no big deal.

linked lists, are the same way. they can either be implemented in the
structures themselves, or externally (as in glib, lisp, ...). again, the
code is no big deal.

likewise with most of the other things there.


libssl offers minimal functionality?

well, this is bending what I had said. I said "minor issue to implement" not
"minimal functionality". something can be easy to implement, and do a whole
lot, or be hard to implement, and do little.

encryption is not impossible to implement. sufficiently detailed
descriptions are not that hard to find.

libssl, however, is one where I might consider just using the library
(reason: a lot of algos are needed to be able to really negotiate).

concievably, one could do their own and only support, say, rc4, but the
security wont be there, and it won't work if, for whatever reason, the other
end doesn't know about rc4.


libcurl just contains code for handling all kind of download problems

yeah.

http is not that complicated of a protocol either. I did this myself once
before (writing both the client code and a server).

likewise, back when I wrote an os, I did all my own network code, and also
built the webserver into my kernel. however, the problem was my os's tcp
code was horridly slow, making using tcp for much of anything an unpleasant
task (part of my problem here was that I took a very questionable approach
to designing my network stack, eg, basing it around a number of
communicating threads, and putting the speed at which data flows at the
mercy of the scheduler...).


for something as simple as xml parsing, regexps, ... why risk a library
dependency?...
Why writing such code yourself? I would really like to see you regular
expression matching code.

in my case, I never really needed regexps, so I haven't implemented them. as
for other manner of parsing tasks (mostly c-style parsers, other customized
parsers, ...), have wrote enough of these.


not really, then again, I doubt they will do me much good, as for
anything
one uses an external lib for, they need to make sure that lib is
available.
So what why is that a problem?

because, it is.

I personally get rather annoyed by software that I can't build because it
depends on libs which I can't get to build, or may in turn depend on other
libs that fail to build.

the software, in this case, often may as well not exist...

it is often easier to throw together one's own app than to try to understand
someone else's codebase enough to modify it so that it will work.


my preference is, instead, to do things like this myself.
you may have enough time at you hands


sure, if my project has around an extra 100-200 kloc or so in basic
utility
code, then maybe that is a little much, but no big loss...
Not big loss? Interesting how much time have you spend to write such
code and how many errors have you found.

haven't kept track of errors count, if anything, probably some huge
number...

my projects have been created over a number of years of fairly consistent
coding effort. a lot of it depends, eg, how much weight one would put on,
say, a years worth of coding (maybe a year coding on average for about 4
hours/day). this would be about 1460 hours, and for 100 kloc, one only has
to write about 68 loc/hr. this is a fairly light pace really.

now, it is rarely so even, more often it is maybe a few days without writing
much of anything, then maybe sitting around and writing a few kloc in a
single sitting (probably somewhere around 4-8 hours), followed by a lot of
time of writing code in smaller pieces, ...

most of the time is sat around pointlessly trying to think up what I am
going to do next, much more than is actually spent coding. writing misc code
(often to eliminate some annoying dependency, or improve on something
pre-existing) often can serve as a useful distraction, followed by making
actual progress once some issue has been resolved (or, I get around to
it...).

looking at it up front, that may seem scary, in retrospect (after the code
has been written already), it is no big deal. if I had to do it all again,
maybe I would have second thoughts, luckily I don't have to, so I can use
what I have written before.


most of these features are small, eg:
file io (core) 431 loc;
Portable between?

pretty much anything, this code is self-contained.
the one just below it (directory fs code), uses mostly ansi c, and a few
posix calls (stdio stuff, stat, opendir/readdir, ...).

most of the rest of the code is pretty much self-contained.

I see your points.



Regards
Friedrich


--
Please remove just-for-news- to reply via e-mail.


.



Relevant Pages

  • Re: Which programming jobs will not be sent overseas?
    ... That is, of course, a statement of your opinion, and so can hardly be ... > writing is improved by first dealing with my own anger. ... > Requirements writing is more difficult than bonehead coding, ...
    (comp.programming)
  • Re: 1st ed Request on Stats
    ... a software upgrade was being done. ... coding in university did help me communicate problems with the ... BTW, I have done substantial professional writing, some professional editing, ... They pay me. ...
    (rec.games.frp.dnd)
  • Re: comparison between portability libraries?
    ... most of these offer functionality that is imo a minor issue to ... glib contains code for all kind of data structures, ... libssl offers minimal functionality? ... libcurl just contains code for handling all kind of download problems ...
    (comp.lang.misc)
  • Re: Using a string as a hash (symbolic ref)
    ... SB> programs) writing the tests than I do when I'm writing the programs ... coding is coding and the more you do the more you learn. ... just a plain string with / chars on the ends. ... the unlike call will convert that but the / will be literal / chars. ...
    (perl.beginners)
  • Re: Yikes!
    ... I too would like to encourage anyone that is still coding for the ... Atari, to take advantage of the work that has been put into FreeMiNT ... and 15-years-old programming tutorials do not ... who wrote it are either gone or still writing for it. ...
    (comp.sys.atari.st)