« first day (1923 days earlier)      last day (1257 days later) » 
00:00 - 18:0018:00 - 00:00

12:00 AM
RELOAD!
[rubberduck-vba/Rubberduck] 9 issue comments.
[Minesweeper] Games Played: 99, Bombs Used: 44, Moves Performed: 11692, New Users: 12
 
Where be the option to mark VBE as your coding environment? Microsoft has no love for VBA anymore...
 
@IvenBach I don't follow sorry
 
12:49 AM
Developer survey I filled out after upgrading VS.
 
@this I'm second-guessing that now
 
1:07 AM
for assignment not used, won’t it be considering the references, rather than declartion?
 
yeah, ...that doesn't necessarily mean the node itself needs a ref to an object that already has a ref to it
it's the part that creates the node that needs to know about identifier refs and declarations
then an IAssignmentNode can have an AddReference(IReferenceNode node) method - and thus we have IParseTree / ParserRuleContext nodes referencing other parse tree nodes
...does that move the problem into the parse trees?
well "creates the nodes" - the parser creates these nodes, we're just injecting some metadata :)
 
2:12 AM
@MathieuGuindon that is actually beyond my powers
 
 
1 hour later…
3:54 AM
having severe VS perf issues here, not sure wth is going on
 
[rubberduck-vba/Rubberduck] build for commit fef0bc1b on unknown branch: AppVeyor was unable to build non-mergeable pull request
BUILD FAILURE!
 
@Duga yeah, didn't expect it to build either
 
@Duga so at this point the interesting parse tree nodes implement the CPA node interfaces, and most of the Rubberduck.Inspections.CodePathAnalysis namespace needs to die or be adjusted
 
[rubberduck-vba/Rubberduck] build for commit cd9e08a0 on unknown branch: AppVeyor build failed
BUILD FAILURE!
 
4:04 AM
@Duga thank you R#
 
^^ tests will fail
 
[rubberduck-vba/Rubberduck] build for commit 3446e773 on unknown branch: AppVeyor build failed
BUILD FAILURE!
 
ok that should build
hey @ZevSpitz
#bedtime
</mug>
 
@MathieuGuindon Depends on the part of the world. #wakeupandsmellthecoffee
 
[rubberduck-vba/Rubberduck] build for commit 425bb6ec on unknown branch: AppVeyor build failed
BUILD FAILURE!
 
@Duga ugh. tomorrow problem.
@ZevSpitz =)
 
 
1 hour later…
5:50 AM
@ZevSpitz Where do you hail from? European time zones?
@IvenBach You derped it up by opening your mouth before searching. His profile says it already.
 
6:12 AM
@IvenBach Close -- Israel. But I keep odder hours than I should.
 
6:38 AM
Sleep time for me.</iven>
Mug. Ping me tomorrow as a reminder to bring my hilbilly video recording hat. Picked up a new sd card. Old 2GB = ~5mins. New one is >5hr video. That should get you a fill for your unicycling craving.
 
 
6 hours later…
12:32 PM
In your '@IgnoreModule annotation you have a semicolon to add some additional info; is this something you can actually do with RubberDuck? I've not been having much success... — Greedo 44 mins ago
Not sure what "success" means here..
 
sounds like he thinks that the semicolon has some special meaning
 
@Greedo I haven't had any issues doing that, but the grammar rules around annotations have changed recently, did it break (try with a colon)? What does "not having much success" means? Is the annotation getting flagged as illegal or malformed? Please open an issue on the repo with the info - parsing annotations is challenging, because the arguments list needs to parse as such (same rules as a procedure call), but the rest of the comment needs to parse as a comment. — Mathieu Guindon 17 secs ago
Note to self: update office ducky
 
Interesting, works with a colon, not a semi-colon (not much success = the annotation is being ignored, as if it were an ordinary comment, no illegal annotation inspection, but also no @Ignoring of inspections either). Only posted here because I didn't know what the intended behaviour was — Greedo 9 mins ago
that does make sense
 
2:47 PM
We really cannot mark it as an illegal annotation because it is not an annotation in the first place.
 
