« first day (1018 days earlier)      last day (2162 days later) » 
00:00 - 22:0022:00 - 00:00

12:00 AM
RELOAD!
[Hosch250/Rubberduck] 3 commits. 161 additions. 210 deletions.
[rubberduck-vba/Rubberduck] 12 commits. 2 opened issues. 2 closed issues. 22 issue comments. 7609 additions. 5154 deletions.
 
12:17 AM
> Rubberduck.Setup.2.0.13.0.exe (5.83 MiB) - Downloaded 245 times.
Last updated on 2017-03-12
> Total Downloads 10,399
 
 
1 hour later…
1:33 AM
1
Q: Improving code for stolen computers

Denis FarrellI have put together a small vbscript to gather a bunch of information and email at scheduled intervals, so that one day, should it happen, and my computers are stolen, I may be able to provide relevant and accurate information to the authorities to expedite their return. I wanted to share what I...

 
If anyone has time I put up my question codereview.stackexchange.com/questions/158247/…
 
 
1 hour later…
2:46 AM
@IvenBach I just reviewed it--I saw it on the home page before I saw it here, actually.
Don't feel bad because I shredded you--my first reviews shredded me too.
 
OK, seriously. WTH can't I get the README.md markdown right?
 
@Hosch250 Any and all criticism is welcome, I think.
I just want to improve in my coding capabilities. I have no other source of critique outside of CR so I'm willing to be told I'm wrong. Shouldn't bother me too much since I'm learning this free from and have no formal instruction.
 
[rubberduck-vba/Rubberduck] build for commit 2d312d4a on next: AppVeyor build succeeded
[rubberduck-vba/Rubberduck] build for commit 2fa5c4e9 on unknown branch: AppVeyor build succeeded
 
5:20 AM
huh
thisworkbook.VBProject.References.addfromfile "C:\Program Files (x86)\Common Files\microsoft shared\VBA\VBA7.1\VBE7.dll\3"
Class Class
Member of VBInternal
- Event Initialize()
- Event Terminate()
 
 
3 hours later…
8:22 AM
@ThunderFrame. A question for you. Do you see any benefits yourself of saving Excel as a binary file .xlsb with VBA code? excelefficiency.com/reduce-excel-file-size/… says so at #3
 
 
1 hour later…
9:37 AM
@PeterMTaylor It depends what you want you want of the file, and it depends on your data. XLSB will generally be smaller and might also open and save more quickly, but it's mostly binary, so without Excel or third party tools, you don't get the benefit of being able to interact with the XML parts.
For example, .NET can read and write an XSLX/XLSM and process most of the content without the user having Excel installed.
 
Cool. Thanks for that.
 
Kaz
Hi Guys,
Just stopping by to give some feedback on RD 2.0.13
So far, it's not crashing on exit.
Awesome job.
 
9:53 AM
:)
 
 
2 hours later…
11:40 AM
> '@Ignore SmartIndenter would allow for a procedure by procedure exclusion. Not sure I want to be prompted to load indenter settings every time I launch the IDE.
 
12:06 PM
> Just to check:
Open a workbook with VBA. Press Alt+F11, RD splash appears. Button says "Pending". As expected
Open a second workbook with VBA. Alt+F11. RD says "Parsing" although I had not clicked Pending.
No crash this time, just an unwanted Parse. I still only want RD when I want to use it, it drags performance too much to have it parse without being asked.
> Open a workbook with VBA, Alt+F11, RD splash, OK.
Open another large workbook. Get VBA msgbox
"Error accessing file. Network connection may have been lost."
Nothing specific being named.
There are no missing references.
Add-In manager, uncheck RD, restart Excel.
Repeat test above, no error.
> @daFreeMan it would only prompt once, the first time RD starts. I like the annotation idea.
 
12:55 PM
> Seems like we need another setting for this. "Parse automatically [ ]" or something along these lines. FWIW originally RD was intended to automatically start parsing when the vba project was opened the first time. This especially allows using all commands.
 
2 things should be noted here. First, neither comment is "part of the Sub" as far as the VBA grammar is concerned. According to the language specification, only lines between the Sub declaration and End Sub are part of the procedure. Second, the placement of the line is a VBE rendering decision based on how ProcOfLine is implemented. Interestingly if you read the remarks in the linked documentation, the OP's screenshots appear to demonstrate a bug in the VBE object model. — Comintern 14 secs ago
 
