Skip to main content
6 votes

TFunction: std::function replacement for event system

Design Tell us what your code does, and also add such a comment to the code. As far as I can tell, it adds equality-comparability, by dropping type-erasure, thus dropping support for all but two ...
Deduplicator's user avatar
  • 19.3k
4 votes
Accepted

Several approaches to a logging class

Singletons There are several ways to make something a singleton. You are doing it by removing the public constructor, and forcing users to get an instance through a static member function. That works,...
G. Sliepen's user avatar
  • 58.3k
3 votes

Measuring method execution time

Here are a couple of suggestions: You don't have to repeat yourself in each Invoke method. Reuse the implementation of the largest one by calling it from other ...
t3chb0t's user avatar
  • 44.3k
3 votes
Accepted

Counting quiz for children

First off I noticed a problem in how the quiz chooses the numbers: It can easily happen that two (or more) numbers are the same. Especially when picking number between 1..5. In that case it can be ...
Rene Saarsoo's user avatar
  • 2,062
3 votes

Measuring method execution time

Because you are interested in the time it took and not the stopwatch, you should return a TimeSpan. And since we no longer need ...
Dan Friedman's user avatar
2 votes
Accepted

View controllers and delegation for a weightlifting app in Swift

For me it's a bit misleading that you have CalculationFormula all over the place. I'd create an extra model or struct to handle the formula logic or just hold the ...
Marc's user avatar
  • 136
2 votes

Several approaches to a logging class

You chose a good implementation but then made something weird Your Singleton implementation is a good one -it is the canonical implementation in C++ anyway, its ...
papagaga's user avatar
  • 5,757
2 votes

Counting quiz for children

I know I have mentioned this in previous reviews - it would be wise to cache DOM references. For example, I see multiple places in your code where the element with id attribute ...
Sᴀᴍ Onᴇᴌᴀ's user avatar
2 votes

Way to delegate command to methods in different files

Separate modules You didn’t specify a file name for the code in the first block- is it something like builtin.js? The code in the first block should be divisible into two files- one for ...
Sᴀᴍ Onᴇᴌᴀ's user avatar
2 votes

Validating CSV headers against an expected list

You could do something like this: ...
RootTwo's user avatar
  • 10k
2 votes
Accepted

Validating CSV headers against an expected list

Move the data column validation into a function ...
Nkosi's user avatar
  • 3,246
2 votes

Pool of Thread Pools

In general, I think this code is readable and comprehensible. I don't have many complaints That said, awaitTermination waits sequentially for each sub-pool in turn -...
Sara J's user avatar
  • 3,471
1 vote

Pool of Thread Pools

Starting with the requirements it's not clear to me why "instead of having all threads running at the same time, we wanted them to timeout." If I understand your goal correctly, you want to ...
Adam B's user avatar
  • 151
1 vote

Java - propagating a threadlocal by wrapping a runnable

It might be good to revert the ThreadLocal changes in the worker thread as soon as command.run() finished (using ...
Marcono1234's user avatar
1 vote

Selecting multiple filters based on the true/false conditions

Perhaps reconsider the if statements I cannot comment too much on the logic because I don’t really understand what’s going on: But it definitely does like there is something funny with the if—else ...
BenKoshy's user avatar
  • 1,011
1 vote
Accepted

Amplitude and Frequencies of sound Analyser

This is mostly correct. The reasoning for using delegates is that the class should inform its delegate, not instruct it. A symptom of this is that SoundAnalyser is ...
Luke Van In's user avatar
1 vote

View controllers and delegation for a weightlifting app in Swift

Here are the changes I ended up making. I abandoned the idea of using an enum for the formulas. I already had the formulas as NSManagedObjects and now I know how to get what I need with those. I also ...
Jim's user avatar
  • 185

Only top scored, non community-wiki answers of a minimum length are eligible