« first day (1326 days earlier)      last day (1854 days later) » 

12:01 AM
RELOAD!
[rubberduck-vba/Rubberduck] 7 issue comments.
[Zomis/AdventOfCode] 2 commits. 1 addition. 1 deletion.
[Zomis/Prosit] 2 commits. 2 additions. 2 deletions.
 
apparently everything works
 
[retailcoder/Rubberduck] retailcoder pushed commit 4697e69f to next: closes #3712; fixes resolution of Function & Property Get return types
 
dammit, git
 
[retailcoder/Rubberduck] retailcoder pushed 14 commits to next (only showing some of them below)
[retailcoder/Rubberduck] BZngr pushed commit 0a892643 to next: Merge branch 'rubberduck-vba/next' into Refactor_PRCHelpr_To_PRCExt
[retailcoder/Rubberduck] BZngr pushed commit 3ce6d172 to next: Consolidated files - remove PRCHelper
[retailcoder/Rubberduck] BZngr pushed commit ab4f540e to next: Merge branch 'rubberduck-vba/next' into Refactor_PRCHelpr_To_PRCExt
[retailcoder/Rubberduck] BZngr pushed commit 0ab95b08 to next: Merge branch 'rubberduck-vba/next' into Refactor_PRCHelpr_To_PRCExt
[retailcoder/Rubberduck] BZngr pushed commit 02202757 to next: Fix resx merge
[retailcoder/Rubberduck] BZngr pushed commit 34a17f38 to next: Clean-up, improve test coverage - some renaming
[retailcoder/Rubberduck] BZngr pushed commit 189f1c95 to next: Cleaned-up some commented code
[retailcoder/Rubberduck] BZngr pushed commit 1af0bcd3 to next: Manually removed ghost file - RubberduckUI.resx
Merge pull request #3711 from BZngr/Refactor_PRCHelpr_To_PRCExt

Refactor ParserRuleContextHelper to ParserRuleContextExtensions
[retailcoder/Rubberduck] retailcoder pushed commit 03b7431b to next: merge with conflicts (kept local changes)
> This required a few tweaks to the resolver. Reviews welcome.
[rubberduck-vba/Rubberduck] build for commit 03b7431b on unknown branch: AppVeyor build failed
BUILD FAILURE!
 
@Duga of course
lol, I just did exactly like @AnnaVel - pulled remote changes, didn't build, made PR
 
