« first day (2573 days earlier)      last day (44 days later) » 

12:02 AM
[rubberduck-vba/Rubberduck] {commits=2, issue_comments=3, issues=1}
2 hours later…
2:12 AM
Question on lambda expressions: What, exactly, is the point?
If you're writing a method, isn't the point, generally, to be able to reuse it, and lambda expressions don't exactly look reusable...
AIUI it enables you to create a method in-line for those times where it's a one time use.
I think the correct term is anonymous method.
I see that, I guess I'm just not "seeing" it. I guess it's only for functions that take a method name and only if you don't ever expect to use that (fairly short) method again in the future?
If the method would be used in only a single location there's no need to have it be visible to any other locations.
I guess...
Even if you made the implementation private it would still be visible from inside the class.
Having it as an anonymous method ensures it will only be used where it's declared.
2:18 AM
I mean, I see the value, but it seems... overkill? Confusing? Especially with the shortcut the shortcut method where (int x) => ... becomes simply x => ...
I've found them to be useful with LINQ statements.
also seems to somewhat contradict the "say what you mean and mean what you say" mantra.
Maybe when I get more used to them...
^ That's what it took for me.
Coming from VBA-landia and not having a lot of the tools makes many of them weird/strange/confusing because they're unfamiliar.
Outside of that one of the other more knowledgeable ducks would have to chime in and answer.
Expression-bodied definitions make sense and relieve some of the vertical space, but they also seem like the one-line If x > 5 Then Exit Sub one line If statements that I tend to avoid in VBA...
guess I'll get used to new things
@FreeMan IMO The "say what you mean..." falls back to how experienced/comfortable you are with a language. Past-Iven of pre-RD would have been very confused by the code that Present-Iven writes.
2:36 AM
Taking another step forward in my AddNewComponent branch. I anticipated copy-pasta-ing the addition logic for each component that would be added. But I'm not sure it will pan out. I'd like some feedback on my thought process.
I refactored the logic from to create NewComponentCodeProvider to keep it consolidated.
I've only completed its implementation for AddStdModuleCommand.AddStandardModule and AddClassModuleCommand.AddClassModule.
Is it appropriate to keep the logic contained within a class whose method's return type are subsequently passed to another member?
Or would it be better to pass the member a reference to the IAddComponentService and then internally invoke the AddComponentWithAttributes member on the reference?
4 hours later…
6:31 AM
Another thing that Iven didn't mention yet: Lambdas can be used to capture the context they are constructed in. That's why they're sometimes called "closures"
3 hours later…
9:59 AM
10:43 AM
@Vogel612 Does that mean that the lambda could be used to create a new object which is then assigned to a variable?
11:12 AM
@IvenBach fair enough. I'll probably avoid lambdas for now unless/until I hit a situation where I feel one is required.
GitHub reports "This branch is 4327 commits behind rubberduck-vba:next. "
I need to fetch & merge on GitHub, then pull it to my local (I've never had source on the work machine, so this'll be a first time), right?
11:31 AM
Fetch & Merge seems to have me up to date... Now for the next step...
IIRC, I have to uninstall a "built" version if I want to attempt to compile this myself, right?
@FreeMan depends on how strict your compiler is and how much immutability the language designers wanted to force on you....
but generally speaking, yes, that's very much possible
@FreeMan it helps, yes, because the registration of the installed version can interfere with the registration of the debug version
12:04 PM
@Vogel612 At this stage of my C# game, I'm just going to go with this. ;)
@Vogel612 and thank you. Thought so
12:15 PM
~sigh... CSS is annoying.
> Yes, Most User who like to export files for Git, likely to keep all modules in same folder
12:51 PM
> Thanks for the feedback, that's a great idea!
A simple "export source files to host document directory" checkbox (cleared by default, to preserve current "prompt everytime" default behavior) in *general settings* could do it.
The only thing to watch out for, I think, is that the setting isn't useful when hosted in VB6 and the notion of a "host document" would be confusing then: the option should probably be hidden when the host is VB6.
@FreeMan if you ever felt the need to pass a function to a method (rather than the result of that function), then you've solved it by working around the lack of delegates in VBA (likely by passing an outright object encapsulating that function).
Imagine writing a Filter (or Where) method on some custom collection, and you want the caller to be able to specify the criteria: with delegates you can pass, say, any function that takes an item and returns a Boolean, and then the implementation simply invokes that function for each item and yields the items for which the function returned True.
By allowing to pass a lambda expression / anonymous function rather than a full-fledged object, the language is making it easier and more lightweight to do this.
and Lambdas allow you to in-line that instead of writing a standalone function to do it... I get it, but I don't yet fully get it.
I'm sure it will seem perfectly natural and obvious in time, but ATM, it's tripping me up.
It's perfectly normal, it trips everyone up =)
Wow... that's the first time in a long time anyone has implied that I'm "perfectly normal"! <3
1:14 PM
@MathieuGuindon Any plans for another chapter on MVVM?
@SmileyFtW not until I've fully ported it to twinBASIC; without a library to house the support code, MVVM in pure VBA is essentially ...nuts.
That's been progressing slowly for a while, mostly because of the early tB preview's single-file limitation.
Bummer. I was enjoying the VBA version. BTW the Example Form is improperly sized in the current version on GH. I reported it as an issue.
@MathieuGuindon You are aware it's been lifted, right?
The single file limitation in twinBASIC.
1:36 PM
ahhh.... no. I haven't gotten into tB yet
Been working at the ranch, not programming
@this yeah I started extracting all the files and actually organizing things, but I'm wondering if it wouldn't be quicker to just start it over rather than refactor... the tB compiler doesn't seem to like a project that's half uncompilable!
In fact I was hoping for an "extract to ClassName.twin" tool to show up along with the single-file limitation being lifted
Yeah, I think it was mentioned somewhere. I've seen some reports of compiler crashing which was speedily fixed so far.
1:56 PM
> VB6 needs separate thought. I'd love to be able to have Rubberduck encourage the use of actual file system folders, something which is entirely possible but never used because the Project Explorer doesn't show folders.