right
I'll review my posts and replace ; with :, to avoid this confusion
 
I'm wondering if we need to be less permissive with the syntax
e.g. always require it be '@Annotation(parameters)
and not accept '@Annotation parameters. That would be a breaking change but maybe a good one?
@Duga Had a thought now - for the purpose of analyzing the execution path, it should be reasonable to presume that Resume / Resume Next is equivalent to GoTo ErrorLabel; it'll be executing some statements within that "block"; we just don't know which one of them.
 
3:21 PM
@this the way I see it, CPA traversal needs to "run" (big huge neon quotes here) the "happy path" (ignoring OnErrorGoTo jumps), then traverse the tree again but this time following the error paths (each On Error GoTo {Label} instruction makes a separate error path / traversal) - then CPA can know if/when an On Error (except GoTo 0 or -1, perhaps) statement is encountered in any error path, or when a Resume {whatever} statement is encountered in a "happy path"
 
Yeah. Don't forget about misusing GoTo in the unhappy path, too.
Though, On Error GoTo 0/-1 is OK in the error path, no?
 
yeah
(and should accordingly flip some switch in the execution context)
 
hmm i'm second guessing myself now -
in an error state, it's nonsensical to do a On Error GoTo AnotherHandler
 
correct
 
it's legal but it just won't work the way one thinks it should.
 
3:25 PM
any RTE in an error state will halt execution, so yeah
 
But does On Error GoTo 0 clear the error state?
 
hm, needs testing
 
Or would one need to first Resume <whatever> then On Error GoTo 0 back in the happy path.
 
unit testing the execution context will be #FUN
 
Yeah, that part is confusing AF
^^
 
3:28 PM
OEG0 clears the error#, but not the error state - meaning, a subsequent Resume jumps back to the error-causing line as if OEG0 wasn't there at all
 
#FUNx2
so yes, we want to catch the misue of OEG0/OEG-1 in an error state, too.
 
definitely
 
Resume <whatever> or Exit <whatever> should be only legal way to exit the error state, I think.
 
Public Sub Test()
    On Error GoTo ErrHandler
    Err.Raise 5
    Exit Sub
ErrHandler:
    'On Error GoTo 0
    Stop
    Resume
End Sub
 
Though I personally dislike the idea of using Exit <whatever> from an error state. Too messy.
 
3:30 PM
^ with OEG0, Err.Raise 5 halts execution after Resume
without OEG0, the previous On Error GoTo ErrHandler remains in effect
Public Sub Test()
    On Error GoTo ErrHandler
FailHere:
    Err.Raise 5
    Exit Sub
ErrHandler:
    'On Error GoTo 0
    Stop
    GoTo FailHere
End Sub
^ ...and without Resume, the 2nd Err.Raise will halt execution (because context is still in an error state)
 
yep. #SoManyWaysToGoWrong
 
I dread implementing GoSub...Return though
 
I kind of thought that BASIC did not allow stacking GoSub...Return.
 
I honestly can't remember if in the original BASIC you could have GOSUB that does another GOSUB and the RETURN would correctly track which GOSUB it's returning to.
In VBA, it does stack.
 
3:36 PM
as long as you don't cross the streams, you're free to spaghettify as much as you want :)
 
well, obviously..... :-|
 
@this hm, pretty sure it did stack
finds a QBasic emulator
otoh, I can see BASIC blowing up after it encounters a GoSub rather than a Return after making a GoSub jump
 
just one more consideration for the happy/unhappy path:
On Error GoTo Fail
Set db = CurrentDb
db.BeginTrans
On Error GoTo TransFail
db.Execute "...", dbFailOnError
db.Execute "...", dbFailOnError
db.CommitTrans
On Error GoTo Fail
Set db = Nothing

ExitHere:

Exit Sub

TransFail:
db.Rollback
Fail:
Msgbox "derp"
Resume ExitHere
IOW, error handlers can "fail through"
 
there has been unfortunately few times where I got a error message "0: " with my VBA routines....
 
3:41 PM
> CPA90042: Normal execution path is falling through into an error execution path
 
^
that'd be awesome!
 