12:18 AM
[retailcoder/Rubberduck] retailcoder pushed commit 433b9481 to next: replaced ParserRuleContextHelper with ParserRuleContextExtensions calls
> I pretty much rewrote the whole inspection. Arrays are ignored for now (we don't verify if array items are objects), and we're not really resolving the type of the RHS expression, so a complex expression that requires a Set keyword might be a false negative now.
> Just to be clear: this PR is moving all default settings values to the .settings file, correct?
 
12:34 AM
hmm, AV seems to be running about 1 test per second
but hey, tests are running!
Dang, 20 minutes and counting
 
[rubberduck-vba/Rubberduck] build for commit 433b9481 on unknown branch: AppVeyor build failed
BUILD FAILURE!
 
@Duga oh you gotta be kidding
I swear all I had was 25 yellows
huh here they come
3 reds
1846 to run
561 passed
$#!T
huh
            var code = @"
'note: Dim Foo() As Integer on this line would not compile in VBA
Public Sub DoSomething()
    Dim Foo() As Integer
    a = Foo(0) 'VBA raises index out of bounds error, i.e. VBA resolves to local Foo()
End Sub

Private Function Foo(ByVal bar As Integer)
    Foo = bar + 42
End Function";
but it would compile...
hmm, that's an interesting failing test
            var expectResultCount = 1;
            var input =
                @"
Public Property Set Foo(rhs As Object)
End Property

Private Sub DoSomething()
    Foo = New Object
End Sub
";
feels like the resolver would be looking for a Property Let to resolve Foo to...
 
1:50 AM
it's resolving to the Property Set. nice
and wow, here I am finding parameters that are right here in the ParameterizedDeclaration
 
2:35 AM
[retailcoder/Rubberduck] retailcoder pushed commit af79d2f9 to next: fixed inspection. todo: fix everything else that broke...
[rubberduck-vba/Rubberduck] build for commit af79d2f9 on unknown branch: AppVeyor build failed
BUILD FAILURE!
 
2:54 AM
[retailcoder/Rubberduck] retailcoder pushed commit 86519eee to next: fixed resolver bug introduced earlier
 
oh ffs
what have I done...
 
3:49 AM
[retailcoder/Rubberduck] retailcoder pushed commit 47ffe0b5 to next: 3 more green, 45 red left
 
hmm
 
[rubberduck-vba/Rubberduck] build for commit 47ffe0b5 on unknown branch: AppVeyor build failed
BUILD FAILURE!
 
yeah yeah
 
[retailcoder/Rubberduck] retailcoder pushed commit dc927b71 to next: bunch of more tests fixed... 6 failing
 
4:06 AM
hmm, a bunch of these object not set tests are using types that aren't loaded
 
[retailcoder/Rubberduck] retailcoder pushed commit 1a13a0db to next: tests had the wrong expectations
[rubberduck-vba/Rubberduck] build for commit dc927b71 on unknown branch: AppVeyor build failed
BUILD FAILURE!
 
down to one
 
[rubberduck-vba/Rubberduck] build for commit 1a13a0db on unknown branch: AppVeyor build failed
BUILD FAILURE!
 
4:27 AM
hmm, or five
 
4:45 AM
passed. running all again....
 
[retailcoder/Rubberduck] retailcoder pushed commit 97c224d8 to next: fixed bug with defaultMember logic
 
so far so good
crap
 
[rubberduck-vba/Rubberduck] build for commit 97c224d8 on unknown branch: AppVeyor build failed
BUILD FAILURE!
 
5:07 AM
[retailcoder/Rubberduck] retailcoder pushed commit 26eb6c99 to next: account for enums, clean up dead code
 
5:29 AM
[retailcoder/Rubberduck] retailcoder pushed commit a788811a to next: quickfix needs evaluator to return true when Set keyword is present
[rubberduck-vba/Rubberduck] build for commit 26eb6c99 on unknown branch: AppVeyor build cancelled
BUILD FAILURE!
 
#WhackAMole
 
[rubberduck-vba/Rubberduck] build for commit a788811a on unknown branch: AppVeyor build failed
BUILD FAILURE!
 
F it
 
5:45 AM
the RequiresSetAssignment method of the VariableRequiresSetAssignmentEvaluator is used for both flagging legit results, and for steering the quickfix decision... even when Set is present
TTGTB
 
 
2 hours later…
7:22 AM
Guys, I'm still scratching my head around MVP. I've been doing my homework with simpler patterns, and with events and other C# features, and I've tried to read all Fowler's articles about these UI patterns... but I'm still not sure...
Specially when talking about all the other UI patterns like MVC, MVVM, Passivw View, Presentation Model... wtf :(
on MVP, is the presenter just a middle man between the domain Model and the user UI View? Who is aware of who? I'm seeing in some docs that the App creates a View and the View newes his own Presenter passing him a reference to himself. In such case, View owns Presenter but both are totally aware of each other?
There are quite a few details I'm not grasping here
 
@NelsonVides let's step backward and look at the big picture.
what those patterns, MVP, MVC, MVVM all have in common is this:
they make it possible for you to test your code.
So if you create a form with a button on it that does something complicated
you naturally want to test the something complicated, right?
But if in order to test that something complicated, you MUST open the form.... that's not very good for automated testing, is it?
 
@this I'm all ears, just arrived to work earlier so I have time until there is some action here
@this precisely, that's the reason I haven't test much UI until today
 
Right, so your goal here is to make sure that as much as of your code are testable as possible.
and often, UI is a big barrier
because it doesn't really make sense to test clicking a button
you don't care about clicking the button.
you only care about the something complicated that clicking of a button initiates
so we will separate the act of clicking a button from doing something complicated
Now, you are probably thinking, "so I just stick something complicated in a function, and call that function from a button handler, right?"
 
so the click is an event that the view fires when this thing happens, and someone else is responsible for responding to this event?
 
That'll get you partially there.
Yes, exactly.
But here is the problem #2.
 
7:32 AM
so on my tests I can just fake calls to the abstract event and violà?
 
I'm not sure you need to fake the click event of button. You only need to test the actual logic embedded in something complicated
really, the click event is most uninteresting thing about the code
 
so, the event handler is a function I can call from my tests directly then (?)
 
so you could wrap the something complicated into a function of its own.
then you would have your event handler call that function
now you are not restricted to have to clicking the button -- you can now call the new function directly without opening the UI or clicking any button.
With me?
 
Ah, of course. event handler is a middle man between event call and something complicated
 
yeah
now now, you're ready for problem #2
UI is seldom simple
it's not just one big button
more often we have other stuff
 
7:36 AM
I have a hundred little questions in my head, tell me when you're ready for the bombarding xD
 
let us suppose we add a checkbox to the form
that will cause something complicated to do something B which is sort of similar to original but not identical
or maybe it does extra stuff, I don't know, don't care
the point being, that checkbox affects the behavior of the clicking of the button
 
@this should I visualise in my head one of those VBA forms? I know them better than C# ones
 
doesn't matter
VBA forms, C# forms, web forms, all applies here
we are talking at high level -- trying to solve the problem of making our code easy to test.
 
all right
 
Recall earlier,we agreed that we could just put the something complicated in a function
and have the click event handler simply call the function
but now we involve a checkbox.
We could add a parameter to our function.... somethingComplicated(isChecked As Boolean)
then in the click event handler, we could call it like so somethingComplicated Me.MyCheckbox.Value
and the code is still testable; you still don't need to open the form in order to test what happens when it runs without the checkbox checked, or with the checkbox checked.
 
7:41 AM
@this I'm imagining there's a but here...
 
(and by now I realize the checkbox is not the best example I wanted to make)
what I wanted to illustrate was that the more controls you add to an UI
the more state it has
maybe you have 100 checkboxes
maybe you have 3 dropdowns, each cascading
maybe you have 2 textboxes where if one is filled in, the other is required
oh yes, that's good one
let's use that 2 textboxes example
if we sticked to the function, we could have somethingComplicated(firstData As String, secondData As String)
with calling code like somethingComplicated Me.MyFirstTextbox, Me.MySecondTextbox
but but we want to validate the data before we run somethingComplicated
because that function is going to take us very long time....
so we probably should wrap it in a If Len(Me.FirstTextBox.Value) > 0 And If Len(Me.FirstTextbox.Value = 0) Then MsgBox "Second Textbox is required."
aaaaaannnnndddddd we're back to the original situation we were in - in order to test the above, we must open the UI
that's not good!
Worse still, it uses MsgBox.... try running that in automated tests....
See where I'm going with this?
 
@this I think I'm seeing some dirty stuff here :D
 
:) I'm oversimplifying because I want to keep us at the big picture here
Soooo. we now have 2 textboxes and we need to validate
and we need to put our validation logic..... where?
and frankly something complicated doesn't care about that validation. That's not it's responsiblity
 
not on the UI form I guess, otherwise we'll have to open it
 
Right.
So, we have 1) the UI itself... a form, whatever
2) the model which we use to represent data or action --- the something complicated
 