1:46 PM
> I'd go with:

- [x] Process opened projects at startup

Opt-in or opt-out?
> Whatever the default is expected to be now - I had thought it was supposed to stay Pending so I'd have to Opt-In. I don't mind.
> How about
Else
'don't know what to do yet
End If
> Yes, I'd like to collapse repeated reports of the same thing but not have to turn it off and re-inspect.
> @SystemsModelling I'd still like RD to offer to remove everything between Else and End If (including Else but excluding End If) in a case like this; in 3.x we'd use this information (the inspection result) to change the syntax highlighting and dim the coloring a notch, a bit like Visual Studio (/R#) does for redundant statements and code blocks.
> This one is a odd one, and I've had this pop up a couple of times myself. At this point I'm not sure what exactly the "file" that VBA is referring to *is*. My best guess is that is it related to 1 (or more) of 3 things:

1. Using `Assembly.LoadFile` to load libraries at run-time. Probably the most unlikely of the 3 unless it's interacting with on of the others.
2. The change to the parser's file export to use the Temp folder.
3. A change that caused the parser to attempt a read of vbaPr
 
2:04 PM
@ThunderFrame XLSB has some XML structure, just not everything. eg docProps, customUI
 
> At a previous position I wrote a `MyMsgBox` that had `MsgBox`-like functionality with a built-in countdown timer.

We needed to be able to boot people out of the system, and many times people would go to lunch with the Access front-end open. A `MsgBox` displayed on their screen would disable the timer event that would check for the "boot 'em out" flag in the DB.

**TL;DR** I support this feature!
> @daFreeMan this issue is made entirely moot with the recent merging of @comintern's work on the fakes framework.

`MsgBox` calls are suddenly no longer problematic as far as unit testing is concerned - the test setup code just needs to configure `Fakes.MsgBox` as needed.
 
@Comintern can MsgBox fakes be setup in a @TestInitialize method?
(or any fakes really)
 
@Comintern I haven't checked with the language spec but comments before a proc and immediately after are counted in ProcOfLine as part of the proc. I can't see from that post what the linked documentation is, but there is a bug with subs defined in #IF conditional compilation. I sent Mathieu a workbook with some (ahem. brief) comments referring to that.
 
@Comintern Do I recall correctly that the VBE loads projects with some internal name and then renames them to their actual name?
 
@Mat'sMug - Nope, not anymore. I fixed that in the last PR - setting them up for multiple tests throws the invocation counts all out a whack.
 
2:11 PM
@M.Doerner correct. A brand new project initially loads with a VBProject - then the VBE performs a rename to VBAProject
 
In that case we might interfere with the load procedure in our handler of the project added event.
 
@Comintern @TestInitialize runs before every test, and @TestCleanup after every test - we should be able to allow fakes to be setup in there
 
@sysmod Yeah, that's the bug I was referring to. If you look at the bottom screenshot, the VBE isn't taking the line continuation into account when determining if the line is part of a comment. At least we're not the only ones with that problem...
 
I think we should only reparse on the project renamed event.
 
IIRC we don't turn on the VBE event hooks until the initial parse though
 
2:14 PM
@Mat'sMug Yeah, that's what I thought too, but for some reason when I had them setting up in initialize the hooks weren't getting removed between function calls.
I might have to take another look at that - it's possible I just did something stupid.
 
@ModuleInitialize?
 
I guess the problem with the project load surfaced after I added the delay as a hack to get the reparse on component removal to work.
 
@Mat'sMug I haven't tried it, but they might set up there OK. The other consideration is whether we intend to ever support running tests individual (as opposed to all tests in a module at the same time). But yeah, if I can get the hooks out cleanly it would be nice to support module-wide configuration.
@Mat'sMug Currently the VBE event hooks are what trigger the initial parse.
 
mkay so that was flipped around just recently
 
^ I never got around to coding the "don't do this on startup" part because I was like "huh, that works now".
Maybe works-ish would have been more accurate.
 
2:23 PM
@Comintern yup. we definitely need to be able to run a single selected test on demand - and in that case the order should be @ModuleInitialize, then @TestInitialize, then the selected test, then @TestCleanup, then @ModuleCleanup.
@M.Doerner would Task.Delay(100).Wait(); make any difference?
(vs Thread.Sleep)
sleep would be blocking the main thread, no? i.e. the thread the VBE is using to load itself..
 
I do not think it would make any difference. We are waiting in thread pool thread anyway.
The delay is inside the method we run in the background. Otherwise, it would have no effect on the timing at all.
 
hmm
 
More precisely, we call ParseAll only via Task.Run(() => ParseAll(token)) .
 
oh I see.. I used to have the delay much higher up the call stack
 
 
1 hour later…
3:38 PM
Morning.
 
Morning.
I hit the jackpot on my answer.
 
@Hosch250 thanks for the comments. It'll be tonight when I get the chance to review them.
 
17 more answers and 31 more votes until I have a silver C# badge.
 
30
 
3:54 PM
TCF Bank:
> A job opening matching your profile for a position of Senior Scrum Master - Plymouth-00RO5 has just been posted in our Career Section.
Uh, I don't know Scrum, and I'm not senior at anything, yet.
 
just read up on it... nobody does Agile/Scrum right anyway
 
Sure.
 
@Mat'sMug How is it supposed to be done?
 
it's a tool, a methodology. most see it as a religion.
 
@IvenBach Nobody is really sure.
 
4:03 PM
@Mat'sMug I think a 'Features example' for each release would be helpful. Just seeing your use of the references during your youtube interview has just made so much of what I'm doing cakewalk.
 
Oh, BTW, @Mat'sMug, I was thinking that maybe you and I and anyone else who wanted could do a weekly or so video on each feature.
 
Ah. Where I was working it seemed to work well. It was really only 2 software devs and me making 'hakey' spreadsheets work.
That may have been a big part of it though.
@Hosch250 Please do!
 
yeah.. I need to put that YT account (and that webcam) to good use now
 
It doesn't have to be anything big or grandiose. Just something like a 1 min highlight for whatever gets added and how it's used. That would bring a lot attention to RD.
 
^
agreed
 
4:06 PM
I was thinking something short--like a video on the code explorer, or just one refactoring, or one (or a couple) inspections.
 
like, some 30-second "quick-tip" videos that could be auto-played in Twitter & FB feeds :)
 
