|
Nice!
I look forward to the article about this...
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
|
|
|
|
|
It's one of those things where coding it is much easier than explaining it. I'll have to whip out my trusty graphviz and throw together some visual diagrams for the article. I think that's where half the work would be.
The other half is cooking up a contrived enough example that's small enough to show how it works without being overwhelming - harder than it sounds since the main use of it is to *avoid* stressing the garbage collector, so it's something where it has to be used a lot to see a difference.
Although I can think of a "hack" using GC.Collect maybe that will force its impact to be felt. I'll have to test.
So much work for something that probably wouldn't make beyond a tip and trick, but I suppose it's helpful to know.
I ran into it clear back in the bad old days of .NET when the GC was choking on something i built and this was before I really understood the principles behind garbage collected environments. Circular references are Bad(TM). The GC will eventually figure them out (i think) if they *both* get orphaned from everything else but it's extra work and i'd have to check to be sure it did that- which i think it does, but again, extra GC bookkeeping under the hood. You really don't want to force that.
By then I was already using Boehm's garbage collector in my C++ ISAPI code (for speed - no string heap fragmentation and i'm a bastard about server performance) but since it was just for strings, and not object models circular references were never an issue.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
what you describe could be the basis of an interesting article.
«One day it will have to be officially admitted that what we have christened reality is an even greater illusion than the world of dreams.» Salvador Dali
|
|
|
|
|
Quote:
Trick the queen heir table into believing in a religious union
Trick - trip
The queen - er
Heir - son
Table - a list
Tripersonalist - somebody who believes in the holy trinity
|
|
|
|
|
OK.
Not a word I am familiar with, but that's no surprise. You are up again Monday - and joy! It's a Theme Week!
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Is a big pile of cats a meowtain?
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
purrfectly feasible. would fit in that category.
Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012
|
|
|
|
|
or if they are un-owned would that be a Feral.
They call me different but the truth is they're all the same!
JaxCoder.com
|
|
|
|
|
is someone who looks for answers stored in the internet a 'clowder?'
... oh wait! that's the answer to the original question.
well good golly miss molly!
... oh wait! that might even be the reason for the question.
just the fax mam, my internet's broken.
|
|
|
|
|
|
|
Or a start!
I, for one, like Roman Numerals.
|
|
|
|
|
Nah, just feeding-time. There's one tuna at the bottom of the meowtain.
Happy I don't have to clean that kitty-litter.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
foo("bar");
does this refer to an invocation of the method foo? or an invocation of the delegate instance referred to by the variable or argument foo?
*headdesk*
C# is massively ambiguous without having type information, so now I get to write a visitor to "patch up" the code dom with type information. So basically i always create these expressions as delegate invocations, but then i have to go back through later and find types, so I can change the right ones to method invocations instead.
I know C family languages require type information to parse (which is unfortunate) but C# takes it to another level. In for a penny, in for a pound I guess.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
honey the codewitch wrote: does this refer to an invocation of the method foo? or an invocation of the delegate instance referred to by the variable or argument foo?
Neither: it means a VB programmer wants to access an array element and forgot where he was.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
lol, i'm glad my c# compiler doesn't see it that way. =)
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
I don't see it that way and I am a VB.NET programmer but also fluent in C#.
It is amazing how many people really view C# as some completely different type of animal than that of VB.NET...
To me, the line of code was calling the method, "foo", with a string parameter...
Steve Naidamast
Sr. Software Engineer
Black Falcon Software, Inc.
blackfalconsoftware@outlook.com
|
|
|
|
|
He is referring to old classic VB, which of course any public function in Module can be called from anywhere.
{}*
|
|
|
|
|
honey the codewitch wrote: does this refer to an invocation of the method foo? or an invocation of the delegate instance referred to by the variable or argument foo?
Yes.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
you get an A
and i get a headache
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
|
# define foo(x) this.GoToThe(x)
|
|
|
|
|
|
Nor does
#define if while
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
#define then {
#define endif }
lets make C really basic so anyone can do it
Edit: more complete
#define IF if (
#define THEN ) {
#define ELSE } else {
#define ENDIF }
this internet has become nothing but fake news.
... time to fix it, time to get back to the fax!
modified 29-Nov-19 12:58pm.
|
|
|
|