Recent

Author Topic: how often do you opt for new implementation vs re-using someone’s code  (Read 3261 times)

silvercoder70

  • Jr. Member
  • **
  • Posts: 90
    • Tim Coates
All that I can say is ... it depends. And I hate the thought of re-inventing the wheel. The pros and cons of each are easy approach are easy enough to work out. And perhaps 2 examples:

1. I have used 3rd party software libraries (well known and purchased) that had issues and having to wait for a resolution.

2. JCL has functions for reading and writing to the Windows registry. A few years back a co-worker decided to write own Delphi functions to do the same vs (re-)using the code provided in the JCL.

Explore the beauty of modern Pascal programming with Delphi & Free Pascal - https://www.youtube.com/@silvercoder70

Marc

  • Administrator
  • Hero Member
  • *
  • Posts: 2615
At my job, the simple things like list management, network stuff, graphics and async communications are put in libraries and used in all our projects.
If something "complex" is available as third party source, we'll use that to give us a jumpstart.
In case of the SIP stack we bought, it was a fast start, but through the years there are so many things changed and added that you won't find a piece of the original code.
Recently I had the same with a 3rd party CORBA stack. It helped us interfacing, but it was bulky, complex and hard to understand. It had issues but we could work around it until early this year. It appeared to report wrong errors when a connection dropped (this was critical to us). So the lib was dropped and I rewrote a new, simpler implementation based on our own network layer.

When we needed SRTP, we could implement that ourselves, but encryption is hard to debug. Cisco had a nice simple, understandable C lib source, so we decided to use that as external lib.

Sometimes there is no lib available, only C sample code. In that case I had a choice to make it a C lib and use it, or pascalize the source. It took me, at that time, 2 weeks to have a working ACELP audio codec. Later I decided to do the same for a AMR-WB codec. This one looked similar, but took more than a month to debug it. Now I'm at a point where an OPUS codec is needed. It can be used as lib which would mean we have to distribute it, or I can convert it to pascal so we have it internally... (i think I go for the lib version)

Marc
//--
{$I stdsig.inc}
//-I still can't read someones mind
//-Bugs reported here will be forgotten. Use the bug tracker

Weiss

  • Full Member
  • ***
  • Posts: 183
FPC does not have large, convenient and well-equipped numerical libraries
I guess you have not seen NumLib which comes with fpc? ...(simple) fitting, root finding, special functions - most of what you need. A disadvantage is its awkward syntax. But it can be managed, and I was able to write a wiki for it: https://wiki.lazarus.freepascal.org/NumLib_Documentation

numlib is ok, but like you said, only simple - rudimental really - fitting. I needed cubic splines, trigonometric fit, Besier, FFT etc. Couldn't find anything free that would not say something about educational use only.

About numlib syntax, I am thinking, maybe it is worth of building an interface, a translator with more digestible names and conversion of everything that starts with "arb".

Dzandaa

  • Sr. Member
  • ****
  • Posts: 388
  • From C# to Lazarus
Hi,

I write my own programs,  it's a hobby now as I am retired.

But as SilverCoder says:


Quote
I hate the thought of re-inventing the wheel.


And with Lazarus, you can always look at the sources, it's a great plus.

@VisualLab:

I assume you have tested "LMath"

https://sourceforge.net/projects/lmath-library/

What is missing is a Library to make wavelets.

B->


Regards,
Dzandaa

Thaddy

  • Hero Member
  • *****
  • Posts: 16151
  • Censorship about opinions does not belong here.
I needed cubic splines, trigonometric fit, Besier, FFT etc. Couldn't find anything free that would not say something about educational use only.
All of that is available in pure pascal. some of it simply in the canvas units. Others in audio libraries.
Quote
About numlib syntax, I am thinking, maybe it is worth of building an interface, a translator with more digestible names and conversion of everything that starts with "arb".
As i wrote, it needs aliasing for mere humans, but that is all.
« Last Edit: July 11, 2024, 05:50:07 pm by Thaddy »
If I smell bad code it usually is bad code and that includes my own code.

 

TinyPortal © 2005-2018