32 votes
Accepted

Use of Async/Await for EventHandlers

The things to consider when it comes to async event handlers are: Exceptions thrown for the handler might be rethrown on the UI ...
svick's user avatar
  • 24.3k
22 votes

Updating dimensions when focus is lost from any of 9 columns

I don't do C# so pardon the syntax, but you should be able to reduce the amount of code by using a for loop over a string array with your column names. Again I don't do C# but in Java you could do ...
Emily L.'s user avatar
  • 16.6k
15 votes
Accepted

Updating dimensions when focus is lost from any of 9 columns

A shorter version would be to create an anonymous array in the if statement combined with a collection initializer where you will add all of the column names and ...
Denis's user avatar
  • 8,458
11 votes

Type-Safe Event System

C# events are type-safe. The common (and recommended) pattern is to use EventHandler<T>, where T is a custom type deriving ...
svick's user avatar
  • 24.3k
8 votes
Accepted

Yet another event dispatcher in c++11

Start/Stop You should consider calling these from your constructor/destructor so that the thread is ready when constructed and automatically stopped when destroyed. It would make is easier to use. ...
Emily L.'s user avatar
  • 16.6k
8 votes

Event functionality in C

Files The EventListener.h file should contain only declarations, as it needs to be safe to include in object files that are linked together. Put the definitions ...
Toby Speight's user avatar
  • 74.9k
7 votes

Overriding the mouseout handler for an image when a button is clicked

It is bad practice as you add a new handler each time your event is fired. To better understand this, try this: ...
Koch Maxence's user avatar
7 votes
Accepted

Event delegation without jQuery

The one thing different between your implementation and jquery.on is that jQuery allows you to bind on any element. One reason for that is performance. If on a deep ...
Joseph's user avatar
  • 25k
7 votes
Accepted

Handling dialog closure in a VBA user form

I like how your form is no longer concerned with anything other than being a form. One More Abstraction Level I'd go one step further, and encapsulate the controls, so that the presenter class doesn'...
Mathieu Guindon's user avatar
7 votes
Accepted

Using events together with interfaces in VBA

I use an additional 'event' class, where all necessary events will be placed in, and which will be injected into the interface implementing classes. That. That is how it's done. It's COM-friendly, it ...
Mathieu Guindon's user avatar
7 votes

Making an Action<T> event also usable as Action<object> and Action in C#

no memory should leak when it is used correctly. Adding and removing a handler results in an empty List<T> lingering in the ...
VisualMelon's user avatar
  • 7,431
7 votes
Accepted

Flex panels in CSS and JS

It looks pretty good to me. I can only see a few things to consider: More precise propertyName check You have if(e.propertyName.includes('flex')) { because Safari ...
CertainPerformance's user avatar
7 votes
Accepted

Event System using C++

Avoid macros There are many issues with macros, the general advice is to avoid them where possible. Let's look at EVENT_TYPE_FUNCTION(): it's there to add a few ...
G. Sliepen's user avatar
  • 55.4k
7 votes

CAT: Cat Approved TUIs

You appear to be asking for a review the part of the code you posted, not the library itself. (ETA: I wrote this before you posted any of the library code.) I’m not sure how useful that will be, but ...
Davislor's user avatar
  • 7,371
6 votes
Accepted

Event handling attempt using some of the c++ 17 features

I'm actually not the right person to properly review your code, since event handling is outside my particular experience, so the overall idea of even having this kind of observer-handler-emitter ...
einpoklum's user avatar
  • 2,005
6 votes
Accepted

Simple implementation of signals and slots mechanism using templates

[code] uint64_t It should be std::uint64_t, not uint64_t for key indexes (the latter is the C version). Or better: use ...
user673679's user avatar
  • 11.7k
6 votes

Angular directive to disable a button when clicked, allowing re-enabling as needed

One of the main ways in which you can improve this is by using Renderer2 in the directive instead of directly accessing this.el.nativeElement and making changes to ...
SiddAjmera's user avatar
6 votes
Accepted

Simple input class change with vanilla JS

Review The biggest critique about the Javascript I have is that collapsedInput could be declared with const because it doesn't ...
Sᴀᴍ Onᴇᴌᴀ's user avatar
6 votes

Process queued data in the background

Alternatives There are plenty of robust options for message queueing in C# that handle multithreading gracefully as well as scaling to truly massive sizes. The microsoft solution is MSMQ. There ...
justjoshin's user avatar
6 votes
Accepted

Wrap a js function with a fixed this arg

is there a better way to achieve this functionality? You can use Function.bind() to create a function with the this context ...
Sᴀᴍ Onᴇᴌᴀ's user avatar
6 votes

Animated Calendar using HTML + CSS + JS

Variables Always use a variable declaration when first declaring your variable. If you don't your variable will be put into the global scope, which is almost never what you want. It also makes it more ...
Joshua Hall's user avatar
6 votes
Accepted

Animated Calendar using HTML + CSS + JS

Welcome to Code Review. The CSS looks quite good. I haven’t seen too many style sheets with color lightsalmon 😃. Below are some suggestions. Cache DOM references ...
Sᴀᴍ Onᴇᴌᴀ's user avatar
6 votes

is this a good way of using events?

What you've done is conceptually wrong Events are there to allow other objects to be notified and react when something happens. That said, your solution works and does what you want, at least at a ...
mishan's user avatar
  • 161
6 votes

Follow up: A chat server using the select() API

Nice effort. This review only addresses 2 of the 10 questions. I hope OP gets a review of the other 8 questions too. Does any part of my code exhibit undefined behaviour? Calls to ...
chux - Reinstate Monica's user avatar
6 votes

Event System using C++

General Observations This code review request does not present any C++ source files (.cpp files). It appears that you are trying to write close code without the <...
pacmaninbw's user avatar
  • 23.8k
6 votes

CAT: Cat Approved TUIs

Unfortunately you've only shown some of the header files, but no concrete implementation of your TUI library, so I cannot meaningfully review that. However, we can look at your intended use of the TUI....
G. Sliepen's user avatar
  • 55.4k
5 votes
Accepted

Focus next element on keypress

The input elements are all siblings of each other, so you can use $.next() to select the next one that appears after the event target. There is no need to name ...
200_success's user avatar
5 votes
Accepted

Keyboard handler for selecting radio buttons

If you are sure it will always have a value just use the charAt value to build the id you try to select in each if block. Something like: ...
AtheistP3ace's user avatar
5 votes
Accepted

Simple event system

There is one big problem with your class: You can't have two different events with the same parameters in the functions. This is a real problem, as registering functions with no arguments is common in ...
Stud's user avatar
  • 786

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