@Duga Just so I'm not missing something - what's stopping you from creating a JumpImpl that extends the ExecutionImpl and provides the IJumpNode interface implementation?
 
nothing - but at the end of the day what we want is GoToStmtContext : IJumpNode
 
Yes, and that won't change.
the only difference is whether we provide the implementation directly in the context itself or delegate the implementation to a backing field.
 
so what's the gain in moving the implementations to another class, if the node itself still needs to have the members?
 
mainly that you get a bit easier refactoring since you only have code defined once.
 
4:14 PM
extensions are dead-simple interfaces with dead-simple implementations
 
yeah.
 
e.g. expose a get+set property
public bool Thing { get; set; }
vs
public bool Thing { get => _thing.Thing; set => _thing.Thing = value; }
it's simpler without delegation
 
Yeah. That is also an extra layer
I guess the delegation would only shine if you had additional work besides dumb assignments
 
so, that's one place we gotta just bite the bullet and take the duplication
@this yeah
but we don't want the nodes to do any hard work ;-)
 
Yeah. My thinking was that if it becomes complex, we would have to only do it once in one place but I guess you can stick a YAGNI at it.
LOL, yeah
 
4:17 PM
alternatively, we could tweak the parser and make nodes derive from more customized classes inherited from ParserRuleContext
but that's quite possibly #Overkill
 
not sure I follow how that'd work. aren't the contexts code-gen'd?
that means going into Sam's work and... do something.
 
yeah. I'm talking tweaking the code-gen-er
 
OK, yeah. #Overkill
 
^
otoh, if we're going to fork Sam's work and change how Antlr generates parse trees, we might as well try to turn parse trees into something closer to Roslyn's red/green trees.... not gonna happen though
anyway - now that I have the node extensions, I'm going to start thinking about what we need to have in IExecutionContext
the unified expression evaluation engine should be able to work off IEvaluatableExpression, right?
 
do we need different contexts for different things?
Yes
for example, we talked about happy/error path. That's one thing.
 
4:24 PM
yeah
 
then we have the assignment usage. That's another thing... ?
 
that too
something that points to the "current" executable node
a stack of GoSubStmtContext
 
so if that's different, then that implies we need multiple execution context, which we can then select for a given inspection.... right?
so AssignmentNotUsedInspection would ask for AssignmentExecutionContext and UnreachableCodeInspection would ask for ReachabilityExecutionContext ?
 
Or is that overcomplicating? Feels like it.
 
4:28 PM
tbh the line between "code path" and "execution context" is still very blurry
 
I also just realized - we really really really want to traverse the tree once
so it's probably best to collect all the data at every node we traverse
 
I think we should KISS and go with monolithic execution context that knows everything
 
CPA will traverse the [module] trees once, but that traversal will likely involve multiple passes
 
because honestly I don't know what/how many contexts we need and keep track of
 
4:31 PM
tbh the interface isn't really needed - I made it because I figured maybe we didn't want to have the CPA implementation under RD.Parsing (do we?)
it's kind of just a placeholder atm
 
The idea was to avoid have to pass through the parse tree again to find the nodes.
CPA could be considered a branch of parsing IMO
after all, it should be independent of any code analysis/inspection we do.
 
totally. I'm thinking the inspection's job would be to just grab the execution paths and inspect their respective context
 
^
 
so, I think we'll need some IExecutionPath after all
public interface IExecutionPath
{
    IExecutionContext Context { get; }
}
^ could be this, to begin
 
how is path different from context?
 
4:35 PM
context knows about declarations, tracks assignment usages, error state, etc; a path would be spawned e.g. when reaching an IBranchNode
 
hmm I see where you're going with this now.
to confirm, so we would need ProcedurePath, ErrorPath, BranchPath, LoopPath classes?
 
probably, yeah
 
which would give us all the nodes & other paths it'll visit in the path?
 
although I'd probably start with just one ExecutionPath class and see whether/how it needs to be refactored
 
hmm. but then what is a difference between a node & a path?
path is basically IOrderedEnumerable<INode>
 
