« first day (1014 days earlier)      last day (2166 days later) » 

9:00 PM
Because there's no real reason to do it. ThisWorkbook is a great name, it means this workbook - the one running the code that's running; it's kinda WTF-prone to change it
 
@IvenBach IIRC, the name is determined by the locale. It's ThisWorkbook for English users, but could be a locale specific name anywhere else. There's really no harm in changing it.
 
*IMO
@ThunderFrame nope, code name is ThisWorkbook in a fr-CA locale
 
@Mat'sMug ^ NOPE
 
Uh oh... I started something, sorry.
 
/s locale, office UI language
 
9:04 PM
@ThunderFrame oooh shoot that's right lol my laptop is fr but my office is en lol
@IvenBach all healthy debate is good :-)
 
I'm just trying to learn better and eventually best practices.
 
I retract everything I said then. @ThunderFrame has the right of it. No harm renaming it.
 
Followup question, is it typically done? I'm guessing no.
 
learning from your own mistakes having your assumptions torn apart is the best form of learning ;-)
2
beats me why they localize ThisWorkBook and not VBAProject
 
Why localize anything? I thought everyone was supposed to learn American anyways <-- I'm kidding
 
9:09 PM
@IvenBach Not typically. Can be useful in Word where there might be several templates, and you can access them all natively.
 
Ok.
 
@IvenBach Not typically. Can be useful in Word where there might be several templates, and you can access them all natively.
 
@ThunderFrame only one would be 'Normal.dot' though
 
9:22 PM
  'Call the template method directly
  TemplateDocument.Foo

  'Call the template method that is extended to the current document
  MyDocument.Foo
And in Excel, when referencing another workbook or addin:
  Debug.Print AddinWorkbook.Name
  Debug.Print ReferencedWorkbook.Name
  Debug.Print ThisWorkbook.Name
 
Just one more view.
 
Because of this issue coming up randomly without a cause - erm, no runtime error ever happens without a cause. — Mat's Mug 16 secs ago
 
@Mat'sMug And thus began the flood of downvotes which perpetuate the 'Elitest Stack Overflow snob' comments.
 
well, "what are all the reasons X could possibly fail" is hardly a specific question
I'd have to struggle to keep it within the 30K character limit
 
10:02 PM
I agree with all the comments. I just don't have enough rep to downvote without harming myself more.
 
downvoting questions costs 0 rep
I will redo this. I meant to say we cannot find the cause yet - an 'out of memory' message comes up followed by the 1004 error, and it points to the delete method. Would rewording this to include an attempt at developing the wrapper function and asking for missing conditions work? — haans 1 min ago
OP seems cooperative though
 
Retracted DV because of cooperativeness.
 
I literally just saw that.
 
Let me know if he stops being cooperative.
 
The problem is that the premise is flawed. There is a ridiculous amount of reasons anything could throw an error, in pretty much any code. Including your wrapper function and asking for missing conditions would still be too broad; including your wrapper function and asking why you're getting runtime error XYZ on line 42 would be ok. See Minimal, Complete, and Verifiable example and the links @KenWhite provided. — Mat's Mug 8 secs ago
 
10:07 PM
@Mat'sMug What if it isn't line 42? Does he have to redesign his code until it is?
 
of course!
TTQW
ha, OP deleted before I could reply - good thing I could still see and edit my last comment
oh lol, chat won't load it
> (protip: EDIT this question, don't ask a new one)
asking n questions that get downvoted, closed, deleted, ... isn't doing your account any good
 
10:30 PM
@Mat'sMug The struggle to ask well worded questions is extreme.
:duh:
someRange.copy
anotherRange.PasteSpecial paste:=xlPasteValues
anotherRange.value2 = someRange.value2
Yeah I feel smart
 
10:53 PM
The example in @Hosch250's Encapsulate Field dialog made me think... While it is possible to use a Let AND a Set, and use a Variant field... Shouldn't RD be suggesting that that is a bad idea? And anyway, shouldn't the Set be accepting an Object argument?
and, it turns out, who needs a Set anyway?
Public Property Let Foo(Value As Variant)
  If IsObject(Value) Then
    Set mfoo = Value
  Else
    mfoo = Value
  End If
End Property
 
@ThunderFrame because semantics?
 
@ThunderFrame It trades compile-time errors for run-time errors - #2859
 
That needs to be an inspection btw... passing an object variable to a property let that takes a variant is language abuse
@Comintern that
 
@ThunderFrame Please...
 
@Hosch250 should the setter type options say "Value (Let)" / "Reference (Set)"
?
 
11:08 PM
@Mat'sMug Well, you told me what to put there in the first place.
Those are just hard-coded.
 
Huh, they're not resources... Let's make them
 
So, if you want to change it, sure, but be aware of the localization stuff (BTW, there are a couple new ones that aren't in French/German, I think).
 
Yeah
 
@Mat'sMug Yeah, because "Let" is "Let" in the language, regardless of the language.
 
@Mat'sMug yep, like cmd.ActiveConnection = conn should be Set cmd.ActiveConnection = conn?
 
11:10 PM
Bachelors’ degree and 3 years of experience in C#/.Net (WCF) development experience using Visual Studio required (.Net 2.0 or greater) and SQL development experience

-OR-

Masters’ degree and 1 year of experience in C#/.Net (WCF) development experience using Visual Studio required (.Net 2.0 or greater) and SQL development experience
Whatever... I'd take the experience over the degree any day.
 
@Hosch250 yeah.. I was thinking perhaps value/reference would help beginners know which one they want
@Hosch250 yup
 
@Comintern by the same token, a Property Set should always accept an Object argument and not a Variant?
which means A) Inspection for Set Property without Object type argument, and B) Encapsulate Field Dialog's Set statement needs to use Object instead of Variant AND, possibly needs to let the user choose a specific Type if they wish.
 
