« first day (2576 days earlier)      last day (604 days later) » 

12:02 AM
REFRESH!
[rubberduck-vba/Rubberduck] {issue_comments=2}
 
@Duga eh?
 
12:22 AM
@FreeMan Should you be mad enough to try it: Most languages limit the size of their arrays to 2^31 elements
Not that most machines let you allocate that much memory in the first place, but alas.
 
so realistically, the limit to the array size is the amount of memory that can be allocated. However, the "limited length" is referring to the fact that an array cannot be resized once declared, right? No C# equivalent to VBA's ReDim.
 
That tutorial also seems to be ... not quite technically correct most of the time. And the length limitation is usually not the thing that's annoying about arrays. More likely searching, deletion and sorting are the annoying parts.
@FreeMan Well ... VBA Arrays are arrays. Just a peculiar implementation
 
A) that's why I'm asking clarifications here ;) and B) it did mention others, like that.
 
but most commonly you can not resize arrays.
 
OK. Just one of those things that they say that makes me pause...
 
12:25 AM
On that note: Most languages do not have the capability of defining LBound and UBound on array types
 
It may not be 100% technically accurate (I'll get that sorted), but it does seem to resonate with me - it's making sense, so ima run with it.
 
I know for sure that Ada and VBA have that, but off the top of my head that's it.
 
Can you define an array in C# that starts at anything other than 0?
hence no need for LBound and UBound is simply .Count - 1...
 
@Vogel612 that limitation usually comes from the way indexers are implemented/
@FreeMan .Length, not .Count()
@FreeMan I do think I did just say that :D
 
see, just a technical issue to get ironed out. I know what to do, it'll just take a sec to figure out how...
 
12:29 AM
@FreeMan actually there's an interesting semantic difference... Length is immutable, Count can change (pretty easily). Compare also the notion of a List's Capacity.
Aaaaand I'm infodumping, because it's late ....
Night y'all :D
 
lol. What's the best way of learning? repetition! What's the best way of learning? repetition! What's the best way of learning? repetition!
night!
little things, like For Each item in collection becomes foreach (<type> item in collection). Just little syntax stuff...
brain shutdown. Nightall
 
1:16 AM
@FreeMan once you know one programming language it is easier to relate it to the next one you learn. Keep going.
Indexers had me confused for a good while since VBA has nothing directly similar.
 
 
1 hour later…
2:29 AM
@FreeMan Not necessarily. What if both are null?
@SonGokussj4 Love that area myself. It and Norway is about the only place in Europe I'd ever be interested in visiting.
@SonGokussj4 That's a pretty big one. I'm near the top of tornado alley. My parents lived at the edge of the city bubble so storms always got pushed north/south of the cities, so we didn't really get them. I'm 30-45 minutes north of the city now, so I'll get them more, likely.
Before, we rarely went downstairs for tornados (we didn't have a basement anyway...), but now I'll have to start. I only have a half basement, though, so I'm still screwed if I get a direct hit.
@mansellan That's a good article.
Interestingly enough, there's also F*, which is even "more" pure: fstar-lang.org
 
 
9 hours later…
11:10 AM
@Hosch250 does null == null return True? It doesn't in SQL, which is why you have to compare WHERE column is NULL instead of WHERE column = NULL.
 
11:28 AM
AAARRRRGGGHHHH!!!!!
the duck still won't parse this code which means that I can't Refactor | Encapsulate Field which means I have to do it by hand. :(
#enablemylazy
Ah! It does parse on the office machine, so I'll do it there
hi @MathieuGuindon! waves
 
Is there some if (windowsUserId == FreeMan && machineClass == laptop) {} code buried somewhere in the guts of the Duck, and my mission is to learn enough C# to root it out?
Are y'all trying to help me out?
 
I am wondering... :/
 
You got the same build/version on both?
 
11:39 AM
of the duck, yes.
I'm pretty sure that Windows updates are applied equally, too.
Office, though, is different on this new laptop, I do believe
Version 2.5.2.5951
OS: Microsoft Windows NT 10.0.18363.0, x64
Host Product: Microsoft Office 2016 x64
Host Version: 16.0.5164.1000
Host Executable: MSACCESS.EXE
From the office desktop machine. (gimme a sec...)
Version 2.5.2.5951
OS: Microsoft Windows NT 10.0.19042.0, x64
Host Product: Microsoft Office x64
Host Version: 16.0.13127.21668
Host Executable: MSACCESS.EXE
from the new laptop
However, I was running Office 2016 on the old laptop. (where the issue was originally reported from)
it's happened across a variety of RD builds, initially reported on only Excel, but has now crept into Access.
hrm, different Win builds, too.
Slightly different topic: In my data I'm given one field with LastName, FirstName. In my class that contains the data, I need to separate that out into distinct firstName and lastName fields.
It would make more sense to have a FirstName method that returns the first name instead of making it a property with a read-only Get, right?
though the end result would be the same...
 
Is the data clean? It rarely is..
 
11:56 AM
probably not... If I don't find a comma, I guess I'll just return FullName.
That'll look snazzy in the email being sent out: "Dear LastName FirstName LastName FirstName..."
:)
it's only going to employees, they don't count for nutin' round here anyway...
Actually, the data is output from an EMR, so it should actually be reasonably clean - I'm reasonably certain that it requires something in both first & last name columns, but I don't have access to the original system, so I can't confirm 100%
and, one would assume (with all associated risk) that it will put a comma between the last & first names, since it's a defined report...
In a class, if I'm storing data, then I provide a property Get/Let to access it. If it's doing something with data, then I provide a method to access it.
</rubberducking>
 
12:37 PM
@FreeMan null == null is true, yes.
 
huh...
 
just be happy you're not doing JS ...
NaN == NaN // false
null == false // false
!!null == false // true
 
from everything everyone here says, I most certainly am!
 
(FWIW the first one is really not JSs fault, but eh)
 
wait... if null == false is false, then !null == false should be true, yet, !!null = false is true?
I've got an ice cream headache...
 
12:41 PM
no, it"s fancier.
 
how do you "not" null, anyway?
 
using ! coerces the operand to boolean.
and !null is of course true
 
Yeah... I'm just going to pretend we didn't have this conversation...
 
also, more fun with bottom values:
 
shakes head, walks away...
 
12:43 PM
null == undefined // true
null === undefined // false
which of course means that: !null === !undefined is true
 
♫I'm not listening...♫ `<sticks fingers in ears>la la la... la la la la.... la la la...
Honestly, I don't WTF very often, but W. T. F. were they thinking smoking?
 
it makes sense as soon as you realize that in JS types are mostly a suggestion
 
no. wait. don't answer that.
@Vogel612 and people complain about implicit Variant in VBA...
 
well, guess why typescript is such a huge ecosystem these days.
a few years back there used to be a new "*script" that transpiled to js every few weeks
and of course they all were mostly mutually incompatible, but all went through the same toolchain (huzzah for babel and webpack)
 
1:42 PM
@FreeMan remember that the null in C# is not NULL in SQL. A null pointer just is basically Const NULL As LongPtr = &H0
which is why you can do null = null in that context.
 
Yeah... gotta break that SQL NULL is _everything_ NULL thought process. I'll get there...
Quick code review:
Public Function FinalEmail(ByRef workingEmail As String) As Boolean

  FinalEmail = True
  If this.DevelopmentMode Then
    workingEmail = Tools.ThisUserName & EMAIL_DOMAIN
  ElseIf Len(this.WorkEmail) > 0 Then
    workingEmail = this.WorkEmail
  ElseIf Len(this.PersonalEmail) > 0 Then
    workingEmail = this.PersonalEmail
  Else
    workingEmail = Tools.ThisUserName & EMAIL_DOMAIN
    FinalEmail = False
  End If

End Function
is doing too much, isn't it?
I should have a FinalEmail that determines what address to use and a HaveValidEmail that returns the boolean. right?
the side-effecting ByRef is annoying because I'm using it for it's boolean purposes where I don't actually need to get the actual finalEmail result.
 
so in the case it's False, you do what?
 
why does your object isntance know whether it's in development mode?
That sounds like something that's not the concern of a user, but instead the module where you send emails
 
False is used elsewhere to override the subject line, the body & the recipient. i.e. if I don't get an email in either work or personal, someone screwed up on data entry, and a manager is notified.
the object knows because the object is the one that creates the subject line & body.
 
ew
unless.... that's not a user, but a message
 
1:57 PM
correct - that's part of an EmailMessage class, not a User class.
 
FWIW, this really wants to be named TryGet...
 
sorry, was patently obvious to me - y'all can't read my mind from over there?
 
and to be honest, the FinalEmail is kind of confusing.
 
@this TryGet implies "return a changed parameter if available, else return False because we failed.
 
Correct.
 
1:59 PM
no
 
OK, it's a review on the specific question at hand, not the whole bloody thing!!! :)
 
TryGet implies an out ref
 
ah, gotcha, @Vogel612
 
The thing, though is that you're actually returning 2 piece of data
 
it's basically a shorthand for a tuple return value where the first element is a boolean and the second is the out value.
 
2:01 PM
I understand @this' TryGet, but I'm finding its use awkward, and I'm thinking breaking it up into GetEmail and DoWeHaveAnEmailToBeginWith would make usage easier
 
Either Public Function FinalEmail() As FinalEmailData or Public Sub FinalEmail(ByRef FinalEmail As Boolean, ByRef WorkingEmail As String)
 
@Vogel612 so public void TryGet(outEmail, outVaild) (more or less
 
no.
by definition a TryGet.... should return a bool
 
ah. makes sense. TryGet is what I wrote, I just didn't name it well.
 
Public Function TryGetFinalEmail(ByRef outEmail) As Boolean
^ that would be the TryGet version
 
2:03 PM
but because you say you use the workingEmail even if FinalEmail returns false, it makes it weird.
since the convention is that if it's false, it's not safe to access the workingEmail parameter.
 
However, I'm finding the actual usage awkward because there are places where I want to find out if I've got a valid address, but don't care what it actually is. So, breaking the functions out into WhatsTheEmailAddress and DoIHaveAValidEmail would make useage easier
 
the whole activity flow seems a bit ... borked is what we're trying to say, I think
 
yeah. I need to break it up into 2 methods.
 
Yes I think that's better.
 
(And, I'll rename FinalEmail) :)
 
2:04 PM
@FreeMan Why are these places different is the very interesting question there, then :)
 
because the SubjectBuilder and BodyBuilder functions need to know if the address is valid - if not, they tag on additional info. However, they don't actually care who it's going to.
cringes, awaiting additional bashing critique
:)
Seriously, I do appreciate the feedback!
The best part of being the Lone Ranger is that there's nobody to micromanage how I do it.
 
If the address is not valid in the first place, what are you doing building a body and subject?
 
The worst part of being the Lone Ranger is that there's nobody to tell me I'm being stupic.
The email still goes out, just to a management address.
Sure, probably not the best method ATM, but it's the quick/easy way for "oh, BTW, we needed this in production last week".
 
I assume that management wants that email as it would be sent to a valid address + the "wrong" information, right?
 
right. That way they can hunt down the person/people failing to properly collect info
 
2:08 PM
yea, that makes sense (~sighs in management expectations)
 
yeah... They've got MAs doing data collection. They're smart, just not so much computer smart, and, well, sometimes they slack forget.
OK, thanks guys. MUCH appreciated! Gotta run to a meeting.
 
2:25 PM
Late to the discussion. Sounds like you can use HasValidEmail with a Boolean return that branches into SendEmailToRecipient(…) for the true condition and SendMissingInfoAlertToManager(BuildFieldsForEmailAlert(…)) when false. It’s better describing the expectations for what should/is-about-to occur.
Isolation coding is hard…
Quick to stagnate and you don’t realize it till later.
 
2:41 PM
^
 
3:16 PM
I thought about this some more on the drive in to work. If you have everything in classes already you could write a FooEmailValidator class and tests that go along with it.
This way you can check each condition and confirm you will have the expected results when execution occurs.
Iven.EngageLurkMode();
 
 
8 hours later…
10:51 PM
Have a good weekend, quackbats.
 
11:30 PM
 
11:47 PM
[rubberduck-vba/Rubberduck]: 1363 stars vs. [decalage2/oletools]: 1621 stars
 

« first day (2576 days earlier)      last day (604 days later) »