« first day (2121 days earlier)      last day (1059 days later) » 

12:00 AM
RELOAD!
RELOAD!
[Zomis/minesweeper-server] 2 commits. 7 additions. 41 deletions
[Zomis/minesweeper-flags-client] 8 commits. 140 additions. 54 deletions
[rubberduck-vba/Rubberduck] 17 issue comments
[Zomis/Server2] 4 commits. 307 additions. 52 deletions
 
 
2 hours later…
 
1 hour later…
3:07 AM
Having learned git and using RD to export modules has been a life saver. Saved me from a #ShitstormO'Problems. Weathering it easily and getting none on me.
 
3:52 AM
when trying to debug something is it sufficient to only rebuild the project where edits are being made?
also im going to have to be honest i have absolutely zero idea how to do the unit testing part of the inspection
 
4:22 AM
i do not understand unit testing beyond the conceptual level and never used it in vba
 
 
1 hour later…
5:37 AM
> # [Codecov](https://codecov.io/gh/rubberduck-vba/Rubberduck/pull/5445?src=pr&el=h1) Report
> Merging [#5445](https://codecov.io/gh/rubberduck-vba/Rubberduck/pull/5445?src=pr&el=desc) into [next](https://codecov.io/gh/rubberduck-vba/Rubberduck/commit/e56bb88f4eab28c1fbeb5146403ba9da37a52d39?src=pr&el=desc) will **decrease** coverage by `0.02%`.
> The diff coverage is `21.74%`.


```diff
@@ Coverage Diff @@
## next #5445 +/- ##
=======================
[rubberduck-vba/Rubberduck] build for commit 4cd16d51 on unknown branch: 21.74% of diff hit (target 60%)
> This built and tested correctly for the case of property get/let overlaps. Changes to ImplementedInterfaceMemberInspection were made based on feedback for obvious reasons and tested correctly as well. The unit testing component is still not there; like I said I don't really understand it, but I'll add it when I can ask the right questions to correct that.
 
5:53 AM
I also still don't get git very well - the mess with closing the PR was because I tried to get rid of the annoying commit that was simply updating to rd by force pushing the current RD-next onto my remote patch-3 before pushing the code I currently have into that
 
[rubberduck-vba/Rubberduck] build for commit bc2561f0 on unknown branch: AppVeyor build succeeded
> # [Codecov](https://codecov.io/gh/rubberduck-vba/Rubberduck/pull/5445?src=pr&el=h1) Report
> Merging [#5445](https://codecov.io/gh/rubberduck-vba/Rubberduck/pull/5445?src=pr&el=desc) into [next](https://codecov.io/gh/rubberduck-vba/Rubberduck/commit/e56bb88f4eab28c1fbeb5146403ba9da37a52d39?src=pr&el=desc) will **decrease** coverage by `0.02%`.
> The diff coverage is `50%`.


```diff
@@ Coverage Diff @@
## next #5445 +/- ##
==========================
[rubberduck-vba/Rubberduck] build for commit bc2561f0 on unknown branch: 61.47% (target 0%)
[rubberduck-vba/Rubberduck] build for commit bc2561f0 on unknown branch: 50% of diff hit (within 10% threshold of 60%)
 
6:11 AM
[rubberduck-vba/Rubberduck] build for commit bc2561f0 on unknown branch: 61.09% (target 0.00%)
> # [Codecov](https://codecov.io/gh/rubberduck-vba/Rubberduck/pull/5445?src=pr&el=h1) Report
> Merging [#5445](https://codecov.io/gh/rubberduck-vba/Rubberduck/pull/5445?src=pr&el=desc) into [next](https://codecov.io/gh/rubberduck-vba/Rubberduck/commit/e56bb88f4eab28c1fbeb5146403ba9da37a52d39&el=desc) will **decrease** coverage by `0.40%`.
> The diff coverage is `47.22%`.


```diff
@@ Coverage Diff @@
## next #5445 +/- ##
==============================
 
6:26 AM
> Could the COM part be simplified by just having an AddAnnotationCommandMenuItem that brings up dialog for adding set of available annotations instead of using a pop-up submenu? That way only need to assess enable state/toggle visiblity for one item.
 
7:00 AM
 
7:51 AM
@theVBE-it'srightforme I'll explain a bit about unit testing once I find some time today.
 
> That was my idea as well. However, in that case, the UI will be entirely different, which is the reason I would like to split the issue.
 
^ i went for the non sophisticated approach to removing the annoying meaningless commit
also has cleaner commit history anyways
what it is now represents what it should have been the first time I committed anything :3
@M.Doerner sounds good. I'll get on adding it to the inspection once I can understand what I am doing or at least what I'm copying from is doing.
 
> Is a popup submenu better than a dialog box?
[rubberduck-vba/Rubberduck] build for commit a3197414 on unknown branch: AppVeyor build succeeded
> # [Codecov](https://codecov.io/gh/rubberduck-vba/Rubberduck/pull/5445?src=pr&el=h1) Report
> Merging [#5445](https://codecov.io/gh/rubberduck-vba/Rubberduck/pull/5445?src=pr&el=desc) into [next](https://codecov.io/gh/rubberduck-vba/Rubberduck/commit/e56bb88f4eab28c1fbeb5146403ba9da37a52d39?src=pr&el=desc) will **decrease** coverage by `0.01%`.
> The diff coverage is `50%`.


```diff
@@ Coverage Diff @@
## next #5445 +/- ##
==========================
[rubberduck-vba/Rubberduck] build for commit a3197414 on unknown branch: 61.47% (target 0%)
 
 
1 hour later…
9:14 AM
> I just had the thought, should it generalize to any host application document object? If I understood it correctly at some level VBA doesn't distinguish between an Excel spreadsheet and whatever else any other host application wants VBA to treat as special citizens that can host code behind?
> Does the document object interface just have some attribute to indicate to the VBE whether or not it is allowed to rename them?
 
9:42 AM
> From reading [the RD blog post on this ](https://rubberduckvba.wordpress.com/2019/12/08/document-modules/) I thought the hosts object model was just on an interface with VBA/VBE itself:

>
They’re in the VBA project, because the host application decided that’s what’s in a VBA project hosted in – here Excel, but each host application gets to decide whether a project includes a module to represent the host document, and under what circumstances to add or remove other types of modules, like W
> From reading [the RD blog post on this ](https://rubberduckvba.wordpress.com/2019/12/08/document-modules/) I thought the hosts object model was just on an interface with VBA/VBE itself:

> They’re in the VBA project, because the host application decided that’s what’s in a VBA project hosted in – here Excel, but each host application gets to decide whether a project includes a module to represent the host document, and under what circumstances to add or remove other types of modules, like Wor
 
9:53 AM
@Duga @theVBE-it'srightforme yes, they are interfaces. However, the issue is that they aren't actually a part of the VBA language itself but rather comes from a library reference. The host will always have its library with its object model loaded, which means in an Excel VBA project, you'll be able to assume that Worksheet and Range (read: Excel.Worksheet) exists and just work. But copy'n'paste the same code to say, an Access VBA project, then it might no longer work.
It will work once the Access VBA project references Excel's library. Because Rubberduck is a VBIDE addin, the preferred solution is to rely on only the VBA/VBIDE capabilities as to remain host-agnostic.
In this particular inspection, it will be Excel specific because it requires a particular knowledge about the Excel's OM in order to perform the inspection. We might be able to do this from the type library API which bypass the need to go through the host's object model and would be more preferred than using host's object model directly.
 
 
1 hour later…
10:58 AM
So host supplies the library reference to VBA?
 
Yes.
If you open up the vba project's references, you'll always see 2 references
that'll be the VBA library and the host library
 
If you try to move or uncheck, you'll get an error about it being required.
 
"Can't remove control or reference; in use."
I mean what is using it?
VBE right?
 
the VBA project, too. After al, you have document modules that are a part of the host's object model
It would be silly to have a VBA project that contains a Excel Worksheet document module and not have a reference to the Excel object library that describes what a Worksheet is.
 
11:01 AM
Do the document modules in the host application implement any interface that tells VBA in a general sense what they are?
 
Nope.
 
wut <- is confused
 
We can tell that so and so is an Excel.Worksheet or Excel.Workbook or Access.Form or Access.Report because we do know that it is so. However, it's always the host that creates or modifies the host document module
For example, you cannot create a Excel.Worksheet document module yourself; you have to go through Excel for that.
 
so VBA does not have any ownership over the existence of a document module
 
Exactly.
All VBIDE care about is the code-behind, but the other stuff about the document module, it knows nothing.
 
11:03 AM
but doesn't the host application have to configure a document module in a certain way to tell vba that it is a document module
oh wait
 
sure, it does. It tell VBIDE "hey, this is a Worksheet class."
 
how does it tell VBIDE that Worksheet is a document module
 
I don't think it actually says "document module"; only that it provides the GUID for the interface and for the events, and how to call it. Would have to look at the SDK for more information.
 
Yeah that is where I'm confused I guess just based on what I quoted in the RD blog post.
It just makes it sound like an interface based on everything I've been told about interfaces.
 
It is.
what I'm saying is that there's no IDocumentModule interface or something like that. It's simply just Excel.Worksheet or Access.Form interfaces. That is all the VBA get to know about those. Reading the blog, I guess the answer is that it also know it's a document simply because it has VBComponent.Type set to vbext_ct_Document
 
11:18 AM
I think that summarizes VBA as a language in a nutshell.
 
maybe that will clarify:
 
Public Sub x()
    Dim x As Form_frmAbout
    Dim y As VBIDE.VBComponent

    Set y = Application.VBE.ActiveVBProject.VBComponents("Form_frmAbout")
    Set x = y 'Type mismatch
End Sub
 
That code show that you cannot cast to a document module's class (Form_frmAbout, which is an Access.Form) from a VBComponent
 
11:19 AM
yes I know
I mean, I feel like you have taught me very well.
 
The fact that it can't means that VBIDE's API tells us nothing about what Form_frmAbout is beyond that it's just a document module.
 
^ seeing it actually true was mind blowing
 
Thus why we have to go beyond just VBIDE API if we want to know more.
 
Again, one of those moments where you realize you don't get things as well as you thought you did.
Which I've noticed tend to be fairly common in this endeavor.
anyways
 
As I said before, underneath it all, it's just ones and zeroes. We're living atop a mountains of lies and obfuscations and thus why law of leaky abstraction is a one to remember.
 
11:26 AM
Yes that is an example of why I say you taught me well.
That comment did quite a bit to help me understand things conceptually.
law of leaky abstraction itself feels like a different level of understanding however
 
when you're starting at the top of the mountain of lies, it is hard to see.
The graybeards had it easy back in 80s. They went from hardware to software and then it was just a bit more abstraction.
Now we've probably several of levels high from the hardware.
 
They had it easy in that way but it was also a lot more tedious in other ways no?
I mean, think about how C++ is regarded compared to popular higher level languages now.
but yeah I understand exactly what you are saying conceptually
 
Yep
 
its very interesting
 
and that's why we get to do something awesome with VBA and C# without knowing too much about the internals.
 
11:31 AM
yes exactly
 
but when you start doing metaprogramming, like with RD, then those ugly details start to matter a lot.
 
that is because meta programming is going down a level
(?)
in a certain way at least
i would be lying if i said i fully understood what RD actually does with VBA
 
yeah
 
its so interesting
not something I'm capable of comprehending fully right now I don't think :/
 
Keep at it. You'll grok it.
I know that I didn't just bang-bing-ding it all in one day. Took me a while.
Heck, I still am learning!
 
11:36 AM
I feel like it can't not be that way unless you are a true savant because it is so <bad language> complicated.
So much thinking in a way that is not properly taught as well.
That is why this chat as a resource is so useful of course.
hard to express how much I appreciate it
 
just pay it forward. :)
 
that is why I am working on RD things that I feel would have been helpful for me when I was using it to learn VBA
hopefully they've almost gotten to the point they can be considered usable
 
Yes, you just need to have a good unit test coverage. That's important.
since it will definitely prove that it works the way it should
 
that is what is in the {InspectionName}Test.cs class?
like i said earlier i completely don't get what it needs to do with unit tests
i get what a unit test is but not how it relates to an inspection
 
since you worked on the interface, this might be a good comparison to use:
The whole purpose of the unit test is that you basically set up a code that contains some code, then run inspection then you need to check that your inspection either returns result or not depending on the expected outcome.
 
11:46 AM
oh wait you mean this is unit testing for the inspection
not related to the unit testing RD allows one to do on VBA code?
 
One unit test would be to prove that your inspection does not yield a result for 9 members but will yield a result for 10 members. Thus, the input code would have the interface definition adjust accordingly.
Yes, exactly.
If you don't know, Rubberduck has >7500 unit tests.
 
oh that clarifies a lot
 
monking guys.
 
so all the things that I was saying in the GH comments about the tests it passed
that is what needs to be in this?
 
@FreeMan Where? Seeing no brown robes nor porridges around here....
 
11:48 AM
you have to listen for them.
:)
 
^ someone has played AoE recently :)
 
The build does much more than just running unit tests but yes.
it pass because you have yet to write the unit tests for the new inspection so it can't know that it's working.
 
got it
so every case that i made it pass in the VBE
to confirmed it worked
needs to be there
 
yes. The more unit tests you add, the better
 
that explains why i saw so much vba code
okay that is uh
i get it now
 
11:50 AM
@FreeMan You know, I'm not sure that monks might approve of the monkees' music.
 
i think i should probably try to get some sleep but should be able to fix this tomorrow
 
:+1:
 
and ill have feedback right away because the build will fail if
it doesnt pass them all?
 
Correct
BTW, you can run unit tests locally, too
 
I finally had a revelation yesterday. For a long time I've had a method in my code base that called a stored procedure. However, I'd imposed a limit on myself that the sproc could only have one out parameter and that it had to be the first parameter. I also passed all the parameter config bits in a gigantic paramArray that was just a mess.
I've known this was a Bad Thing™ from the start, but never had the time or desire to fix it.
 
11:52 AM
@FreeMan didn't you just summarize like 75%+ of problems in programming
@this okay that is good to know
 
Yesterday, I put together my own Parameter class and wrote a small routine to parse this class, build real ADODB parameters from it and pass it to the sproc, no matter how many out parms it may have and where in the list of parms they may be.
 
i now see i can test the inspection logic without having to rebuild the entire solution each time and start up excel
 
And, I figured out a loop to extract the parms from the outs and put them where they need to be.
 
Nice!
 
I still don't like the extract loop very much because it has to be repeated everywhere, and that doesn't feel very clean to me, but it's a huge improvement over what I had.
 
11:54 AM
why cant it be abstracted into a function?
 
@theVBE-it'srightforme Exactly! Hence why we have unit tests all over.
 
@this I see the value now!
 
In a large and complex codebase, the last thing we want is to ship a version that got broken just because we fiddled a dial over there.
 
I've been able to replace a series of 4 "concatenate a SQL query string in code & open and ADODB.RecordSet" calls with a single sproc call. So code should run a fair bit quicker, too.
@theVBE-it'srightforme 75%. 90%. something like that...
@theVBE-it'srightforme I'm sure it can be, but...
4 mins ago, by FreeMan
I've known this was a Bad Thing™ from the start, but never had the time or desire to fix it.
:)
 