We could cover lots of stuff, like how to use it, why to use it, interesting challenges when writing it...
Well, I was thinking 5-10 minutes would be good.
If you want 30 seconds, just create a GIF of it being used.
 
right
hmm
I guess "RD Source Control in 30 seconds" isn't gonna cut it ;-)
 
That one would probably need to be split up into a few.
Like, the 101 ways of creating/cloning a repo.
And then, pushing/pulling/publishing.
 
..and the 99 ways of making it blow up?
 
4:24 PM
 
@Comintern I'd recommend ScreenToGif.
 
That's what RD is going to do to the VBE, right?
 
@IvenBach No, that's what we are trying to not do to the VBE.
 
I kid...
 
@Hosch250 I don't want to be that close.
 
4:27 PM
They got their own website now.
Written in C#/WPF (must be C# 6 since they require .NET 4.6.1).
 
Yeah, I just trawled Google images for that - screen recorders are generally frowned upon at work.
 
Well, don't use it at work.
BTW, does your company need any C# devs?
I'd like to move, but I'd rather not since I likely wouldn't be able to bring my dog :/
I figured it might be easier to get in a company where I know someone.
Most of the people I know are manual laborers or retired.
 
For the references that are listed in search results. Is it possible to not have it duplicate tabs, have it replace the results instead?
 
We probably do need C# devs - we're just not hiring any. Our main line is done in MFC\C++;
Have you checked for jobs that offer remoting?
 
Yeah, but they are mostly senior positions.
Tough to get remote if you've never held a job before.
 
4:34 PM
True. I'd kill to be able to remote.
 
I've wanted to have a job since I was 10, but my parents never let me do yardwork for our neighbors or anything.
 
I live like 5 minutes away from the office, so it's not like I couldn't get there if I needed to.
 