4:38 PM
@this see that is exactly why I haven't added an IExecutionPath interface yet... I keep going back & forth between "I need it" and "wait a BranchNode would do that"
BrainFuck was easier to execute lol
 
I think what we really want to do is make IExecutionPath basically a enumerable set of nodes.
so that it's easy for you to represent either a single node or a set of nodes in an uniform manner.
 
makes sense
 
(a single node would be just a single-element list)
that also avoids you having to convert between one type and another.
because at the end of day, you just want a set of nodes to tell you where you are going
(right?)
 
oh, here's why we need it! take GoSub for example: it jumps to a label, but nothing in the parse tree says "your path is this whole entire block here"
 
Right, so you need to get a list of nodes
that will be visited up to the Return
 
4:41 PM
exactly
 
so if we treat path as basically an enumerable of nodes, that solves the problem, right?
 
I think I'll still want an interface to abstract it though
 
and if for some twisted reason, the GoSub's jump points to a block that has another GoSub, that node itself would be an enumerable set of nodes, too.
 
if it turns out I don't need any "path-specific" metadata, then the interface can be removed
 
so you can easily flatten the path if you want.
Yeah
 
4:48 PM
@this Aren't the code-generated classes all marked as partial? New functionality could be added to the same class. (I'm stepping in the middle of the discussion here.)
 
Yes, that is correct and that is what Mat's leveraging ATM.
 
@ZevSpitz yup, that's exactly what's going on here - thing is, the partial classes already have a base class, to we can add state and implement interfaces, but stuffing common code in a base class isn't possible
 
We're simply discussing whether to cut down the code duplication by using a backing field to unify the implementation details
^^
Hence why we talked about delegation, rather than fixing the base.
 
36 mins ago, by Mathieu Guindon
public bool Thing { get => _thing.Thing; set => _thing.Thing = value; }
but it's not really helping cut any code, since we want the nodes themselves to implement interfaces =)
(interfaces help simplifying tree traversals)
 
IIdentifierContext and IAnnotatedContext?
 
4:55 PM
Yeah
 
VBAParser inherits from VBABaseParser which then inherits from Parser. How is that controlled? Maybe something similar for the individual contexts?
 
in those cases, those classes are code-gen'd
 
Antlr controls that
 
however, they are code-gen'd as partial, enabling us to decorate further those classes. But because they already derive from ParserRuleContext, we can't inherit any other types.
 
VBABaseParser is code-generated?
 
4:58 PM
That's why we can add the interface & extra code, because of the partial.
Yes, I think so.
 
off the grammar, yeah
@ZevSpitz plus all the new/upcoming CPA interfaces
 
Hmm. Sam should be annotating those wiht code-gen something
 
Would default interface implementations reduce the code duplication?
What are the plans re C# 8?
 
maybe... damn did you just single-handedly find a legit use-case for this blasphemy of a language feature?! :D
 
I kind of doubt it. There's no implementation for us to delegate it.
Default interface implementation is basically just delegation.
No specific plans RE C# 8. Hosch may disagree. :-p
@MathieuGuindon this comment is curious: docs.microsoft.com/en-us/dotnet/api/…
 
C# 7 is good enough for me.
7.3, that is.
 
> **Rubberduck version information**

Version 2.4.1.4930
OS: Microsoft Windows NT 10.0.15063.0, x64
Host Product: Microsoft Office 2016 x64
Host Version: 16.0.4873.1000
Host Executable: MSACCESS.EXE

**Description**
1) `OK` button is not defaulted.
2) `<Tab>` key moves _into_ the `Preview` box but not out of it
3) `<Down Arrow>` will move the cursor below the visible section of `Preview` box leaving no obvious indication of where you are.
4) There is a preview of
 
Although...
I really like the range operator.
 
AFAIK we can just upgrade to 8 without losing any more supported platforms
 
@Hosch250 who are you and what have you done w/ Hosch?!?
:D
 
5:04 PM
@this I got a job and I'm tired.
4
 
Non-null reference types might be interesting but that's a big refactor project, too.
 
But, more seriously, RD couldn't use the major feature of non-null types yet.
 
@Hosch250 Right - congratulations BTW!
 