lets just say that any sort of criticism would be slightly hypocritical :)
anyways i really should get sleep
congrats on that - any sort of big refactoring that succeeds is so encouraging imo
 
11:58 AM
I'm sure it'll come to me sooner rather than later, but I've got to get 1 or more parameters out of a generic class and into some other variables for longer term storage/use. However, the variables I'm storing them in can be different each time. So it's not just "get from x, put in y. It's "get from x, put in y or z or qwertz, or...
@theVBE-it'srightforme thanks! g'night!
BTW, @theVBE-it'srightforme, what part of the world you in that you're just now heading to bed?
@FreeMan to solve this problem, a design philosophy question ...
My sprocCaller function takes a collection of myParameterclass objects. Each myParameter knows if it's an out parm, and has a resultValue.
Once I've got a return from sprocCaller, I loop the collection, look at the Direction of each parm and if it's out, I put it into the appropriate variable. (the presumption is that the parameters are in the correct order - I don't allow "named parameters". i.e. parm 0 out had better be stored in x in every call or it'll break. #StillNotPerfect)
Since I pull from the myParameter collection and store the data in a class dedicated to storing that kind of data, would it make sense to pass the collection into a method on that storage class that extracts the myParameter data and puts it all in the right place
That's the only reasonable and sensible way I can come up with ATM to properly locate a function to "extract" the data from the parameters in a minimal code kinda way.
I like this approach. Very clean except... I've defined Const for some of the para... Oh... I think I see.
that's going to take another round of refactoring at some point.
ah! a reasonable compromise for now...
ooohhhhh.....
I've got these nifty classes that store data for me.
They need to also get the data to be stored to better encapsulate the process!
only took like 3 years for that revelation!
Class! Populate thyself!
:derp:
 
 
2 hours later…
2:14 PM
how do y'all recommend handling database updates? For example I may have new stored procs being developed or config table changes made in Dev, and I don't want to forget to make these changes when I migrate code to prod.
 
for small project, I keep a change script
for bigger project, it ought to be a part of build process
 
"build process" for a VBA project? Do tell...
:)
 