If I had a foothold anywhere, I'd start a single-person business developing small to medium applications for businesses that didn't want to (or couldn't) do it in-house.
 
I'd guess there's a really good market for that. I don't have the patience to do the marketing side though.
 
And I don't have the resources.
And I'm sure the Asians would get most the business since they'd charge half the price (buy my product would be twice as maintainable, so...)
 
4:37 PM
Depends - you'd be surprised at how many small businesses prefer face-to-face meetings.
 
So, instead of going door-to-door looking for a job, I go door-to-door looking for a contract?
 
Yeah, that's the big downside of it.
 
@Hosch250 Or go to businesses doing the same thing. Just be ready to hear 'No' a lot.
 
4:43 PM
It's funny, but about 80% of the time I have to make a guess in minesweeper, I hit the bomb. Even when I have a 75% chance of success, I hit the bomb.
 
hey, GitHub added my requested feature! you can assign an issue to a project right off the bat!
 
5:00 PM
Sweet!
 
> Inspector Rubberduck (awaiting triage)
 
that's awesome
 
@Mat'sMug I wish you could choose which group you could add it to without going through that.
 
5:04 PM
well it's still better than what it was
 
True.
 
hi!
 
hi!
 
hi!
 
hi!
 
5:13 PM
Let me break the loop.
Ops I think I just did that
 
5:35 PM
There's nothing wrong with having multiple returns for a method?
 
not really
as long as the method remains clear :)
 
Function GetFieldName() as String
    Select case True
        case bool1
            value = "string1"
        case bool2
            value = "string2"
    ....
    GetFieldName = value
    End Select
rather than having
 
oh, in VBA
 
man I really fail at Fixed font...
 
the return value assignment doesn't actually return though
 
5:38 PM
So whether you assign it to a temp string or to the function it's kind of a moot point?
 
so instead of putting Exit Function in every Case block I'd just assign a result and then assign the function once, just at the end of it; at the end of the day it's just about style
 
ok
 
what I frown really hard on, is seeing the function's return value being used as if it were a local variable, after it's assigned
at that point it's just lazy coding
if you need a local, declare and use a local :)
 
Something like
Function thisFunc(someVar as string) as string
    thisFunc="someString"
    somevar = thisfunc
    thisFunc = "anotherStringThat'sUsed"
end function
 
yeah
cringes
 
5:45 PM
I better understand why.
I hope you don't mind my continual 'duh' checks. I just want to make sure I'm understanding the what and why both.
 
This is the hardest part of school. Halfway through the third quarter, and completely exhausted.
 
an exception to this would be for a recursive function
 
@IvenBach That code illustrates the reason you don't do that. somevar = thisfunc is a compile error because it's trying to call the function recursively without an argument.
 
@Comintern pretty sure VBA will just happily take the String value there
...a terrible, horrible idea.. but VBA allows it.
another great "not because you can that you should" example
 
@Mat'sMug So, how does that look once it is compiled?
Does the first assignment basically shadow the name of the function?
 
5:50 PM
IDK, I never decompiled VBA code
but I've seen function identifiers used as though they were locals
so I presume VBA allocates a local variable named after the function, in the same memory spot as the caller will be looking for a return value
 
@Mat'sMug and thats the somevar = thisfunc?
 
@Mat'sMug Seriously? You're right. WTF VBA?
 
@IvenBach the thisfunc in that expression, yes
 
I know I've done things like that previously, which is why I asked.
A lot of my bad habits result from not knowing any better.
 
@IvenBach - See, that even got me confused. This would be recursive:
Function thisFunc(someVar As String) As String
    thisFunc = "someString"
    someVar = thisFunc(someVar)
    thisFunc = "anotherStringThat'sUsed"
End Function
 
5:55 PM
> Warning: Expression 'thisFunc = "anotherStringThat'sUsed"' is unreachable. Recursive logic has no way out.
^ #IHaveADream
 
HardCodedStackOverflowInspection?
 
UnstoppableRecursiveExecutionPathInspection
:)
basically, yeah. a hard-coded SOE
"not all code paths return a value" would be nice too.. I think
 
TurtlesAllTheWayDownInspection
 
lol
 
I don't get that joke.
Sounds like something similar to an infinite Russian Doll thingie.
 
6:00 PM
"Turtles all the way down" is a jocular expression of the infinite regress problem in cosmology posed by the "unmoved mover" paradox. The metaphor in the anecdote represents a popular notion of the model that Earth is actually flat and is supported on the back of a World Turtle, which itself is propped up by a chain of larger and larger turtles. Questioning what the final turtle might be standing on, the anecdote humorously concludes that it is "turtles all the way down". The expression is an illustration of the concept of Anavastha in Indian philosophy, and refers to the defect of infinite regress...
 
