Skip to main content
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,508
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
  • 81.7k
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
  • 61.7k
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
  • 8,344
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,035
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.9k
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's user avatar
  • 33.6k
6 votes

EventBus in C++

EventBus::get_instance().push_to_queue(std::move(event)); EventBus::get_instance().process_queue(); Those seem inconvenient for the caller to write. ...
J_H's user avatar
  • 34.8k
6 votes

EventBus in C++

std::forward_list Is there a specific reason you are re-implementing a linked list inside of your event bus? Why not use ...
Alex's user avatar
  • 265
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
  • 24.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
  • 61.7k
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
5 votes

Mask latitude text field

Unless you know for sure that the degrees, minutes, and seconds are always going to be 2 digits each, this approach will cause issues. I would recommend using 3 separate inputs for each value and ...
I wrestled a bear once.'s user avatar
5 votes
Accepted

Manipulating the browser history

An appropriate term for this code is spaghetti code – it's tightly intertwined with other parts of the app, so one cannot easily take out a part of it and reason about it without thinking about the ...
Rene Saarsoo's user avatar
  • 2,062
5 votes
Accepted

Simple event dispatcher

Design Is there a need for IEventDispatcher? Defining it as an abstract base class doesn't provide much utility if there's only ever going to be one derived class. ...
hoffmale's user avatar
  • 6,508
5 votes
Accepted

UpvoteJS, a simple voting widget in vanilla JavaScript

Foreword There is quite a bit of code here and it has taken a bit of time to process - especially the unit tests. I feel like the thoughts below will be incomplete but if I think of other ideas in ...
Sᴀᴍ Onᴇᴌᴀ's user avatar
5 votes
Accepted

Tic-Tac-Toe code in JavaScript

Note, some of these require a build process the iife should be added in the build process, it's distracting The code doesn't expose anything. It's untestable. var should be let or const You can use ...
Magnus Jeffs Tovslid's user avatar

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