7
votes
Accepted
Add Default Rubberduck VBA Folder Annotation to VBProject.VBComponents
HasFolder = InStr(.Lines(1, .CountOfLines), Chr(39) & "@Folder")
That condition can technically be True in ...
6
votes
Tick. Tick. *breathe* BOOM! - Setting up real, stable asynchronous callbacks with WinAPI Timers in VBA
First I'd like to say that this is impressive work, overall pretty squeaky clean... despite the adjustments needed to make it build on x64 :)
One enhancement I can see in terms of readability, would ...
6
votes
Accepted
Implementing a class hierarchy and instancing the base class in VBA
If Not DebugMode Then Resume CleanExit Else: Stop: Resume
Avoid using the : instruction separator in code. That's good for ...
5
votes
Accepted
OOP Dependency inversion principle VBA
An observation on your class constructors. At the moment you are using public properties to allow you to set the value of properties of a class after it has been created. You can take this to the ...
5
votes
Accepted
Fighting f̶i̶r̶e̶ regex with f̶i̶r̶e̶ regex
Ridiculously Large Bug
Okay this is a tiny bit embarrassing, but apparently I'm an idiot.
Remember when I said I recently had this in CS class? Well apparently I hadn't been paying attention. In the ...
5
votes
Accepted
Produce date range string from a database table
Regarding the points of interest you identified:
Using either one or two queries to get your data can be acceptable so long as it meets your performance criteria in actual use. However, I am going ...
5
votes
Rigorously checking whether 2 floating point numbers are close in VBA
I admire the fact that you took the time to research and implement the edge cases for NaN and +-Inf. I think most people would just write an On Error Resume Next ...
4
votes
Constructor-injecting a truckload of commands
After rethinking the problem, I got another idea. Because it is fundamentally different, I'll post it in a separate answer.
The commands are injected to the view model, exposed by properties and ...
4
votes
Enhancing autocompletion for VBA code
This review isn't definitely worth 200 extra points because I think in order to write a decent one, you have to pretty well understand how this code together with VBA works or even try to run it. I ...
4
votes
Prettifier isn't pretty
Not knowing anything about RubberDuck, I'm a little frightened by the necessity that the CodeString come from a particular ...
4
votes
Accepted
BattleShip Grid: Classes and Tests
Based on my first not too thorough read, this looks rather nice. I currently only have two points of critique.
The first point is the lack of explicit interfaces. I think both the ...
4
votes
Accepted
Managing Excel Tables (ListObjects) with OOP Approach (Follow up)
I find relying on Sheet.Activate / Sheet.Deactivate to set/unset the sheetTables reference ...
4
votes
Accepted
Managing Excel Tables (ListObjects) with OOP Approach
On the whole nice work! This is actually a problem I've looked at in the past, and as a result I'd like to review the approach you've taken and the API/ way users can interact with your code.
As I ...
4
votes
Accepted
Copy Columns Forward Macro: From Procedural to OOP
The OOP version of the code generated some thoughts around separation of concerns: user interactions and data processing.
Single Responsibility Principle(SRP):
Every module, class or function in a ...
4
votes
Secure ADODB: Unit of Work
I have been silently waiting for you to post this for a while. I was working on something nearly identical to this, and almost posted my stuff a couple of weeks ago, but I wasn't sure of how to hook ...
3
votes
Secure ADODB: Unit of Work
Comment on Transaction DDL. While Microsoft does state that its presence indicates that the backend supports transactions, there is another reference (possibly ...
3
votes
Accepted
Abstracting and unit testing lookups in Excel table
First off, nice work overall. It's apparent from the way you set up your interfaces and implementations that you "get it". Given that, most? of this can probably be classified as "nitpicking". I'm ...
3
votes
Prettifier isn't pretty
Because I don't think you will add some binary prettifier, I would rename ICodeStringPrettifier and CodeStringPrettifier to <...
3
votes
Accepted
Enhancing autocompletion for VBA code
Like t3chb0t, I am not familiar with VBA, but I will mention a few things that caught my eye:
1) Lack of documentation. To me it is surprising, that you went through the trouble of documenting a ...
3
votes
Constructor-injecting a truckload of commands
Ninject has a very nice extension called Ninject.Extensions.Factory. It allows you to create factories by specifying an interface. In your case, you could create a factory that creates the commands:
<...
2
votes
Accepted
Antlr Visitor with complex result
The way Antlr visitors and listeners work, there's little we can do to avoid redundant code - you've done quite a good job at keeping the redundancies minimal.
Essentially the logic is the same in ...
2
votes
Using build event to run Powershell script to run built DLL
After a few months of usage, I'm inclined to think that while this method does work and probably will be best investment for more common scenario where you want to set up an automated build process on ...
2
votes
Create a 2 way mapping to allow you to stringify enums or map one enum to another
There are lots of really good things going on here. Particularly your use of a private type to encapsulate internal fields, enums, declaration of variables close to ...
2
votes
Create a 2 way mapping to allow you to stringify enums or map one enum to another
In order to work through your own code, I ended up designing and implementing my own version of two-way mapping. Interestingly, the designs are fairly similar. My focus of this review is on the ...
2
votes
Accepted
Custom lexer/parser-based code prettifier
You are basically building a compiler. You have your tokenizer and parser available, but your target language generator is missing. Sure, hardcoding in html can be done for a small use case, but I ...
2
votes
Accepted
1
vote
Secure ADODB: Unit of Work
I have noticed this interface IDbConnection_CreateCommand, which appears to be an unnecessary coupling between DbCommandBase and ...
1
vote
Abstracting and unit testing lookups in Excel table
@comintern, I've implemented most of the rest of your suggestions. Much more readable! Details and revised code below.
Refactored to Base 0 (including the hardcoded twoDArr in ...
1
vote
Constructor-injecting a truckload of commands
After reading all discussions/answers here I come to this solution. To be clear I just adopted @JanDotNet 's solution for ViewModel. So let's start.
First, we don't want to have huge amount of ...
1
vote
Constructor-injecting a truckload of commands
I would typically create a manager for this. Make a class that contains all the properties for each command. Not a factory because we will still allow the DI container to create the commands we ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
rubberduck × 100c# × 74
vba × 25
meta-programming × 13
excel × 12
object-oriented × 11
com × 10
antlr × 10
unit-testing × 9
parsing × 7
wpf × 7
xaml × 7
winforms × 6
dependency-injection × 5
.net × 4
mvvm × 4
ninject × 4
regex × 3
reflection × 3
user-interface × 3
i18n × 3
java × 2
performance × 2
strings × 2
design-patterns × 2