The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.
All developers need to understand what's going on at the machine level so they understand concepts like pointers, heaps and memory allocation/deallocation. Too many younger developers don't understand these basic concepts and the resulting bloated execution environments show this.
A good computer science degree that drills these concepts into its graduates is well worth the time. Unfortunately too many computer science programs gloss over fundamental machine operating concepts.
Yes, which in C# only happens when you're using poorly written libraries.
You should know to call Dispose (and sometimes Close too (except on HttpClients, which you should create using the IHttpClientFactory, which returns them to the pool) (except when the object is still being used by some middle ware, like a file handle when returning a file in ASP.NET) (or when an object's lifetime is handled by another object, such as some use cases of DbCommand, DbDataAdapter, etc. or generated such as controls in WinForms designers) (oh yeah, and also don't call Dispose on most iterators, which you generally shouldn't use directly anyway, but which are only disposable for COM support, which is hardly ever applicable) (also don't call Close or Dispose when they throw a NotImplementedException, which I've seen a couple of times because some interface inherited IDisposable, but the implementation didn't need it)) and that's about it, simple
Even forgetting to explicitly Dispose and/or Close (which are usually synonymous, but not always) will usually result in the resources being released by the garbage collector.
I recently had a leak in Crystal Reports.
Not closing and disposing a report object, even when it's handled by a report viewer, results in too many temp objects, which will ultimately, sometimes, results in an out of memory exception or some such.
(Had a nice debugging session using the WeakReference<T> class to figure out that one )
But that's Crystal Reports and I've had unidentifiable substances under my shoe which were better thought through than Crystal Reports.
Anyway, even knowing all this, all you can really do, and should do, in C#, is call Dispose, which is kind of my point.
You don't even have to know why, just know that you should.
Even when you're a C or C++ pro, you shouldn't use unsafe in C# unless you really have no other choice, and I've always had.
However, when you know what you're doing, you can write articles such as this one, which is nice I suppose: The Dispose(bool disposing) Pattern is Broken[^]
For everyone else, and even for this author, just call Dispose and be done with it.
I read the article this morning and I completely agree with you.
Knowing some CS can give you an edge, but is in no way required.
When my customer calls that their application, written in the 90's, isn't behaving as expected, don't expect to find nice design patterns, data structures or algorithms.
Most of those are already implemented in modern environments anyway.
Also, (premature) optimization, one of the main points of this author, is considered bad practice, I'd rather have fast code that's readable than super fast code (we're talking milliseconds difference here) that's cryptic.
Of course this depends on the context and goal of the application.
"In theory, theory and practice are the same. In practice, they are not." - Albert Einstein
Do you want the Beatles algorithm when saving your password? Or would you prefer a degree?
My point was: there are many talented people out there who don't have a degree. Sadly, there are also many people with a degree, who mistakenly believe they have ability and talent - and who think they are 'better' than those didn't go through higher education.
Eddy Vluggen wrote:
When in a hospital, I'm always glad to see non VB6 software.
All I'm hoping to see, is someone who is great at doing their job. The certificates they have up on the wall won't cure me!
...I got the job!
I am now an EA Game employee, in the Frostbite team!
To celebrate I am going to cook some "bisque de homard" (tomato, cream, wine and lobster french soup )
BTW, while making a code sample for my job application, I used some async enumerable on observable event, and while that might sounds complicated it was, in fact, the sweetest, easiest to read event handling code ever written in the long history of the whole universe!
EA's gained a reputation for a lot more than just being in business to "make money". There's plenty of horror stories where EA's name is used prominently. I understand crunch time, but it should never be the norm.
EA aren't my favourite games company - too many microtransactions needed to play the game you thought you paid for (but only rented a bit of) - but you should be working on some cutting edge stuff!
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
Last Visit: 31-Dec-99 18:00 Last Update: 17-May-22 14:36