« first day (1638 days earlier)      last day (1542 days later) » 

15:04
Curious to know if there was a consensus/resolution for ByRef/ByVal default for object thread. We have some code that always inserts ByRef (regardless of type) when generating an argument list.
I thought I was seeing 'ByVal' was best for objects.
@BZngr I thought we had an open issue for that.
I might be thinking of the default ByRef/ByVal for property parameters though.
ugh.... see that is why students need supervision when programming ...
> getArtifactSpecificContentOfAImplementationArtifactOfANodeTypeImplementation
^^ a method name
6 or 7 parameters on that thing
Should be AnImplementation?
:-P
@Comintern Specifically, I came across ByRef as the default in ExtractInterface. I'll look for the issue.
Yeah, I pretty sure we're both thinking of the same thing.
15:08
> The `IIf` function is easily a beginner trap that can cause unexpected side-effects given non-constant arguments, since the expressions need to be evaluated before their result is passed to the function. The commonly accepted "IIF evaluates both arguments" explanation is simplistic and puts the blame on `IIf`, when `IIf` is in fact not guilty of anything - it's just simple basic language mechanics at play here.

Let's make an inspection that flags arguments that involve any kind of member ca
@Duga I got the wording wrong here, I hope it's still clear
@BZngr #3486 was the one I was thinking of.
@Comintern that's a very educational inspection
thanks
15:12
maybe we need a BetYouDidntKnow inspection type
@Duga Let's call it IIfUsedAsTernaryInspection
@MathieuGuindon Any return random results. Kind of like a "tip of the day./
@Comintern I'm scrapping the whole class that the method is on, soo ...
yes, but I won't even invest the time to rename that
@Comintern ha!
public sealed class BetYouDidntKnowInspection : InspectionBase
{
	protected override IEnumerable<IInspectionResult> DoGetInspectionResults()
	{
		return new List<IInspectionResult> {new BetYouDidntKnowInspectionResult(this, FunFacts[new Random().Next(FunFacts.Count)])};
	}
}
Done.
ugh
    Else 'Do Nothing
    End If
at least there's no instruction separator
15:24
^
You have no idea how much that screwed with the indenter.
SI would indent it like a line label, would it?
or no, Else was part of a list of outdent tokens
@FreeMan Theme as long smells. docs.microsoft.com/en-us/office/vba/api/excel.xlthemecolor Is the enum since docs.microsoft.com/en-us/office/vba/api/… doesn’t list the type like pattern did.
Removing the redundant Call keywords would already be shorter by 20 characters :) — Mathieu Guindon 48 secs ago
@IvenBach That's partially Excel's fault for making it a variant - Property ThemeColor As Variant
ugh. "which is faster" kills me
This isn't about performance. With is actually pure laziness here. When any expression is duplicated in code, the solution is to extract it into a local variable - the fact that it's an object in this case makes With legal, but you'd get the exact same "benefits" with Set target = ActiveSheet.Range("A1") and then working off target. The With block only serves to hide a local object reference - in any case, either way is better than dereferencing the very same object for every statement you need to run against it. — Mathieu Guindon 48 secs ago
15:35
I like the comments above yours that recommend benchmarking it to reach the obvious conclusion...
@Comintern Yes, because of the call statement. I probably should better have written for all arguments.
@MathieuGuindon I hear that's part of the USB 4.0 spec.
@Duga @MathieuGuindon That type check is incorrectly assuming that IsAccessible considered variable shadowing, again.
I bet there is some public Theme member of some referenced library.
@Comintern you're going to like this one:
0
A: Excel VBA - When is it better to use With than repeatedly referencing the same Range?

jkpieterseI tested with this routine: Sub UseWith() Dim oCell As Range Dim sName As String Dim lColorIndex As Long Dim bItalic As Boolean Dim sSize As Single Dim bStrikethrough As Boolean TimerStart "1" For Each oCell In Sheet2.UsedRange sName = oCell.Font.Name lColorIndex = oCell.Font.ColorIndex...

> Result:

1 0.2040441766

2 0.1509655957

