Questions tagged [comparative-review]
This tag is used for questions which present a problem and multiple solutions, where the asker wishes to know which solution is best (and why).
17
questions
2
votes
3
answers
660
views
Capture multiple errors before raising an exception
I have a scenario where I need to store values from some environment variables (names of which I cannot control). My first run at this was pretty basic, however this is not usable as an exception ...
3
votes
1
answer
81
views
How to avoid null Values in a .NET 6+ ASP.NET project [closed]
I'm currently exploring multiple options to get rid of null values in my .net web api applications.
Let's say, that we have the following Project:
...
3
votes
2
answers
69
views
Reading a file into lines (benchmarking getline() vs mmap_memchr() vs mmap_getline() vs fread())
This is a follow-up to: Reading a file into lines with mmap vs getline.
The actual names of the functions are not ...
7
votes
1
answer
232
views
Reading a file into lines with mmap vs getline
I required a function to read a file into lines for a text editor, and ended up with two routines. One uses getline(), and the other uses ...
3
votes
1
answer
92
views
Simple C++ event loop - static vs dynamic dispatch performance
I have two extremely simple toy implementations of an event loop, and would like to understand the performance differences between them.
First impl - events with a virtual 'handle' method - dynamic ...
3
votes
1
answer
47
views
Comparing a set of parameters contained in two separate strings in Powershell
I have a situation where I need to compare two strings with each other in a foreach loop that potentially run over millions of rows of data. The two strings will always contain between 1 and 12 ...
7
votes
2
answers
281
views
Subtract two lap times (m:ss:fff)
I have two lap time strings I need to subtract, the format is minutes, seconds, milliseconds. This is to compare a new world record time to the previous holder's ...
5
votes
1
answer
213
views
Compute the mean of a series of user-entered numbers
Which is more elegant out of two methods as mentioned below mostly from memory prospective?
Both methods achieve the same result, but from a memory perspective, In Method1, we are storing the running ...
1
vote
3
answers
147
views
Count number of clients that have subscriptions
I have two working solutions, one using an accessor (getSubscription()) and one using a member variable (subscription).
Which ...
10
votes
2
answers
909
views
Leap Year Calculator Using If Elif and Else Only
I'm taking the 100 Days of Code (Python) taught by Angela Yu on Udemy. There have been a few other questions revolving around this lesson but I can't find one who came up with my specific question so ...
6
votes
3
answers
613
views
Implementing a --assume-yes/--assume-no command line flag to affect a `input()` based `confirm()` function
I have a Python command line application that needs to ask the user for confirmation at some point. I want to add a --assume-yes/...
1
vote
0
answers
63
views
Combined or separate data-cleaning routine
I am a junior data engineer that have 3 years of experience with Python. I write a lot of Python code for my job and I came up with this question I can't solve by my own. I don't have the chance to ...
2
votes
1
answer
46
views
Comparison of Named parameters and the Java Builder pattern in C++
OK writing a C++ wrapper on top of openSSL.
Setting up the SSL_CTX* object. There are a whole bunch of extra functions to specify functionality on how this object ...
3
votes
1
answer
54
views
maxlist(L, M) that succeeds if M is the max number in the list L
I'm working my way through "Prolog For Artificial Intelligence" by Ivan Bratko, and exercise 3.17 is to write a maxlist(L, M) that succeeds when ...
1
vote
0
answers
59
views
Revised: best practice of communicating with an instrument using Python
This is a revised version of the code from the previous question. It corrects the spelling errors, add in appropriate comments for argument types and doc strings, rewrite number representation, and ...