TMNTInspection
 
@Mat'sMug If that does come to be, the wording would have to be different - maybe something more like "Not all code paths set the return value".
 
"Return value is left unassigned in one or more code paths"
well you get the idea
 
Yeah. I'm guilty of abusing the default return value on a regular basis.
 
Oh.
 
6:04 PM
me too
OTOH... "Redundant assignment to default value can be removed"
 
I think I like that better.
 
> We don't ... We just break it in a controlled way.

For one we still need to find a way to actually enumerate the InspectionResults to display them in the UI, which means there still **will** be a method somewhere that has the signature `IEnumerable<InspectionResult> GetInspectionResults()`

That method will have to wait for the full annotation of the parse-tree to complete though. As such we may need to know about how far the annotation process has progressed when we want to retrieve insp
 
Or implement them both and let the user decide.
 
> We don't ... We just break it in a controlled way.

For one we still need to find a way to actually enumerate the InspectionResults to display them in the UI, which means there still **will** be a method somewhere that has the signature `IEnumerable<InspectionResult> GetInspectionResults()`

That method will have to wait for the full annotation of the parse-tree to complete though. As such we may need to know about how far the annotation process has progressed when we want to retrieve insp
 
6:09 PM
@Comintern It should be RubberDucks all the way down.
2
 
lol
 
6:37 PM
> I've hit this a few times with .XLSM & .XLTM files in the last week or two. I just chalked it up to our flaky network. I'll be sure to grab a log next time it happens, just in case there's something useful in there.
 
7:04 PM
@Duga it could very well be caused by a flaky network...
 
I have it on my PC when opening files from C - No network involved
closing the file and reopening usually fixes the problem
 
it's still annoying, nonetheless
inevitable consequences of doing I/O work I guess: there will be exceptions.
 
> Here's some errors, I don't know if they relate to this

2017-03-20 18:43:04.8488;ERROR-2.0.13.32288;Rubberduck.Parsing.VBA.ComponentParseTask;Exception thrown in thread 10, ParseTaskID 82c534a5-225e-4cd4-9abf-0a4032150fbf.;System.ArgumentOutOfRangeException: Length cannot be less than zero.
Parameter name: length
at System.String.Substring(Int32 startIndex, Int32 length)
at Rubberduck.Parsing.Preprocessing.LivelinessExpression.MarkAsDead(String code) in C:\Users\Mathieu\Documents\G
 
7:23 PM
we need to update the debug build# to 2.0.14
32288 is the .13 release build
 
@sysmod yep, but the sheet data is in binary. If you can't write the sheet data, you can't programmatically create an XLSB without 3rd party tools, or spending a lot of time reading the spec.
 
> Another option would be to not make this change at all and instead let the `Inspector` annotate the trees with all results in one walk over the tree.

We will anyway have to change the `IInspector` interface and move it to `Rubberduck.Parsing.Inspections` if we want to trigger the inspections from the `ParseCoodinator`. (I think we should constructor inject the `IInspector` into the `ParseCoordinator` and continue to handle the details of running the inspections in the `Inspector`.)
 
7:39 PM
@Mat'sMug About a week ago @ThunderFrame and I had been able to consistently reproduce the file access exception by loading a second project. I really think we might interfere with the load behaviour of the VBE. Might be that we are interfering with the VBE renaming the project. (We query the corresponding COM object in the parsing run.)
 
hmm
how about making the initial parse delay a whole second?
ugh
just saying it out loud writing it feels wrong
 
Maybe we could just skip handling the project added event and only parse on the project renamed event. That should be raised anyway after the project is loaded when the VBE renames the project to its actual name.
 
only for triggering the initial parse though
problem is that if you load an existing/saved project then the rename doesn't occur
 
Oh, I thought it always does it.
 
yeah that would make things easier :)
 
7:57 PM
@Hosch250 I'm trying to digest your comment Those should probably be fields on my guessing game codereview.stackexchange.com/questions/158247/….
reading msdn.microsoft.com/en-us/library/ms229054(v=vs.100).aspx and specifically the section Note that the Employees property is accessed in each loop ... Developers are more likely to call a method once and cache the results of the method call to perform their processing.
 