So 1 is about 35% slower than 2.
15:44
@IvenBach Yeah, changed it to Variant. I am, by default, resistant to Variant, so it takes time to get there.
for an unspecified Sheet2.UsedRange
TimerStart "1"? WTF?
and a single iteration
And me with only 17863 rep left for down-votes.
2
Excel MVP
15:48
While the results bear out the obvious conclusion that option 1 makes less calls to the Range indexer, you can't get any reasonable benchmark with only one iteration, especially when you are re-using variables between the 2 sections of code under test. — Comintern 6 secs ago
*fewer
test is also dependent on unspecified Sheet2.UsedRange - for all we know that's 5 cells
@MathieuGuindon Corrected, and slightly embarrassed that English is my first language.
For all we know, changing all the formatting in the first test effects the second test.
^
my biggest issue is with the "35% faster" conclusion based on an anecdotal sub-second benchmark
15:55
@MathieuGuindon O(1) is ideal, so Test(1) is good enough, right?
@BigBen actually AFAIK that's a regionalism, which would be okay..
@BigBen Now slightly embarrassed that U.S. English is my first language.
lol, sorry pretty bored on a Friday
The conclusion is anecdotal. Multiple runs arrive to different conclusions, and inverting the two tests produces different results. — Mathieu Guindon 9 secs ago
@Vogel612 No, BigBen is right. "effects" would mean "causes".
16:03
Regardless of the speed difference, the statement "the same code construct with different emphasis inside can be optimized once in one way and second time in the other" is incorrect in this specific case. Calling a method repeatedly (which is what Range("A1") is doing) when it deterministically can't change is always an optimization, regardless of how you achieve that goal. — Comintern 11 secs ago
^ That answer still rubs me the wrong way. And yes, that is my down-vote.
16:22
The attitude that VBA is merely a scripting toy is incredibly demeaning to the programmers that use it. The fact that you're solving a problem in Excel using a programming language that is integrated into the environment doesn't imply that you shouldn't care about a 2% performance gain. It certainly doesn't mean that you should take license to do something stupid like repeatedly call a function that returns the same thing. If less VBA developers behaved like script-kiddies and more behaved like programmers, there wouldn't be such a proliferation of crap VBA code on the web... — Comintern 6 secs ago
grabs the popcorn
welp
@Comintern docs.microsoft.com/en-us/office/vba/api/excel.interior.pattern also returns a variant. The difference is at least they link directly to xlPattern.
This is one of those things I couldn't understand for a long time.
@IvenBach I think most of them do in Excel - it just makes them a bit harder to keep track of (and likely impossible for RD to inspect for).
Most of them do indeed, hence my "WhyTF is variant used everywhere" for so long.
16:36
Keep in mind this is to satisfy the Automation requirement but yes, what comintern sez
So now that we that the reason why they're used everywhere is "because docs", the real question is why did MS choose to use them everywhere?
I don't understand the automation requirement. Can you breadcrumb me there?
technically we violate this ourselves using strong typed objects in our com facing side but meh
feels that @Vogel612 has something to share
16:38
oh it's just that as a mod I shouldn't want to grab popcorn that badly
idea is that you should be able to use it in any context even if there is no "header" file
lulz!
What's missing on the part of Excel is the documentation inside the TypeLib. That's what the HelpContext is for IIRR.
but then again it might help with my minor aggression towards the previous maintainers of this steaming pile of garbage I'm working on rn
Header file???
16:39
@Vogel612 Spiked 2x4's help with that.
it's really just teeny tiny. like... I wouldn't mind having a few rotten tomatoes and eggs now
Always best to take out your anger on someone else. Misdirected anger is a bad thing.
At least I'm working on my own steaming pile of garbage.
Commit from 15 months ago "Deprecate old DAOs".
^^^ That's what pets coworkers hobbies are for.
16:40
think anything happened after that?
and that's just the latest installment
like... just a few minutes ago I commited and pushed a single commit with -10kLoC
Before that you basically had to write out the stubs yourself if you were unlucky to need it in x programming language... Hence "header" file
because a whole project could be removed that I considered an entry-point
but it wasn't
and I put work into keeping the entry point stable, because apparently my boss can't grasp how much of the current codebase is just leftover cruft
or tell me about it
which is a major pain point
scare quotes used because im glossing over things. But if you understand why header files exist you understand how automation solves that particular problem
And I'm really trying to hold back with just doing basically random cleanups of the whole codebase
You don't need header files in C# because the C# compiler does two passes. The first one essentially generates the header files, and the second one does the main compilation.
Most languages only do 1 pass.
16:43
but it's so incredibly hard, because literally everything in that codebase is going against multiple basic standards
So you need to define/implement things before they are used.
@Vogel612 Fix All In Document helps with some of that.
@Hosch250 nope
not a snowball's chance in hell
sed/dim/crap/ then walk out.
You can't fix all in document for arrow code
you can't fix all in document for the old resource handling pattern
true but even so, if you need to interoperate with components not yours and not written in same language, you still need a way to expose the custom types for code use.
16:45
you can't fix all in document for different catchblocks
That's why I said some.
thats the other function the header file does
If it was things like missing braces, naming, etc.
@this The difference in this specific case is that you can do that in a TypeLib. VBA does with its enumerations.
the naming is reasonable most of the time, actually
it's just that whatever I work on, it's basically 60:40 that it's something I will later completely remove, because it's bollocks
which is .... that's not how an application should be structured
16:46
@Comintern exactly. And it's ABI so language agnostic
oh whatever... dinnerlunch and coffee, then more ripping stuff to shreds
sharpens a spare machete for @Vogel612
#TIL GH links are case sensitive.
At least WRT VBA MSDN documentation.
@IvenBach thats a server thing
ORLY?
16:49
if asp.net on windows it aint
Always learning something new.
if is lamp, then maybe it is, maybe not
That whole codebase is 303kLoC across a measly 1179 files
and that's after I dropped 40kLoC already
LAMP generally is (the L part and all).
40K of deletes? O_O
I don't feel like I've even started properly...
I'm outright ignoring 1.5k deprecation warnings
the thing I'm replacing has around a K references left
and it's dependents and supporting infrastructure also needs to be completely ripped out and replaced
16:53
I can understand ignoring deprecation warnings in a sizable code base.
Depends on the language and the usage though.
which is probably another 5k references
there's no real reason to ignore deprecation, so long as you're allowed to fix the crap
Deprecation gives you a rough measure of tech-debt in the codebase
The "allowed to" is the key. Deprecated things tend to stay in place here because of QA availability.
That and a hefty dose of "if it isn't broken..." syndrome.
"QA availability" T.T
you haven't grasped the depth of my despair yet.
there is no such thing as QA here
and it's not like the code isn't broken... there's just enough duct tape on enough different places and enough happy-pathing in meatbag testing that it appears to work
I'm gathering by context that the test coverage is either non-existent or similar to the QA...
I was surprised to find out that there actually is a handful of tests.
like ... a literal handful
17:01
That sounds like my code here. I just got assigned an on-call meatbag for the time being, but I really need time to write a full test suite.
I need to make the code something resembling testable before I can even think of writing these....
> Related to the now closed #4349 but in RD build .4244, I'm getting a false positive `'item' conflicts with an existing name.` warning.