7:49 AM
but not on the domain Model, because the rest of the application couldn't care less
 
Correct
and that's the 3rd player....
which we refer to Controller or Presenter or ViewModel
 
and that's were there are a hundred different 3rd players and I get all confused :D
 
What those have in common is that they store the state of the UI and take on responsiblity of validating and acting on the model.
model doesn't know about the 3rd player (and doesn't care). The 3rd player is the one who gets to pull the strings
in the same way, UI generally is just a dumb thing - it's just a bunch of pixels on your screen. Again, the 3rd player is the usually the one pulling the strings on the UI.
So you could think of the controller/presenter/view model as a "starting point"
it will know about the model it has to use, and create an instance of it
then it will create an instance of UI
then it binds itself to UI so it can processes all its UI events
then take on responsilbility of validating or managing the state
before acting on the model.
with me?
 
one sec, gotta say good morning to TL
right, I'm back
so Controller is like a super resposible and full of duties 3rd player then
 
ok, be careful.
Remember other principle of good code design is to avoid creating a god anti-pattern
so you don't want controller to know everything about everything
 
7:59 AM
I was precisely thinking about that
I just understood a too responsible Controller, which doesn't sound right...
 
let's clarify what the controller should do
 
I no longer can talk about all 3 patterns - we now need to be specific
since you started w/ controller, we will now talk about MVC specifically
Controller is because of how web application works.
you know how when we have a web application, we are really just sending a HTTP request and getting back a HTML response (generally)
user can basically type in any URL they want and it might include stuff after the ? or whatever
so the question is which page should the web application should return?
that's what Controller will do
so i send in www.example.com/order/new
the application know that it is OrderController's responsibility to handle anything related to orders so it calls up the controller and new tells OrderController I want to make a new order so it gives me a HTML page for filling new order
i fill it out click a button which comes out as www.example.com/order/submit
goes back to the controller again, and it will take the data sent in, then call the model responsible for filling the order
if it goes all through, the controller know it has to give me a "order submitted" page
otehrwise, it has to give me a "there was an error" page
with me?
 
@Mat'sMug @Mat'sMug I am sure you did that just to make me feel better
 
let me think about websites for a sec, never worried about how do they actually work
 
8:07 AM
i mentioned websites because that is where MVC is best suited for, given the nature of the HTTP + web application
 