Uh, that is 100% irrelevant.
 
I'm trying to understand what a field is.
 
it's a module-scope variable that every member can access
 
You aren't working with properties/methods there, you are working with fields/local variables.
I'll throw together an example of each. Hang on.
 
I'm trying to understand but lack enough comprehension to know where to start.
 
8:00 PM
(scroll down to Fields/Instance Fields)
VBA example, but the concept is the same in any language
 
public class Foo
{
    private int _myField = 0;

    public int MyProperty
    {
        get { return _myField; } // returns data cached in _myField
        set { _myField = value; } // assigns new data to _myField--"value" is a keyword with the data
    }

    public int MyMethod()
    {
        int randomNumber = 4;  // variable
        return _myField * randomNumber;
    }
}
 
(I'm reading these too)
 
Read the C# docs. They should be pretty good.
 
Oh my bad, we're on C#
I'm at least reading @Mat'sMug's link since that applies to VBA
 
> A variable can be declared (in increasing visibility level):

At procedure level, using the Dim keyword in any procedure; a local variable.
At module level, using the Private keyword in any type of module; a private field.
At instance level, using the Friend keyword in any type of class module; a friend field.
At instance level, using the Public keyword in any type of class module; a public field.
Globally, using the Public keyword in a standard module; a global variable.
a "field" is just another name for a "variable", as is "local" - both "field" and "local" refer to variables, except a "local" is at procedure level and a "field" is at module level.
 
8:07 PM
And all the sub topics in the sidebar.
At least, the property, ctor, field, and parameter ones.
You probably don't need to read the event, operator, and extension methods ones yet...
Huh, it seems that the C# docs don't have a lot about the basic members.
GTG read The Canterbury Tales.
Oh me gosh, here is someone else needing to be shredded: codereview.stackexchange.com/questions/158335/…
I think I'll pass--GTG, like I said.
 
8:28 PM
@Mat'sMug Read the Fields/Instance Fields and think I've understood the material.
@puzzlepiece87 There's just so much to read. I don't know if we'll ever get to the end.
 
CSharp in Depth would be Jon Skeet's - always excellent reads
 
IIRC the term Field comes from when Pascal referred to structs as Records, but those fields were public. But meh, I'm intoducing a new language and an old paradigm, so probably not helping.
 
8:43 PM
Ethymology. Always nice =)
COM has a RECORD data type too
 
I'd suggest that C# in Depth is a secondary read. You need to have a reasonable understanding of C# before you tackle that book.
 
^ right.
Although... it does cover everything there is to cover about C#, and nicely
between that and an APress Pro C# brick...
 
Don't forget I'm coming into this programming stuff with only VBA as a foundation.
I'm sure we all know what a shaky foundation VBA can be...
 
@ThunderFrame I always thought "field" came from magnetic-core memory.
 
@IvenBach same here
 
8:46 PM
@IvenBach you know it's actually a pretty good start ...
because it teaches you to question things ...
 
George Carlin taught me to to question everything. VBA reinforces that, sometimes painfully so...
 
and that's one of the, if not the core skill of programming. Everything else is just .. reading docs and reading requirements
 
@Comintern For the record, that's a different field of study
3
 
Bah dum tish
 
lol
 
8:49 PM
Methods, properties, events, constructors, and fields are collectively referred to as members That would have been helpful knowing a while ago.
FML. Members of 'Range' in the VBA object browser...
Light bulb finally turned on.
 
plz systems modelling use markdown ...
 
@IvenBach Sounds like you might need to get a good understanding of Encapsulation, which VBA supports.
 
So with the Range Class in VBA. Theoretically there could be a _border field and the Borders property (since It's read only) is the getter of the _border field?
 
^ hey I know one that's perfect to learn C# if you're coming from VBA!
@IvenBach looks like the light bulb did turn on ;-)
 
8:56 PM
@IvenBach The Excel library encapsulates the field(s) behind the border property. It mightn't even have a backing field (it might be calculated as part of the property get). Encapsulation requires that the field isn't available to use or inspect (outside of the class that contains it), other than by interacting with the property.
but you can make a field public, and break encapsulation
 
I struggle with understanding it in theory and then transferring that theory to my own code usage.
 
understanding the theory is a good start :)
in practice, you can look at pretty much any RD class
 