@ThunderFrame Yeah, I think that's entirely reasonable.
 
actually, the code in the Encapsulate field dialog is letting/setting to, and getting from the property, not to the field? And the field name isn't visible/definable in the dialog?
 
@Mat'sMug I'm not too sure what to do about the Assigned ByVal Parameter thingie.
Should I just move all that extra stuff to the main Refactorings folder?
 
11:22 PM
@Hosch250 - IDK if I'm looking at an old version of the dialog, but the code should be something like:
Private mfoo As Variant

'... Other proecedures ...

Public Property Get Foo() As Variant
    If IsObject(mfoo) Then
        Set Foo = mfoo
    Else
        Foo = mfoo
    End If
End Property

Public Property Let Foo(Value As Variant)
    mfoo = Value
End Property

Public Property Set Foo(Value As Object)
    Set mfoo = Value
End Property
 
@ThunderFrame Easy to change.
Just pull the latest changes and edit the property generator, or whatever.
 
IMO - RD should encourage the private Type, private this field, like @Mat'sMug is prone to do, or at least offer that style.
 
11:35 PM
> A `Property Set` should, by definition, accept an `Object` or an object-type, and never a `Variant` argument as the object argument.

```vb
Public Property Get Foo(indexer As Long) As Variant
Debug.Print "Ignored ", indexer
Set Foo = mfoo
End Property

Public Property Set Foo(indexer As Long, theObject As Variant)
Debug.Print "Ignored ", indexer
Set mfoo = theObject
End Property
```

Should have the Setter's `theObject` argument supplied as an object type:

```v
> A `Property Get` that has an Object-type backing field, or *only* has a corresponding Setter, should never return a `Variant`, preferring an object return type instead.

```vb
Private mfoo As Object

Public Property Get Foo() As Variant
Set Foo = mfoo
End Property

Public Property Set Foo(Value As Object)
Set mfoo = Value
End Property
```

The getter returns Variant, but both the backing field and the lack of a Letter indicate that the Getter will always return an object-
> Linking #2859
> Linking #2859
> Linking #2881
 
gosh, how many inspections do we have currently/planned
 
@ThunderFrame that's why I track them in their own project :-)
 
takes subtle hint to assign issues to projects
 
@Hosch250 not sure what you mean, bit please avoid structural changes until I merge my stuff -;)
@ThunderFrame lol
 
11:50 PM
Is it worth extending the annotation syntax for documenting methods/method arguments? RD 3.0 could provide intellisense with method/parameter descriptions. Annotation cross-references might be fun overkill
 
@ThunderFrame ha, why not! not useful until 3.0 though
hmm revisit xml doc?
 
The best bit about Rubberduck, with hands deep in the guts, is that nothing seems like Jumping the Shark.
2
 
@Mat'sMug We can easily handle xml doc in the parser.
 
@Comintern the issue is currently closed as "out of scope" though
annotations seem more ducky-idiomatic :-)
...and we could always export annotations as xml doc
 
^
If we put annotations in a parser stream, you can do anything you want with them. The only drawback is that it might get cumbersome: @ParameterDescription("foo", "The thing to frob.")
Actually, that doesn't look that bad.
Kind of like c# decorations.
 
11:56 PM
'@ParameterDescription("foo", "Works with the @@Bar")
 
^Parse error.
 
^ timing/context error
 
^Capitalization error.
 
^ used like a type hint
 
lol
 

« first day (1014 days earlier)      last day (2166 days later) »