.NET and sloppy coding

  • Because it doesn't work that way. Setting your object = nothing is not telling the garbage collector to free the object's memory, it's telling the garbage collector that the object's memory can be freed when the garbage collector gets around to doing a cleanup. That might be immediately, or it might not be. Or at least that's the way I understand it.

    But it doesn't mean you shouldn't still explicitly reelase your objects. I think that's still a good practice, garbage collector or no.

     

  • The moral of the story is don't let your developers run rampant without some training and understanding of the tools they are using.  .NET is a fantastic toolset and timesaver if, by nothing more than the virtue of the 3500 + base classes provided (what a provided feature set!).  Contrary to what someone said earlier, the garbage collector can and should be overridden when necessary.  You can programmatically force garbage collection and should most of the time.  This quote said it all:  "IMHO the garbage collector should be viewed as a safety net, not a crutch."

    I missed exactly what type of bloat the one commentor was referring to when he said he didn't use Interdev because of it.  Does he write non-standard HTML in notepad, etc.?  Other than the two or three lines indicating what generated the skeleton page, I don't see any bloat in my pages.  Btw, Antares686, I wouldn't equate preferring someone who uses Studio's provided tools over hand coding as a sign of poor quality.  As a matter of fact, if you are really taking advantage of all that the Framework has to offer, I'd hazard you need intellisense unless you have a phenomenal memory.  Unless you just blindly drag and drop the presentation tier and go with that raw look, you still have to tweak it.  We use the Studio tools but apply our own style guides and standards.  Trust me, QA is alive and well.

    If you really want to critique your coding efforts in .NET, run FXCop against your code but be prepared to be disappointed in what you thought was flawless coding.  It is brutal in its assessment.  It even shows inconsistencies in Microsoft coding in things as simple naming standards.

    For swjohnson, Yukon is actually playing catch-up in the code embedding arena.  Oracle and DB2 both have Java stored procedures.  That being said, the integration of a lot of the toolsets into Studio are awesome.  DTS in Yukon is head and shoulders above SQL Server 2000 and that is a decent tool in its own right.  The advantage to .NET in Yukon is that it is a better managed environment.

    But, that's just my opinion, I could be wrong...

    ========================

    Oxymoron is not an acne cream for idiots.

  • Sorry if I came across as saying that a person using the WYSIWYG tools for .NET is a poor coder. Heck I would hate to have to hand code a VB forms actual page (altough I did it once for fun). My point is some people and managers are putting too much faith in the GUI dev environment without and checking of the source itself. I love many of the new feature of the MS .NET Visual Studio environment and the boat load of new classes. But I am going to do quite aa bit of code by hand for sure and I will check for left over bloat. The point is don't put all your eggs in one basket. Build and check the source for garbage.

  • The CMS I am using uses JavaScript and has a gc(); command to invoke the garbage collector.

    I haven't got that far into VB.NET yet but I'm sure that there will be something similar.

    The comment in the CMS documentation warns us to be careful of invoking the garbage collector because it is a relatively (note relatively) intensive process.  There are times to trigger it explicitly and there are times to just let it decide to run itself.

    Most of the time we just let it do its stuff.  It is only when there is a large and intensive process that consumes a lot of memory that we manually force garbage collection to free up resources ASAP.


    I'm not worried about embedded code in the database layer.  We have code vetting procedures in place and a big stick with nails in it to enforce them.  A metal ruler over the knuckles is suitable for minor infringements

    As far as I am concerned it is yet another new skill to learn and since I started with a Commodore Pet (with the cash till keyboard and built in cassette drive) I know that there will always be new skills to learn.

    In the past year I have looked at PHP, C#, VB.NET and after a while they all become a bit samey.  How many ways can there be to write a for loop?

     

  • Call me a purist, but I like to keep full control over what I develop. When I started programming using Turbo C (almost forgot the name) there was no such thing as a visual IDE. When these came up, there was a boost in the number of developers. But was there also a boost in quality? I don't think so. Personally I think nowadays it's too easy to *develop* software.

    I'm going to get .Net this year (hopefully soon). Has anyone experience with managed C++ code. Is it worth looking at?

    --
    Frank Kalis
    Microsoft SQL Server MVP
    Webmaster: http://www.insidesql.org/blogs
    My blog: http://www.insidesql.org/blogs/frankkalis/[/url]

  • Frank,

    I had a very brief look at it.

    My thoughts are that one of the reasons for using C++ is its ability to use pointers.  The point about managed code is that it doesn't have pointers.

    Having had a brief look at VB.NET and C#.NET they have a concept called a delegate, which seems to be a pointer to a function. 

    I haven't had time to look for similar functionality in VC++.NET but given that the whole point of the CLS (Common Language Specification) I can't imagine that you don't have that functionality.

Viewing 6 posts - 16 through 20 (of 20 total)

You must be logged in to reply to this topic. Login to reply