The rest of it isn't quite worth the updates.
 
^
 
5:05 PM
I really love the range operator, but that needs Core anyway.
Which prevents me from using it on most projects I work on.
 
Why? Consider the implementation for IIdentifierContext. AFAICT they look like this:
public Interval IdentifierTokens
{
get
{
Interval tokenInterval;
Identifier.GetName(this, out tokenInterval);
return tokenInterval;
}
}
This implementation could be put into the IIdentifierContext interface and not repeated over and over again in the partial extensions.
@Vogel612 Doesn't C# 8 require Core 3?
 
@ZevSpitz No.
 
@ZevSpitz framework 4.7 also works, IIRC
 
anyway for IExecutableNode, delegation isn't going to work... each implementing node will need to do something with the IExecutionContext - at this point the context has no members so all Execute(IExecutionContext) does is track whether the node was executed on a per-context basis
 
But not all the features are supported in the framework out of Core 3.
 
5:07 PM
even then, Core3 would be doable for us
 
Oh, I see. I though default interface implemetnation could be only like public foo DoFoo2() => DoFoo();, referencing an existing member on the interface.
 
because COM registration for Core seems to work just fine
 
And they didn't create NuGet packages to suport them, like the did with ValueTuple.
 
@Vogel612 Need to be tested, though.
 
@ZevSpitz, just a hint if you paste code w/CRLF in it, you can hit the fixed font button that appears over there (next to upload) ---> to cause the spacing to be right.
 
5:09 PM
if it doesn't we know which people to bug :)
 
Indeed. :)
 
but e.g. SetStmtContext.Execute will need to eventually invoke context.AssignVariable(this); ForNextStmtContext.Execute will need to eventually invoke context.EnterForLoop(this), etc.
 
@Vogel612 Who?
I think there's a chat on Gitter.
 
the two people that were tagged in the issue that @this linked a few days ago
 
Or you could create an issue on GH.
Oh, nice :)
 
5:19 PM
@MathieuGuindon related: our inspections so should have IDs like that (vs style...)
 
they could!
 
@this You might be right. I haven't been able to confirm that they could be used this way.
 
My understanding was that it can only refer to other members within the same interface, since it's meant to support extending of an interface without breaking clients that shipped with previous interface.
but I could be mistaken. I'd be very surprised if it let you does that, though.
 
@this aka built-in support for taking OCP and ISP to a dark alley for a beating ;-)
 
Indeed. I think it's really a horrid feature.
 
5:24 PM
FWIW, I find those two principles over-rated.
Particularly OCP.
ISP is good, but smaller systems can get away without it.
 
sure. but if you follow the rest of SOLID, OCP just "falls into place"
 
Yeah.
It's all about tradeoffs.
If you have two unrelated components that have the same "Create" structure, you don't need to abstract a Create interface for it.
Just use the same one as a sort of similarity/convention thing.
If you have 10 or more and only want to expose the Create functionality to the callers, sure.
I'm just a bit grumpy because I've seen too many people think they are doing it right by created useless interfaces.
Then the implementations are all newing up dependencies and are impossible to test.
And uses are like IFoo foo = new Foo().
And every method, including ones that should be private, are exposed on the interface.
 
would be nice if an interface could say Thing { get; internal set; } though
 