Starting with this code:

```VBA
Private Sub PrintDataRow(ByRef Report As Worksheet, ByVal clinicList As ProcessClinic, ByVal theClinic As String, ByVal reportSettings As SatAndLoyaltySettings)

LogManager.Log TraceLevel, "SatAndLoyalty.PrintDataRows"

Dim CI As ClinicItem
Set CI = clinicList.ClinicItems(theClinic)

If CI.ytdResp > 0 Then
@Duga Wut? Wasn't that fixed?
hence "Related to the now closed #4349..."
17:06
What does the indexer look like on clinicList.ClinicItems(theClinic)? Is .ClinicItems an exposed Collection on ProcessClinic?
@Comintern yes it is
I wonder if we're picking up the default member usage there.
@Vogel612 I did that when I first started. Not a good feeling realizing the 4+ hours you spent tidying up code was dead code that shouldn't have been there in the first place.
problem is: I've been doing that for almost half a year now
and it's still that way
17:10
> Semi-related, should there be a refactoring for inlining With statements? Or an(other?) inspection to flag With blocks that work off an existing local variable?
:shudder: Didn't realize that. I can give you my last condolence left. Treat it carefully.
To the isolation chamber you go.
@Hosch250 one should never cut off Little Debi!
he finally gets there. probably ruined it along the way...
@FreeMan well ... GDPR-blocked
17:17
sigh... Sorry.
@Duga come on, give us a star!!
@Vogel612 that is probably my new favorite expression! :D
@MathieuGuindon I got that from Iven, you know?
> The main problem that I would see with inlining `With` statements is that the expression that captures the `With` variable might have side effects. For example:

```
With ThisWorkbook.Worksheets.Add
.Name = "NewSheet"
' ...
End With
```
In that case, the refactoring would need to introduce a local variable. The problem with that, is that `End With` can *also* have side effects.

With DefaultInstance
.Foo = 42
.Bar = "bar"
End With
Should we remove the hacktoberfest label?
Are we going to get to it in the next 11 months?
17:26
> The first case is trivially solved though; the With expression is just brought to RHS of the new variable's assignment (assuming we can correctly get the Set keyword requirement for it... which is a whole other issue). As for default instances... snap.
Leave it for next year.
698 stars. Almost 700.
@Duga oh, already starred :)
@IvenBach tied with decalage2/oletools
i wonder if they went on a twitterstorm just to catch up?
17:30
I think I starred decalage2/oletools...
TRAITOR!
@this lol
maybe I'm imagining things but I thought they were like 50 stars behind originally
we'll catch up when we have fewer bugs :)
we got un-starred quite a lot over the years
huh, apparently I can edit tags now.
> Suggested:
rubber-duck
resharper
campaign
jetbrains
percentage
not very good suggestion, except for first, maybe (though we already have rubberduck, without the hyphen).
4 hours ago, by Mathieu Guindon
6
17:35
oh! Thought that was just you correcting the count.
that's exactly what I did ;-)
so I have this new power.... what should I do now....
EDIT ALL THE TAGS!!!
nah. I should fix bugs.
Insert a single space at the end of each one
:)
17:37
and maybe even make it easier for new contributors to join, too. (WIP)
@this you may need to add the meta solution to the appveyor yml...
Nope.
I'm not even sure it supports multiple solution builds...
it's already compiling
ohhh, cool
17:38
@MathieuGuindon FWIW, I feel mine is mostly "symbolic" at this point too.
I barely do any real work anymore.
Just hang out in the chat.
Maybe a PR or 5 when I want a free shirt and on my vacation.
  <Target Name="EnsureCodeAnalyzersBuild" BeforeTargets="PrepareForBuild"
          Condition="!Exists('$(SolutionDir)RubberduckCodeAnalysis\bin\RubberduckCodeAnalysis.dll')">
    <Message Text="Missing the required code analyzers. Building the code analzyers..." Importance="high" />
    <MSBuild Projects="@(CodeAnalyzersToBuild)"
             BuildInParallel="false"
             ContinueOnError="false"
             SkipNonexistentProjects="false"
             StopOnFirstFailure="true"
             UnloadProjectsOnCompletion="true"
^ that's how I make the solution depend on the metasolution and ensure it is compiled
@Hosch250 you're a full-fledged and appreciated member of \DEV
\CORE (perhaps a bad name) has the admin privs :)
@this love it
Thanks!
Oh.
Well, carry on!
17:42
It would be nice to have a build configuration that didn't run the analyzers.
Huh, I can't even see the Core team.
@Comintern yes, definitely
Would make "debug test" a lot more inviting.
Oh, found it.
Double-nested.
Should be possible to pass a flag and trigger analyzers based on the flag. That in turn could probably be passed to VS configuration
17:44
to be sure not the standard code analyzers
I think the RD's custom analyzers should be always "on"
definitely needs some investigating...
Why? If I'm debugging a specific issue I generally don't care about it until I'm ready to run all tests on the fix.
Otherwise, it's: change a line of code. run all code analyzers. change a line of code. run all code analyzers...
huh is RD showing up near the top for everyone on the all-time top-voted UserVoice request or it's just me? visualstudio.uservoice.com/forums/121579-visual-studio/…
The RD code analyzer will show up in realtime
don't think it can if it's off
@MathieuGuindon You mean the comment by Sten2005?
17:50
yeah
besides it's small and quick it should be unnoticeable.... for now.
who's that?
No clue.
Obviously a VB6 fan though. The full user name is "Sten2005 - Microsoft support VB6 programming on Windows 10 until at least 2025"
17:52
^ been making us pubicity
obviously a fan, yeah
> Just bring back Visual Basic 6.0. Save Microsoft by putting this programming language by default on Windows. You really do not have good programmers anymore?
LOL....
Clueless.
> Platt suggests developing a new version of the VB6 programming language and IDE (which he names VB*) that compiles to Javascript and HTML5
:barfs:
I wonder what'd happen if they open sourced VB6.
probably something like what happened when they open sourced unity3d "for reading only"
someone went ahead and fixed a long-standing bug and opened a PR
Oh, yes I think you? someone? linked to that PR.
was a fun read.
17:55
yea, pretty sure it was me
look! I fixed it for you! Guys, it's fixed! Look, look! Just merge it!
@this someone (!) will fork it, chaos will ensue
Would that someone happened to be named Mathieu?
In honesty, though, maybe not that much.
I'm assuming it was written in C++ (or dare I say C?)
IOW not that very accessible.
17:57
if MS isn't touching that codebase with a 10-foot pole, I presume any fork would only ever manage to introduce new bugs
especially Mathieu's fork
Yeah, pretty much. I can see plugins or addins leveraging the inner knowledge, though.
still, would make an excellent source of knowl .. ^^
I'd probably port it to c#.
@MathieuGuindon Pubicity???
You know, showing the pubic hairs around.
17:59
@IvenBach MY KEYBOARD DOESN'T LIKE COFFEE
@this ~insert picard meme here
coughyet he can spell l in likecough
> Get out there and expose yourself to the world!
lol

« first day (1638 days earlier)      last day (1542 days later) »