Skip to main content

Questions tagged [generic-programming]

Generic programming is one method for code reuse. It involves defining a general-purpose data or code structure that can be further specialized to work with concrete types at the location it is used.

Filter by
Sorted by
Tagged with
-1 votes
1 answer
110 views

I've been working on this project where my responsibilities are to code for validating, processing and then dumping into database excel file. Me and my colleague tried multiple approaches to make it ...
procrastinator1771's user avatar
0 votes
0 answers
69 views

In short story, I want to make some universal generators for different formats (CSV, XLS, XLSX and JSON for now). Just to be clear, I will make different classes for all formats. I have different ...
Lube's user avatar
  • 109
0 votes
2 answers
99 views

I came across Environment Diagrams,it is described below Whenever Python needs to work with an object, that object is stored in memory; and, additionally, Python also needs a way to associate names ...
Dennis's user avatar
  • 25
1 vote
1 answer
193 views

I have a data which is a std::vector of a "small collection" of items of a given type struct Bunny {};. I was vague about "small collection" because for now it's a collection of ...
Enlico's user avatar
  • 130
0 votes
1 answer
214 views

I am in the process of implementing a persistent collection in C, specifically, an immutable hash trie. In order to increase acceptance and reusability, I have identified the following key areas that ...
ammut's user avatar
  • 159
2 votes
3 answers
344 views

I want to manage music notes in a C# program, and I wrote a couple classes for that. However, I think I'm having trouble respecting the DRY principle. Either this or I'm overthinking things. Sorry if ...
qreon's user avatar
  • 339
0 votes
3 answers
1k views

1) Below is a python function summation, that can perform sum of cubes/squares/.., similar operations. def identity(k): return k def cube(k): return pow(k, 3) def square(k): return ...
overexchange's user avatar
  • 2,315
-1 votes
1 answer
122 views

As I can see in recent releases of akka-http, successor of spray, spray-routing's approach of using shapeless HList was replaced in favor of self-included Tuple What is the motivation for this ...
Odomontois's user avatar
0 votes
2 answers
3k views

NOTE : Feel free to edit the title if it is somewhat different than my question. In one of our application, we are maintaining a lot of properties inside Instance object. Obviously it's maintained as ...
The Coder's user avatar
  • 109
5 votes
2 answers
4k views

I have several Lists<> that holds objects of different classes. List<classA> listA; List<classB> listB; List<classC> listC; //... List<classM> listM; The classes do not ...
David's user avatar
  • 313
0 votes
2 answers
555 views

I've been trying to learn more about generics, and I finally felt that I ran into a situation that it would be more useful to use it instead of only regular classes. Would the following be a practical ...
Zabytus's user avatar
1 vote
0 answers
150 views

Alexander Stepanov stated in talks and interviews that his realization that eventually lead him to generic programming and the Standard Template Library, was from the case of the parallel reduction ...
user1358's user avatar
  • 341
7 votes
2 answers
4k views

I need to write some algorithms for a PIC micro controller. AFAIK, the official tools support either assembler or a subset of C. My goal is to write the algorithms in a generic and reusable way ...
enobayram's user avatar
  • 181
3 votes
4 answers
5k views

I never did generic programming before, being more of a python guy, and generally using OOP. As I moved into generic programming, I faced some issues. I read the FAQ, but I am not satisfied. What I ...
Stefano Borini's user avatar