Generally speaking (because #ItDepends) a class method should ensure that all the class properties that it needs to function have been set prior to attempting to take action, right?
 
@MathieuGuindon wasn't that one of C# 8's features?
 
5:29 PM
@FreeMan that's why factory methods are awesome
 
That could simply be checking another property that's set True when everything is set
@MathieuGuindon yeah, but... (doncha love that?) I don't have a set of sane defaults for the class constructor.
 
@this I think so - but I'm not seeing use cases for the rest of the "default implementation" stuff
 
@MathieuGuindon Backward compatibility.
 
@FreeMan then don't have defaults
 
Basically, if you are a NuGet package, you might want to add a new method to your interface without breaking all your users.
 
5:30 PM
@MathieuGuindon oh... set thing = thing.factory(a, b, c) right?
 
So you can add a new method with a default implementation.
Whether that's just calling a different method on the interface with default parameters or throwing an exception.
And your users don't have to implement that method when they update the package.
 
@FreeMan yep! Keep in mind the VBA compiler won't prevent you from Set thing = New Thing : thing.DoSomething() 'Errors because the a and b weren't set....
 
@this yeah, I was just thinking that...
 
to help enforce that, you need to make sure it's Dim thing As IThing : Set thing = thing.Factory(a, b, c): thing.DoSomething()
 
which, essentially means that I need to have thing.doSomething check if its parameters are set
@this which means an interface and implementation simply to enforce using the factory?
 
5:34 PM
well, more of to keep the factory method hidden on the interface
e.g. the IThing wouldn't have Factory method. That would exist only on the Thing class.
 
mkay
 
and pretty soonish (if not already?), RD will give you error-level inspections if you misuse an interface
 
in Coding Projects and Vue.js Heaven :), 5 hours ago, by Phrancis
I need this coffee to hurry up ._.
 
@Hosch250 Sounds like they tried to do it IoC way without using IoC.
 
Just FYI: the CE refreshes really fast on parse now. Resolving References still takes a bit, but even the code inspections seem to run fairly fast. Congrats on all the hard work!!
^nothing empirical, it just feels quicker than it used to, and that's really the most important thing.
 
5:40 PM
Yeah, and one of the guys now works at MS.
 
Can I search the RD blog? Looking for Mat's Factories post instead of asking 10 bazillion questions here
 
2nd & 3rd hits for "vba factory method"
(1st being SO)
 
And... I'm thinking that if I put a '@Interface annotation at the top of a module, there aught to be some sort of inspection warning me that I've got executable code in my function headers. That shouldn't be legal, should it?
 
also - lovely that Google puts the RD News article in a "featured snippet"
 
@MathieuGuindon on GoOgle, maybe, but not DDG. Interesting... No RD posts at all show on the first page at DDG
 
I think Google knows Mat uses it more than the general web :)
 
It's 2019 TYVM.
 
^ y'all getting that?
 
@MathieuGuindon He just said DDG (Duck Duck Go).
 
5:51 PM
QUACK
I don't DDG
 
Google's creepy
 
Nah, SO was the first hit for Bing. Then hammondmason.wordpress.com/2015/07/09/…
 
Not coming up for me. You need to some more Mug.
 
You aren't on the first page.
 
^
 
5:52 PM
same here
 
lovely
 
using google, RD news is 1st and 2nd hit
 
Industry Disruptors take a while to get noticed, outside their industry that is.
 
but it might have been already biased ( I switched to DDG only few months ago. Google has way too much dirt on me.)
 
All that matters is we know who you are :p
 
5:54 PM
DDG has SO, HammondMason, SO. I've scrolled a Loooong way down and no RD! :(
 
Nope, I don't Google, and Mat's the first 2 hits for me. SO is the third.
 
I guess HammondMason is better at SEO than I am
 
gimme some more key words - I'll try to get DDG to think like a duck.
 
@MathieuGuindon ^
 
@MathieuGuindon Maybe around longer.
 
5:55 PM
well... I wrote that factory stuff over a year ago
 
I had another derp moment. Switched to bing for searching a while back.
 
I meant the site.
 
I've found that the site is weighted higher than the content.
It's also rated by activity. The more you post, the higher it gets rated.
 
Chop Chop! Get to posting.
 
5:57 PM
@FreeMan yes. and there's nothing wrong with that - this is COM, and COM loves interfaces... embrace them!
 
@MathieuGuindon just think - if it wasn't, Mocking VBA wouldn't be possible!
 
geez that took some effort!
 
@IvenBach is working on his October to-do list
 
5:58 PM
 
Looking forward to it.
 
@Duga pretty sure that means to say "Save", not "Safe"
 
Mug reminder: Don't carve your pumpkin a week before Halloween again.
 
lol thanks
 
@IvenBach Or put it in the freezer, LOL.
 
00:00 - 18:0018:00 - 00:00

« first day (1923 days earlier)      last day (1257 days later) »