Questions tagged [libraries]
A library is a collection of resources providing data and/or services for developing independent software.
385
questions
0
votes
3
answers
993
views
Share Global Variable in DLL, feasible or naive?
So the gist is to have a static global variable that can be modified by different executables. For example I have 2 different source files including the same dll.h:
dll.h
#include <iostream>
...
3
votes
1
answer
87
views
Shell Script Design Patteren: Source a library file VS Call different files?
We discuss about POSIX compliant shell script here.
While we are writing more and more shell scripts, we build some helper functions to reuse the codes.
We are considering putting a few helper ...
0
votes
3
answers
2k
views
Choosing language to write general library in
I'm about to start writing a library to support machine learning algorithms (decision trees, ANNs, Bayes nets, etc.), and I'm planning on making this a very general library. By this, I mean I want to ...
0
votes
2
answers
110
views
Appropriate design pattern for providing a default Argparse instance, eliminating boilerplate
I'm using argparse.ArgumentParser extensively; however, it comes with a lot of boilerplate to set up, and this is especially noticeable when you've got more than a few common arguments that probably ...
0
votes
2
answers
75
views
Deserializing serial protocol enums: Recoverable or unrecoverable errors?
I am currently implementing a library in Rust that implements a proprietary serial protocol.
The protocol specifies several enum values, that mostly are returned by the hardware as u8s (bytes), but ...
0
votes
2
answers
249
views
Local development for TypeScript library organized as mono repo with Lerna
I currently am developing a TypeScript shared library. The library needs to be imported in sections to minimize the imported bundle size, so I broke it up into packages with a monorepo with Lerna. ...
0
votes
1
answer
117
views
Options for designing a generic library
During development of libraries (mainly for use in internal projects) I have come across the "problem" of how to design them in a generic way. I am going to demonstrate with an example ...
0
votes
0
answers
79
views
Pattern for Nuget Package (Abstractions, DepedencyInjections, etc.)
I've been interested in following what other successful libraries are doing with their nuget packages. Unfortunately, I can't seem to find any materials to read online and I don't even know what to ...
0
votes
0
answers
106
views
How to handle dependency injection in a library to avoid frequent breaking changes?
Let's say I have a C# .NET library with the following classes:
public class FooService
{
private readonly IDependencyA a;
public FooService(IDependencyA a)
{
this.a = a;
}
...
0
votes
1
answer
69
views
Is it a bad idea to create a library that only contains some mappers and related functions? [closed]
There is a software (once monolith) that makes use of a long list of mappers. You can think of them as Choices field, where each item translates into different conventions.
For ex, say that they are ...
7
votes
5
answers
788
views
Do I have to deliver my utility and helper code to clients?
Over the years I've created a bunch of Java utility and helper libraries which I just attach to new projects. Then, when I deliver code to my clients, I send all the code except for the libraries ...
4
votes
4
answers
538
views
Design pattern to create a shared lib architecture
I am making a renderer as a hobby, one thing I thought to try is making the low levelAPI be dynamically swappable, i.e. you could have an opengl or vulkan backend and switch between the two without ...
5
votes
2
answers
8k
views
How do you use external libraries in git?
SFML, in this case, has a Git repo and a download page. Until now I have always downloaded from the download page, which came (at least for the compiler I use) with .a and .hpp files and could easily ...
12
votes
2
answers
2k
views
Designing a Python string validation library
My employer has a significant number of company-internal strings which require format validation. For instance, order number AAA-BBB-CCC, stock number AB-123456 or factory ABC1 - Regex with extras (...
1
vote
1
answer
92
views
How should I approach the development of an app with an parallel independent library?
I'm currently working on an ERP Blazor WebAssembly app that works alongside its base Razor Class libraries. The app could have some custom pages that aren't the same for all the customers and are ...
10
votes
3
answers
896
views
Boundaries of unit testing between my code and a library or sub-component
Background: I am new to testing in general, and have been studying it in context of JavaScript, specifically React.js, front-end development (actually new to this as well). For the question, I have ...
10
votes
1
answer
13k
views
Can one edit a built-in Python module?
I'm currently learning Python and I'm at the point in the book about using the Math library. I looked on the Python website and noticed the library was a bit scarce and am writing some more useful ...
2
votes
2
answers
1k
views
Best approach for utility class library using Visual Studio
I have a collection of classes that I commonly (but not always) use when developing WPF applications. The trouble I have is that if I want to use only a subset of the classes, I have three options:
...
0
votes
4
answers
731
views
Is API exactly the same as header file?
I am trying to understand the difference between an Application Programming Interface and a Library and I stumbled upon this question:
https://stackoverflow.com/questions/3678665/is-there-still-a-...
0
votes
2
answers
174
views
Why session should be a param when you write a query function?
I read a lot of examples where I read code like this:
def get_user_by_id(session, id)
...
and the function that calls that function needs to create or get the DB session a pass to the function.
the ...
4
votes
2
answers
470
views
System for scheduling parallel tasks/callbacks
I am looking for a system for building state machines with timed/scheduled transitions, and with events that happen periodically during a given state. I can implement it myself, though I feel like ...
4
votes
5
answers
668
views
How to prevent in house frameworks and libraries from becoming technical debt
My company develops many relatively small projects that a lot of times do the same things and have a similar structure. (e.g. read/write to a databse, data pre processing, building a query etc.). This ...
3
votes
1
answer
360
views
Shared library and modules with versioning
I have different versions of modules and they should all work together with the same shared library which could also have different versions like displayed in the image below:
From a daily use ...
0
votes
1
answer
512
views
How to handle config/env vars in a library project
I am building a new Python library project to be consumed by several of my application projects. The existing code consumes environment variables for various configuration settings. Should my ...
2
votes
2
answers
166
views
How to document external libraries that have been adopted into an existing codebase?
I have been using an external library for a while now. Unfortunately, it stopped receiving updates, and has since been adopted into my codebase.
The issue is the library was poorly documented in the ...
-3
votes
1
answer
141
views
Best way make a complex libraries as a plugin with dependency inversion principle [closed]
For instance, if we have a complex library with many functionalities, how can we make this lib a plugin such that it can be replaced with another lib more easily.
The answer obviously is the ...
5
votes
4
answers
9k
views
How to get an ILogger instance from extension methods?
Let's say I have this service abstraction exposed from a library.
public interface INavigator
{
ImmutableList<IPageViewModel> Entries { get; }
void NavigateForward(IPageViewModel page);
...
2
votes
2
answers
716
views
Strategy for offering a library both a single-header and as a header + compiled implementation
I am maintaining a FOSS library which, for the sake of discussion, consists of a small .h file and a larger .c file (plus build-related files, see below)
I've been requested to offer this library as a ...
6
votes
1
answer
647
views
Is changing the exception a method throws a breaking change for a library?
I have a library that I am distributing on maven in the new version I will be changing the exceptions some methods are throwing. Is this considered a breaking change? If this is the only change in the ...
45
votes
5
answers
17k
views
What is the difference between a library and a dependency?
In this docker beginner video its explained, that different stacks may depend on different libraries and dependencies and that this can be handled with Docker.
However, I don't get what the ...
2
votes
3
answers
167
views
Should I ensure my libfoo library's include file can be included as foo/foo.h?
I'm maintaining a small C library; let's call it libfoo. It has quite a few users (actually it's complicated - it's the main fork of a highly popular library which has been abandoned); and it sports a ...
1
vote
1
answer
284
views
Re-export (certain) library components from barrel file
Situation
At the project I'm currently working on we're using Chakra UI to create our UI. But I guess this question applies to whatever (UI) library you're using.
There are certain components that ...
40
votes
7
answers
10k
views
Why do library developers deliberately break existing code?
Today, I updated ZBateson\MailMimeParser the PHP e-mail parser library from 1.x to 2.x.
Soon enough, my PHP error log started filling up with errors.
Noting where it happened, I found out that it had ...
12
votes
9
answers
833
views
Should developers be expected to compile an internal library before the actual program?
Recently a senior developer that I work with made a case for requiring that developers get the latest version and compile as part of their project a major internal library. This stands in contrast the ...
6
votes
3
answers
986
views
How to simplify exception handling for library users?
Suppose of having a library exposing the following piece of functionality:
public static class AwesomeHelpers
{
public static async Task<int> ComputeSomethingImportAsync(CalculationInputs ...
0
votes
1
answer
940
views
How to expose C++ static library interface, extending Pimpl to an abstract interface
Until today I had a static C++ library with no separation between the public interface and internal headers. My other apps just linked to it, included the required headers, and used whatever they ...
2
votes
2
answers
121
views
What's a good solution for prioritising tasks for a company code library?
I work at a game company that has a Core Library with a bunch of ultities, extensions and systems that we typically import large chunks of into projects.
Recently we have been trying to improve our ...
1
vote
3
answers
4k
views
"Hard coded" vs. configuration files for values in libraries? (code organization question)
I'm trying to get a good understanding as to whether there is a best practice or standard regarding keeping values within your code libraries or referencing them from another config file. I don't ...
4
votes
2
answers
734
views
Async library guidance
I'm creating a library that contains a class that exposes several Async methods:
public class MyClass {
public async Task<Foo> DoFooAsync() { /*...*/ }
public async Task<Bar> ...
223
votes
14
answers
326k
views
Why aren't more desktop apps written with Qt? [closed]
As far as I know and have understood in my experience with Qt, it's a very good and easy to learn library. It has a very well designed API and is cross-platform, and these are just two of the many ...
2
votes
4
answers
525
views
Is it common practice to declare exceptions in a library that won't be thrown or caught anywhere within that library?
I have a very basic library that serves the purpose of collecting some useful but simple pieces of code. Like for example a Percent struct or functions like ToDegrees() and ToRadians(), just to give ...
3
votes
4
answers
430
views
Should functions depend on other functions?
Suppose I have a function to log error messages printError(). Suppose I have another function which might throw an error, doSomething(). Should doSomething() implement its own error logging or depend ...
4
votes
2
answers
3k
views
Preferable design of scope guard in C++
Recently, I came across an issue about the design of scope guard. A scope guard invokes a supplied function object (usually performs cleanup procedures) upon exiting the enclosing scope. The current ...
2
votes
0
answers
240
views
Drawing the boundary between high level API and low level API
Assume that were developing a cross platform graphics engine. Now we have quite a lot of low level APIs to choose from (OpenGL, Vulkan, DirectX 11, DirectX 12, ...). Now because of this, we are gonna ...
5
votes
2
answers
3k
views
Technical documentation vs Software design documentation
I am trying to start a documentation about a class library that is already finished/developed.
The purpose of the documentation is to be used by other developers in order to understand what kind of ...
34
votes
14
answers
14k
views
What benefits are there to native JavaScript development? [closed]
Given how much simpler jQuery development is, when compared to native JavaScript, what makes people forgo libraries like jQuery altogether?
Is this because jQuery has limitations or it is slow? I ...
7
votes
5
answers
8k
views
Priority value meaning
The library that I'm working on has a parameter which defines priority of a certain process. I want the interface to be as clear as possible, but it seems that different people have opposite ...
143
votes
2
answers
81k
views
What is a "shaded" Java dependency?
JVM developer here. Lately I've seen banter on IRC chat rooms and even in my own office about so-called "shaded" Java libraries. The context of the use will be something like:
"Such and so provides ...
6
votes
3
answers
31k
views
What is the difference between an API and a library? [closed]
I have a created a Java project. My project is a collection of classes that allow a programmer to manage local networks (create network, delete network-access to device, get information of SSID) and ...
63
votes
3
answers
48k
views
Are header-only libraries more efficient?
Assumptions
One of the advantages of header-only libraries for C++ is that they do not need to be compiled separately.
In C and C++ inline makes sense only if the function is defined in a header ...