|
Very sweet. Please send this Suggestion to MS
modified 19-Jan-21 21:04pm.
|
|
|
|
|
Interesting idea for an extension. How would you suggest it to look like?
Now with Roslyn it shouldn't be so hard to write an analyzer that nags you if you forget to call Close/Dispose (or suggest a refactoring to a using-block) on IDisposable types (maybe something like that already exists?)
|
|
|
|
|
FIorian Schneidereit wrote: it shouldn't be so hard I'm guessing it's harder than you think.
Sure, if the disposable exists in small scope, but what if it is, for example, the return value of a function or contained in a closure?
Determining the scope and lifetime of a variable can be pretty tricky.
|
|
|
|
|
Found something here[^]. It's at least smart enough to ignore disposables returned from methods.
|
|
|
|
|
That looks promising.
So why aren't you writing this extension yet?
|
|
|
|
|
Give him an inch and he'll take a mile.
|
|
|
|
|
We build commercial ink-jet printing systems. My app is the UI for the control software, written in C#/WPF. Like you, I initially missed deterministic destructors in C#. After a while, I learned to not miss them.
When my app started consuming large amounts of memory when left running for long periods of time (several days), I missed it again. A lot.
With the help of SciTech's .NET Memory Profiler, I managed to get the memory problem under control through a couple of large changes and thousands of small ones. I discovered a couple anti-patterns in my coding style I fixed, but in the end a lot of them amounted to implementing deterministic destructors that ensure dangling references are released.
It was probably the most frustrating and annoying six weeks I've spent since I started with C#, .NET, and WPF - and that includes the learning curve for WPF.
Software Zen: delete this;
|
|
|
|
|
In general, I would agree. I don't like this attitude of having resources hang around until the GC, in its infinite wisdom, decides to collect the garbage.
On the other hand, writing exception-safe classes is a non-trivial task, which may be beyond the abilities/knowledge of many programmers. In my experience, most programmers in C++ ignore the possibilities of exceptions; some attempt to handle them, but poorly; only a vanishingly small group write correct, efficient, exception-safe code.
If you have an important point to make, don't try to be subtle or clever. Use a pile driver. Hit the point once. Then come back and hit it again. Then hit it a third time - a tremendous whack.
--Winston Churchill
modified 6-Sep-15 4:18am.
|
|
|
|
|
Quote: writing exception-safe classes is a non-trivial task
You are very very right. After 30 years programming I still fight sometimes (always? ) on this.
modified 19-Jan-21 21:04pm.
|
|
|
|
|
Yes! Dispose is such a stupid hack -- the ability to blow the brains out of an object and still leave a valid shell around to cause problems.. who needs that.
We can program with only 1's, but if all you've got are zeros, you've got nothing.
|
|
|
|
|
Does anyone know the name of the font used in the Bureau Veritas Logo ?
I'm talking about the white text in the burgandy rectangle which also has an oval emblem overlay LIKE THIS[^]
Better yet, can someone point me to that same logo in a Scalable Vector Graphics (SVG) format ?
I'm trying to place it, by itself, without a white rectangular frame, on a presentation.
The oval overlay, as an SVG file, would be helpful itself.
Ten or Twenty clicks at their website, plus another five searches with Google, find me lots of PNG files with the logo in a white rectangle. No. Wrong. I already have that. I want it in SVG, just the burgandy rectangle and the oval emblem overlaying it.
Thanks if anyone knows.
|
|
|
|
|
if ever I needed something like this I used to go to the sales and or marketing departments - they were the 'keepers of the official logos' for all paraphernalia, ie sending to the printers for official documents - so, if you/they have an official sales/marketing/media dept they'll likely supply you with the logo
|
|
|
|
|
|
OriginalGriff Beat the C-P-User-3 by 7 hours !
Well, almost.
That logo does not fit nicely on the page I'm making.
I finally found it, HERE[^].
Hey Google, watch out, Bing is learning a thing or two about humans and language.
|
|
|
|
|
704 (32 X (75-53)) cats are getting fired tomorrow. What will they end up doing?
|
|
|
|
|
What the he-double-toothpicks is with you and posting things like this?
What do you get when you cross a joke with a rhetorical question?
The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism.
Do questions with multiple question marks annoy you???
|
|
|
|
|
It's a riddle of sorts; I'm sure somebody gets it.
|
|
|
|
|
|
|
|
They will be picked up by teams to cover players lost to injuries.
Dave
|
|
|
|
|
Some will; many will end up on Practice Squads, and eventually find their way on to some team's 53.
const int COUNT_NFL_TEAMS = 32;
const int PRECUT_PLAYER_COUNT = 75;
const int POST_CUT_PLAYER_COUNT = 53;
function int getCutCount() {
return COUNT_NFL_TEAMS * (PRECUT_PLAYER_COUNT - POST_CUT_PLAYER_COUNT);
}
int playersCut = getCutCount();
|
|
|
|
|
LOL![^]
What do you get when you cross a joke with a rhetorical question?
The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism.
Do questions with multiple question marks annoy you???
|
|
|
|
|
That was funny. Not just because I have children.
|
|
|
|
|
Not my mom luckily
It did get that William Tell Overture stuck in my head though...
|
|
|
|