When only by thinking really hard can I understand something, by the time I get to writing the code my understanding fails me and I fall back to poor practices. That's why I keep asking duh questions trying to fill in all the small holes.
 
Think of a procedure with a variable declared within the procedure. You know that you have control over when that value can be read from or written to, and you have control over the values that are acceptable to assign to it. but if you had declared that variable as a Public variable at module level, then others could manipulate it's value, and possibly break your code by assigning unexpected values.
 
@IvenBach keep writing code and putting it up on CR then :)
 
9:01 PM
@IvenBach That's where refactoring old code can help.
 
@Comintern I'm going to have to do that with all my old code before I post it up on CR. I'm letting them be abused on CR so I can learn and improve.
 
My wife has an internal field _age. But the public property Age returns _age - 5
6
 
@ThunderFrame So I'm in control? That's not what my wife says...
 
@IvenBach I have like 35 more years till retirement, there will be plenty of time to get work-related reading in :P
 
@puzzlepiece87 We're likely the same age and in the same boat, just don't rock it too much.
 
9:06 PM
@IvenBach I've yet to tip over a canoe but I've made its occupants nervous
 
@ThunderFrame It's the 'I don't know, and I don't care.' line. You just know that it works.
 
Dear Property Get, I don't care how you retrieve the value I'm requesting, but if you throw an error or you start doing I/O or dragging on performance, then you should consider becoming a function
 
@ThunderFrame I'm not fully understanding that. Give me time to digest some articles and they may help me get this idea.
 
@IvenBach If I ask for the border of a range, there shouldn't be any situation where that will return an error. An object has a property, so it shouldn't be possible for an error to occur while returning that property. A method like Workbooks.Open might fail (if the filepath doesn't exist, or the file is locked, or the user doesn't have access, yada, yada, yada).
but MS does expose some properties that throw on some occasions.
 
9:22 PM
A getter that throws an exception is a bad getter
 
With an unsaved workbook active, this throws:
?thisworkbook.VBProject.FileName
 
note I never said the VBIDE was a good API
4
 
And RD has to manage around that.
 
Anyway, TTQW
 
> Here's some errors, I don't know if they relate to this

2017-03-20 18:43:04.8488;ERROR-2.0.13.32288;Rubberduck.Parsing.VBA.ComponentParseTask;Exception thrown in thread 10, ParseTaskID 82c534a5-225e-4cd4-9abf-0a4032150fbf.;System.ArgumentOutOfRangeException: Length cannot be less than zero.
Parameter name: length
at System.String.Substring(Int32 startIndex, Int32 length)
at Rubberduck.Parsing.Preprocessing.LivelinessExpression.MarkAsDead(String code) in C:\Users\Mathieu\Documents\G
> @SystemsModelling Please check out the changes I made to this (and a lot of other) comment(s) of yours. Formatting the exception (and everything else, too) in a consistent and readable manner makes things significantly easier for the team to read and understand and helps us tremendously.

While we do have the ability to edit your comments, it's less hassle for all involved if you format it right in the first place 😄 Thanks
 
9:27 PM
grmblgrmnl why does nobody else do this?? don't you find it incredibly annoying to not have a code-blocked stacktrace?
 
9:50 PM
If I'm understanding msdn.microsoft.com/en-us/library/ms229058(v=vs.110).aspx specifically Adding Value to Enums
An example of that is VBA Range object Value and Value2 property. Although they aren't an enum since Value inadvertantly rounds that's why Value2 was put in.
That's so anything is backwards compatible.
 
@IvenBach I think you're confusing the 1 or more values that an Enum can have, and the name of a property that an object exposes. There's no relationship between an enum value and a property named value. A property, regardless of its name can return a value of type Enum, but the return type of a property isn't directly related to the name of a property, other than the name's meaning might hint at the return type.
The Range.Value property returns a Variant or Variant array. It could just as easily have been named Range.FooBarNatorFizzleBuzz
 
> This should fix the second batch of errors from the log posted in issue #2912.

Previously the `Members` function on the `DeclarationFinder` assumed that we only look for declarations belonging to QMNs that exist in the `_declarations` collection.
 
@ThunderFrame Interestingly enough, C# might get "Records" soon.
 
OK.
 
00:00 - 22:0022:00 - 00:00

« first day (1018 days earlier)      last day (2162 days later) »