i assumed SQL Server
 
yeah, the data's on SQL Server, but still, it isn't really "built" (unless I have a complete misunderstanding of what you mean)
#NotTheFirstTime
 
i'm referring to the generation of SQL scripts that performs the schema changes.
you can use a build process to automate the updating of the database schema if you want.
 
2:22 PM
I have normally been writing SQL scripts to do the changes. The issue I run into is missing bits of it.
I usually make only a couple of changes per script, and sometimes I have a lot of changes to make.
For example, this project will require new tables, populating those tables from old data, new sprocs, and changing some config table settings (at least, for now)
I guess I'm on the right track, I just need to do a better job of keeping track of which scripts are associated with a project.
 
There are tools that automates tracking the differences and generating the synchronization scripts
If you don't want to spend, you can start with SSDT
 
2:37 PM
I just need to track my scripts better. I might actually need to keep notes! Gasp!
 
in my smaller project I just keep my change script open and add them one by one --- that's also the reason why I won't use designers. Otherwise it's impossible to be sure that it has the changes I wanted to do and did it the same way I did it.
 
2:52 PM
Sometimes my changes happen across weeks of development. I guess I can keep it all in one script and comment out earlier parts so that in dev only the most recent piece is executed. Remove the start comment/* and all rest will execute in prod.
I've gotten in the habit of ending block comments with --*/ that way it closes out a block comment, but I only need to comment/remove the opening /* to get the enclosed code to execute.
#EnableMyLazy!
 
i isually keep a change script per version and after executing, start a new one
 
^ yeah
 
opening a million line long script => not recommended. :)
 
can't hardly imagine...
OTOH, opening a 100KLOC VBA module1.bas containing Sub Macro1() and nothing else is highly expected (but still not recommended).
 
can't remember - isn't there supposed to be a 65K limit?
 
3:03 PM
work with me here...
hyperbole in action
 
Can't. My work is done, citizen. Captain Oblivious off!
 
lol! Enjoy your weekend!! (Do I hear some RD code calling your name?)
 
gonna get the v-meetings out of the way first....
 
Good golly! I just disabled a serious portion of the reporting we were doing (no longer going to do it, so just flip a bit in the config tables). But, working via VPN from home, the remaining data gathering is still really slow!
that includes replacing the 4 previous SQL queries with one sproc call...
must do some more performance tweaks or I'll go nuts!
 
 
1 hour later…
4:33 PM
We're winning the COVID-19 relay race. We got the most participants. HOO-AH! #MuricaIsGreat!
Public Sub FooBar()
    FooBarPart1
    FooBarPart2
    '...
    FooBarPartN
End Sub

Private Sub FooBarPart1()
    'Code stuff
End Sub
Private Sub FooBarPart2()
    'More stuff
End Sub
Private Sub FooBarPartN()
    'IrmaGourd STAHP
End Sub
@this ^ There is. That's when you gotta get #Creative.
Feels like there should be an inspection for that.
 
4:50 PM
Hmm, IDK. I don't think that's necessarily a bad thing
(unless you are literally calling them FooBarPartN)
but I've extracted section of stuff into a private method so that the public API is easier to grok at a higher level
@IvenBach pretty sure the American way is to giver everyone a participation medal.
 
@this :derp: #Mornings. Should have been Module1.FooBarPart1(), Module2.FooBarPart2(), ... ,ModuleN.FooBarPartN()
 
Ok, now that definitely smells.
I also assume the FooBarPartN aren't actually Private, either. Else be wee bit hard to call them up.
 
That's what I thought I was tying.
Yeah. They have to be Public
 
This code be chock-full of coronavirus, then.
 
5:43 PM
Pertinent to your comment about getting dressed even when WFH.
 
6:05 PM
Quick air-code example for my question:
Private Type myType
  a as long
  b as long
  c as long
End Type
Private this as myType

Public Property Get c() as Long
  c = this.a + this.b
End Property

Public Property Ratio() as Double
  Ratio = this.a / this.c
End Property
this doesn't work because this.c is never assigned a value, (real code has guard against div by 0)
How do I enforce/remind myself to never use this.c since it's never assigned anything?
or, how do I assign (automatically) this.c so it's got a value so I don't bork it up somehow?
Or, is this the case for unit tests to ensure I don't accidentally use this.c when I should be using c (and going through the Getter)?
 
@theVBE-it'srightforme I think @this already gave you the right idea about unit testing. To write tests for your inspection, it is easiest to look at some other inspection test class for orientation.
Note that most of the general logistics for inspection tests have been abstracted out into a base class.
 
6:23 PM
@FreeMan Not sure of the context... But it would seem best to remove c as a member of myType. If c is always a value derived from a and b - then c is a function/PropertyGet - not a field.
 
c had been a full-on field, but I just realized (yesterday) that there was no need for it to be, as it's a simple computation of a+b (yeah, one of those forest/trees things).
If it makes more sense to pull it from myType and convert Public Property Ratio() to Function Ratio() then I can simply do that.
and that would make this.c a compile time error.
If it makes more sense to pull it from myType and convert Public Property Get c() to Public Function c()...
 
Yes
 
thanks, @BZngr, that makes sense.
Brain's in a box. Has a hard time thinking outside it sometimes... :/
 
If c is a noun => property. If cis a process/action => function
 
From now on, I will use Private Type myNouns in all my classes as a reminder!
:)
 
6:29 PM
:)
 
now, I just need to figure out why my report is ever so lightly off from what I calculated by hand a couple of months ago... :/
 
Do any calculations every match after two months have passed? :)
 
well.... we like for them to...
we've got a new vendor doing our NPS reporting. They provide reports, but they're not what our people are used to, so of course, I have to keep producing the old style reports.
Others w/in our org started reporting the scores based on visit date with a reporting cutoff of the 10th day of the next month. i.e. If my visit is in Mar, I have until Apr 10 to do the survey, or I'm not counted in the official report.
Very different than our old way, so I have to make sure I'm getting the right surveys counted.
 
6:48 PM
The 'ol report Adapter pattern.
 
eh?
 
Adapting a new report's data to load/fit the old.
 
 
2 hours later…
8:49 PM
well, it's a start :-) now I just gotta, uhm, make it do all that :-)
 
9:06 PM
kind like building a house by starting with the facade first but without the foundation, the walls, the roof and the stuff that makes a house... a house? :-)
 
9:21 PM
Oh and wrap it in an AzurePipelines task. And sort out globbing. Oh, and signing... HHCIB?
Good job I have some spare time :-)
And oh, just for kicks, have it be able to bootstrap Core 3 executables too... That's actually kinda the roof, seems a long way off.
 
9:54 PM
 

« first day (2121 days earlier)      last day (1059 days later) »