right...
this is where things get a bit fuzzy for me, but I'm not lost yet, let's continue...
 
keep in mind HTTP has no state -- so we have to fake it by submitting all the data withn the post.
and that's why controller is useful - it looks at the route and the data and know which function it needs to call and what page (that's our view) to return based on the results.
Keep in mind that you can easily test the controller without actually using a web browser
whic is the whole point.
Ok, so let's move on to MVVM... which we do use sometime with javascript and also with WPF
 
so when we fill data in the website, after clicking on Save or whatever, the controller will just go read the fields we filled on the browser and act accordingly?
 
pretty much, yes
 
and the model will be an element of the database this website is all about?
 
8:11 AM
Yes, generally.
 
like... let's talk about this stackexchange's chatroom
when I press enter, the browser raises the event and the controller reads the message's field and adds it to the chat's database
and your controller detects that the database changed and updates your view accordingly?
 
That's a pretty complicated example because on this chatroom, the content are much more dynamic and thus more "stateful" than my earlier examples.
Earlier I was talking about a simple static web page with no javascript
here, chatroom (I assume) uses lot of javascript
 
aha... a Wikipedia article maybe?
 
Yes, wiki article would be a better example
and precisely because the controller can't send events to the web pages that's already loaded (at least not with plain HTTP)
the events can only flow one way
from the web page to the controller
request - response
 
so I click on the next hyperlink, sends a HTTP request, the controller acts, finds the right article on the wiki's huge database, and sends it back to me
 
8:15 AM
you can't go "request - response -- oh yeah, more respone"
that's it.
So that is why the websites in general uses MVC
 
right... so Controller manages events flowing one way only?
 
you can say that yes
now with that idea --- let's consider MVVM.
WPF and javascript-rich web application tends to use MVVM rather than MVC.
Why? Because events can go both ways.
So let's use chatroom as example --- (pretend it's using MVVM but I don't that for a fact)
when I send my message
you were correct that teh server will then add my message to database
but it also raises an event to all clients telling "hey, there's a new message"
so your web browser is notified of this new mesage, and the view model (written in javascript) will then load the new message
which let you see my message without your URL changing
 
I'm now having the technical question of who owns who? Controller newes the view? Who newes the Controller? How much aware is the Controller of the Model? I'm going to have the same questions about all patterns btw :|
 