Maybe we should have a VB6-specific inspection, which would identify mismatches between the Folder annotation and the source file location, with a quickfix of "Move to folder" which would then move the source file and update the .vbp accordingly. If there's appetite for that
2:18 PM
> @mansellan the quick-fix also needs to eventually actually delete the source code file from its original location. Definitely needs its own issue, but I think we must implement #4646 first.
2:44 PM
How this got 10 upvotes is head-scratching. Set Datatype = Worksheets(i).UsedRange.Find("Datatype").Column is an immediate error. — BigBen 1 min ago
^ rummaging about in the dusty bits...
Yeah looking for a dupe link to hammer a question.

SalimVBA is showing me an error with this code. Could you help me to fix this? Sub datemth() x = Sheets("output").Range("d2:w2").Find(Month(Sheets("input").Range("j1"))) x.Select End Sub The error is "Object variable or With block variable not set":

3:00 PM
delete hammered...
do y'all generally apply VS updates as they become available, or are there reasons for holding off on specific ones?
aside from "what random thing is going to break this time" holding-off?
I kind of miss the 3-year actually-stable release cycles.
Well, yeah, that would be an important thing to know... Where does one look for a general "all-clear, it's safe to update to version x.y.z, since that's fixed all the issues in x.y.a through a.y.q"?
@MathieuGuindon actually, at that time, the practice was to "wait until they've patched the RTM version at least 2 times"
going to the RTM was always buggy. But yeah, it made things somewhat easier.
i always update asap. livin' on the edge :-)
@mansellan do you have a blood bank nearby?
3:16 PM
maybe I shouldn't have installed the updates... :/ ¯_(ツ)_/¯
weird... half his arm is missing.
nope, Maybe it's just Firefox
`\` is an escape character.
double it up
that's what I get for using anything beyond a simple smilie
Smilie? That ain't a smilie.
mission accomplished
3:19 PM
@BigBen the "compile error" in the OP would actually be a run-time error, but I can't seem to repro it.. it's a "type mismatch" I get with a Set keyword and a successful Find call (and the expected error 91 when Find fails).
@this yes
now we're perpetually on a RTM version
as someone once said, it's like a hamster wheel.
you can only run or crash'n'burn.
@mansellan always has the best IDEaaS! ;)
Typed arrays are a mess... even when they're implicitly typed like here. I'd recommend just passing them around as plain Variant parameters, e.g. ByRef imports As Variant; getImportArray is returning a plain Variant. — Mathieu Guindon 2 mins ago
@MathieuGuindon something that could be tightened up in tB?
3:25 PM
not sure how that could be done without breaking back-compat
but yeah I got like 2-3 comments on the RD style guide specifically about the "consider passing arrays as plain variants" bit - and this is exactly why.
@MathieuGuindon that .Column is flagged as a compile error, right?
Set foo = rng.Find("baz").Column is an immediate compile error, Object required.
But the whole answer needs rewritten.
@BigBen it's not.. how could it be? Worksheets returns an Object, everything after that can only be evaluated at run-time
Set and .Column don't belong on the same line.
oh, definitely
but that's a run-time type mismatch, not a compile-time "object required"
ah I was using Sheet1... hmm so why did OP complain specifically of a compile error?
3:34 PM
it becomes a compile-time "object required" error if the Datatype variable is declared with an actual data type rather than an implicit (or explicit) Variant
e.g. Dim Datatype As Long
I'm tempted to rewrite the entire answer... either way, it's totally off.
@BigBen because their question was unclear and their explanation of the "object required" error should have included the actual variable declarations involved, too
any thoughts on rewrite vs. downvote vs. leave a trail of kind comments for future readers?
it's just another dupe of "I'm chaining member calls to Range.Find and it's blowing up, help"
yeah agreed... but a dupe with 97k views.
3:38 PM
"solved by using Rubberduck" :)
ok deleted my compile error comment.... going to rewrite the answer lol
wouldn't that be changing the meaning of the author's post?
the +17 one is calling out the actual problem
hi @Mast
Yeah it would be changing the meaning.
@MathieuGuindon /wave
Is that frowned upon?
3:41 PM
@BigBen then it's not an edit that should be made; the author got pings from our comments already
yeah edits should fix grammar or other minor mistakes (and/or improve formatting), but not change the meaning of a post
^ Exactly.
Ok gotcha
RTM = ???
"Release To Market"
Release To Masses?
3:44 PM
pretty much
an alternative i heard was release to manufacturers
all work, though.
"Really Thoroughly Marvellous"
Read the Manual.
@BigBen was gonna say that...
that's gotta be the winner
3:54 PM
It's missing something.
The clean version :-)
4:17 PM
and "Read the fantastic manual" isn't as clean? ;-)
4:53 PM
Are we no longer receiving commitstrip updates?
Let's say I'm making a VBA object with a bunch of properties. With the Type backing and such, following the @MathieuGuindon example. Is there a simple way to generate the properties Get\Let? It's a ton of boilerplate
5:18 PM
@HackSlash don't bother making the actual private type; just make a bunch of public fields, then use the Encapsulate Field refactoring and select all the public fields - it'll generate all the boilerplate including the private type declaration (it's a checkbox)
Wow! That would be great! I've made a few of these by hand and it's really repetative
@HackSlash That would be IS great!!! I've used it a number of times, and it most certainly is!
@IvenBach now that you mention it, it seems we aren't...
heh... I just realized. I updated my VS2019 install earlier today. I get a new laptop tomorrow, so I get a chance to unupdate it! :D
I'm having a brain pretzel. I've got an object I want to use in a collection. All read-only properties. How to I generate the collection and set the values of the internal This for each object in the collection?
define the setter on the default interface and return an interface
5:26 PM
I need another object?
yeah, your consuming code should work with the IThing, not the Thing
I want it to be self-assembling and self contained. I avoid iThing as much as possible. I'm sure it's an important pattern but I kinda hate it
It's the only way to hide those setters that you need to construct the Thing without allowing your consumers to accidentally modify them by providing the IThing.
See, that's where VBA/VBIDE works toward encouraging you to do it "one giant file that is totally self contained so I can easily export and import into other projects" which means you end up with an untestable entity.
@IvenBach I think the feeds is weird. it works then stops working. IDK.
@HackSlash I avoid iThings as much as possible, too. I'm not a big Apple fan either. ;)
Ok, so I've made a unit constructor and a collection constructor. The collection constructor calls the unit constructor in a loop. Then it returns the collection of units. I'm not sure if this is a terrible thing but I think it does what I want.
5:40 PM
@FreeMan iThingIThing
@HackSlash Sounds reasonable.
@this whew!
@FreeMan iHowever, iJobs iis iDisappointed iby iyour iheretic ibelief.
iDon't iCare
iScream iInstead
iYou iwill iscream ifor iApple.
iscream ion iapple ipie iis igood, ii'm inot isure iabout iapple iscream
5:45 PM
iBut iif iyou iare inot isure, iwhy ido iyou ispeak iApple?
iiiii imy ieyes!
i i (aye aye).
5:59 PM
ok a stupid question regarding statistics? accounting? whatever. Let's say I have a column that tracks the apples consumed, then another that tracks oranges consumed. I can then calculate AverageApplesConsumed and AverageOrangesConsumed using just the AVG() function. However, do I (AVG(ApplesConsumed) + AVG(OrangesConsumed))/2 or do I AVG(ApplesConsumed + OrangedConsumed) to get the average of fruit consumption?
You can't average averages.
Well, you can, but you don't get the right answer.
That's what I was wondering with the first equation
but the 2nd equation doesn't feel right but I can't articulate why.
The first is giving equal weighting to each category (most likely not what you want).
6:50 PM
The second one is FruitConsumed
7:33 PM
Man, proper casing in C# is getting to me. Especially since I'm going through an online class using a primitive web-based editor that doesn't do any sort of autocomplete.
I'm too used to the VBE fixing the case of everything for me. That's how I know I spelled it correctly!
7:53 PM
@FreeMan be aware the intellisense in C# is different than VBIDE.
that matters because IBigThing _bigThing can be typed like IBT<tab>_bT<tab>
You couldn't do that with VBIDE's intellisense which requires that you get few characters at least, then do some upping/downing with the arrow keys to get the item you want to autocomplete.
@Freeman Averaging averages is the cornerstone of Statistical Process Control (Central Limit Theorem)
8:18 PM
@this that's pretty snifty! this editor doesn't have anything vaguely resembling autocomplete...
@Freeflow let's be honest here, after 3 semesters of Calculus in high school and a 4th my freshman year of college earning myself 4 straight Cs, I pretty much gave up on the Actuarial Science major... That was also the limit of my stats classes...
the fact that I can properly write "math" (singular, not like those crazy Brits) is one of my major mathematical accomplishments!
Can one create overloads on a class constructor, allowing different properties to be set at run-time, or is there only one possible?
wondering out loud - no present need...
yes, yes I can.
just had to wait 2 steps in the course I'm working through
8:39 PM
@FreeMan I assume that the editor requires true manly grit.
8:58 PM
> I don’t think so because there are other items in the With block, regardless of Type, that aren’t throwing the exception.

From: Mathieu Guindon ***@***.***>
Sent: Monday, June 21, 2021 2:44 PM
To: rubberduck-vba/Rubberduck ***@***.***>
Cc: David ***@***.***>; Author ***@***.***>
Subject: Re: [rubberduck-vba/Rubberduck] Procedure Not Used Inspection - False Positive (#5817)

Could it be just the With block throwing a wrench here?

You are receiving this because you authored the thread
@FreeMan real coding grognards start by coding in notepad.
9:15 PM
@IvenBach disagree
10:08 PM
Yeah, yeah... I'm learning me sumpin' about proper capitalization...
@this :+1: Humor detected.
Humor, or assault with a painful weapon.
Nope. Best way to eliminate unwanted in-law visits.
11:16 PM
Supposedly you can call a collection item by a string name assigned when added but I'm getting "Run-time error '438' Object doesn't support this property or method"


Optional. A unique String expression that specifies a key string that can be used instead of a positional index to access this new element in the collection.
Oh my, it's worse than expected. If I access a member of the returned object it works but I can't get a handle on the object itself...
Doesn't matter if I declare the container to be of the custom object type, variant, or generic object. I get an error instead of a returned object
11:47 PM
[rubberduck-vba/Rubberduck]: 1361 stars vs. [decalage2/oletools]: 1616 stars

« first day (2573 days earlier)      last day (44 days later) »