with wiki, you'd have to navigate. I think you get the idea.
Excellent question!
So it's the application that is responsible for owning the controller
with a desktop application, you have a main(), right?
normally you enter a loop
waiting until the main thread has ended then exit, right?
so, within that loop, the application would create a new ViewModel or Presenter to open the main screen.
and if you happen o click a button that opens another form, then the code behind should open up a new ViewModel dedicated to that new form
(which in turns creates the new View (the form) and the model for that form.
 
@this this is where the fun starts
 
8:23 AM
similarly with presenter
 
so the main VM/P that manages the main screen, will under certain events instantiate new VM/P for more screens
and each VM/P creates their own View
so the application is totally oblivious of Views and users and whatever, he only knows about Presenters
is that right?
and when the application instantiates a new Controller/Presenter/ViewModel/whatelse?, how does it makes them aware of the models? Passes a direct reference?
 
@Vogel612 I've been offline for a few days, so I don't know if you got the deftype grammar right, but in addition to the B_char, IIRC, there is also a similar definition for F (which is an argument to the same VBA statement as the B
 
I think to keep the presenter independent of the view, you want to instantiate both in the application and inject one into another.
 
That sounds roughly right (though you will need to know about commands for even more separation.
@M.Doerner is correct, of course - it is in theory possible to have one presenter manage more than one views, though it's very common to have only one presenter for one view.
 
checks watch, Googles time in USA
 
8:30 AM
Insomnia. :(
 
Hmm... I'm getting into muddy terrains now
@ThunderFrame In the Pacific Coast at least it's not too late yet?
 
Yeah that's why I want you to concentrate on simpler scenario of only one presenter/one view/onemodel
 
In Germany, it is morning already.
 
I was wondering if @this was maybe in Europe and it was not late for him but didn't dare to ask
 
@ThunderFrame I'm curious - what is the B thing used for? I never saw syntax like that before.
Nope, I'm on the wrong side.
 
8:32 AM
Notes that Android's autocorrect assumes Google with an "s" defaults to Google being possessive, rather than verb
 
thanks twice then for the late help! :D
 
Need to do something with my insomnia. ;)
 
@ThunderFrame We had the discussion yesterday that the additional lexer rule might not be a good idea because single letters would no longer be identifiers.
 
@this which USA timezone exactly? Please tell me not East coast xD
 
central
 
8:33 AM
He is in Texas, IIRC.
 
ñeh, not so bad then, maybe
 
Problem being that there is no backing out of lexer rules.
 
@this back to this... only one of each, then what's the new features a presenter adds to a controller?
 
@this the syntax of that method is 100% bad design
 
8:35 AM
@ThunderFrame please don't tell me they made special syntax just for this one method in a specific library?
@NelsonVides no, presenter is used instead of controller.
Remember earlier I told you that MVC were used on static HTML pages because events flow only one way
 
@this Line is old...
 
with MVVM and MVP, you have ability to receive events in addition to requesting some actions. So those 2 design leverage that
 
note the example usage: rpt.Line(sngTop, sngLeft) - (sngWidth, sngHeight), lngColor, B
 
Presenters update their view.
 
@ThunderFrame but but.... I mean, did they actually up go to VBA people and say "hey, can you adjust the VBA language so we can do this funky thing?"
 
They return a response.
 
I'm just shocked that they'd make such changes to the language for...one specific object in specific library.
 
@this I linked an Access reference, but the Line method is from VB5 (or possibly earlier) - I suspect VBA got it for "free"
 
oooh ok
that makes bit more sense (not that it forgives their original sin of such fugly syntax)
 
I'm going to need to go soon, maybe 10mins or so, everybody's on the office already and I'll need to work eventually :P
 
8:40 AM
and i think i might be able to get few hours of sleep
later everyone!
 
by the way, my manager wants me to show RD to the rest of the team and talk to them about good practices :D
 
nice!
 
he'll probably organise some small meeting by Friday or so
so I need to study more patterns and make good VBA code :P
Hmm... now I'm in the middle of this MVP thing, I'm so lazy about going anywhere
Ok, I got until MVC events go one way and MVP/MVVM can go both ways... could be nice to see some examples for the who-owns-who question
 
9:14 AM
[rubberduck-vba/Rubberduck] build for commit 5ded21b6 on unknown branch: AppVeyor build succeeded
 
just worked out the rest of the internal IVBProjectEx interface:
interface IVBProjectEx_VBE
{
void Placeholder1(); // returns E_NOTIMPL
void set_ProjectName(string value);
int VBE_LCID();
void set_ProjectVersion(ushort wMajorVerNum, ushort wMinorVerNum);
void set_ProjectGUID(ref Guid value);
void set_ProjectDescription(string value);
void set_ProjectHelpFileName(string value);
void set_ProjectHelpContext(int value);
string get_ConditionalCompilationArgs();
void set_ConditionalCompilationArgs(string args);
set_ProjectGUID might be interesting. I need to see if it gets persisted to disk though.
 
@WaynePhillipsEA Project GUID is persisted to the project stream, in binary format
> 2.3.1.2 ProjectId
 
sure, I know that much. But in 'live' typelibs it is always GUID_NULL. So I need to see if by setting the GUID in the above interface, does it get reset
 
[rubberduck-vba/Rubberduck] build for commit 1e601dbe on unknown branch: AppVeyor build succeeded
 
10:38 AM
so the 'live' GUID provided by the type library does not get persisted to disk. when you reload the project, we get GUID_NULL again.
is it of any use to expose the set_ProjectGUID then? It will allow you to keep track of projects via a Guid in the current session
I guess the problem would be that your parser/resolver can't read the project guid anyway, so there would be no guaranteed method of matching up your projects to the type library projects by adding this.
so... I don't believe it is of much benefit
It seems to me that we need to find a guaranteed way of matching up a VBProject (from the VBE project model, that RD already possesses) to a type library. The help file ID method is imperfect.
 
11:20 AM
> I am currently testing code in Excel VBA that involves a MsgBox and an InputBox. So I used "Fakes.InputBox.ReturnsWhen..." and "Fakes.MsgBox.Returns" statements as I thought appropriate.

In some cases this (reproducibly) leads to crashes and I can quickly glimpse the error message "Test raised an error. Specified cast is not valid."

Here you can find a minimal example to reproduce the issue:

```
Option Explicit

Option Private Module

'@TestModule
'@Folder("Tests")

Private A
[rubberduck-vba/Rubberduck] build for commit 337012ec on unknown branch: AppVeyor build succeeded
 
 
1 hour later…
12:40 PM
@NelsonVides look at the RubberduckWEB repository (the project's website), it's made with ASP.NET MVC
 
@ThunderFrame that'd be BF
 

« first day (1326 days earlier)      last day (1854 days later) »