_ideas(old)

moved to CodeBetter.Click here

<August 2008>
SuMoTuWeThFrSa
272829303112
3456789
10111213141516
17181920212223
24252627282930
31123456


Navigation

Subscriptions

Post Categories



Why should i use .net

Yesterday, I was asked to train a set of freshers on what .net Fx provides, about CLR, and other things .net. About half-way through the second session, when I was delightfully talking about Garbage Collections and Finalization Queues (after a class on telling them the brokerage mechanisms, Virtual Machines, what was wrong with previous frameworks, what Java brought into picture, and now what .net has helped us with), one guy says 'Why should I use .net?'.

I took around half-an-hour to tell the guys why would one, poking into topics like drivers, winforms, html engines ( the Framework class library reuse was what I was talking about) and why shouldn't we be writing them and be worried about our program logic. Then I went over to Component Based Programming, COM, managed memory etc. Still confused.

Problem ? Yes, the guys have never ever coded commercially. They are great at writing algos in C, math, but they have never written one piece of code that somebody else has used. I cannot blame it on the education system, because I came out of it once, fortunately for me, there was some time with C at college writing GSM algos, and at work Delphi/people who had worked with it, to know what a relief Java/.net is.

But these guys dont even know what a customer would expect from their output. They wouldn't think twice before writing their own spell-checker component(would take more than a man-month) insted of reusing the one that comes with Office (would take an hour). They don't know the pains of memory management, using C to create a form etc. I just wanted to nullify the current training session, and start the whole process something like this-

1. Ask them what do they expect from a mail client. Show them Outlook, and ask them if they wanted something more from it. Before teaching them how to code, this will atleast lead to these guys knowing things from a customer's perspective.

2. Ask them to write a simple Outlook sidebar control using C (which they are good at) , after a day or two, cut-short their development, and show them how to do this with Devexpress or Infragistics in a minute or two. Mind that freshers get attracted to UI invariably. Thats the only experience that I have in this process.

3. Give them a component after this, written in VC++, and ask them to use it in VB without using COM, make them appreciate COM, and then wreck the ship after telling them how better an upgrade .Net is. (Don Box, 1st Chapter)

4. In any of these cycles, show them a menory management issue and tell them about managed environment.

 After attracting these guys to (if i am able to) I would basically move away, and let them explore, with an assignment to implement some Data Structures etc. for a week. So a two week pre-training schedule is what I was looking at. Costly, but then I dont know about a book that will make them understand "why to use .net?'. Can you point me to some, so that we can cut-short this fortnight long build-up?

Also, this is probably my last post here , moving over to http://codebetter.com/blogs/ranjan.sakalley
I hope you guys come and visit the great community we have at CodeBetter
Thanks Donny for providing me the space here. Thanks Brendon for providing me the new space.

Adios,

Ranjan

posted Thursday, February 24, 2005 5:03 AM by runjan

NUnit and automatic method input parameter verification

Almost all methods depend on one or more input parameters. To verify each and every one of these parameters, for boundary conditions, nulls and such generic cases, becomes an overload, for each method in a class. It also leads to writing repetitive test cases to check the same type of an input parameter. For example, consider the following method 
 

        public int FirstCheck(int first, int second)
        {
            
return first + second;
        }

 

To check both the integer variables for boundary conditions, negative values etc. using NUnit would require writing repeated test cases for each one of these variables. Similarly with strings, Dates and other value types. For reference types, a test for nulls is required. Writing test cases becomes a tedious task, and therefore a developer, may miss these cases. To solve this problem, I have tried to create an attribute to add to the existing ones in NUnit, which can be placed over a class. The NUnit core identifies this attribute, and redirects it to a custom test case builder which is added to create and run test cases for boundary values for value types, and nulls for reference types. An input to this attribute is an exception type, which is the expected exception when the test fails. Lets consider an example,

 

[TestParams(typeof(InvalidOperationException))]
    
public class TestParamsTester
    {
        
public int FirstCheck(int first, int second)
        {
            
return first + second;
        }

        
public string SecondCheck(int first,int second)
        {
            
return first.ToString() + second.ToString() ;
        }
    }

 

The attribute placed over the class implies that NUnit should test each and every parameter for all methods in this class. Also, when a test fails, NUnit expects an InvalidOperationException. When the class is loaded using NUnit (for better understanding, the NUnit-GUI is used here), the methods are added as test cases

 


 

 

When the test cases are run, we get the following results

 


 

With such a functionality provided by NUnit itself, a user does not need to use any new software to do such an automatic verification (just changing 2 dll's would enable NUnit to support this functionality). I am currently extending this verification process to have a user specify custom boundaries and cases using an XML file. Also, instead of creating one test case per method, all boundaries have a separate test case, for the end-user to immediately identify the failing verification.

What do you think of this idea?

posted Monday, February 21, 2005 12:41 AM by runjan

Developing a multi-template website.
This page has been moved to CodeBetter.Com. Please update your links accordingly. The new post URL is: http://codebetter.com/blogs/ranjan.sakalley/archive/2005/02/10/53286.aspx

posted Thursday, February 10, 2005 12:13 AM by runjan

NUnit, private methods and partial types
This page has been moved to CodeBetter.Com. Please update your links accordingly. The new post URL is: http://codebetter.com/blogs/ranjan.sakalley/archive/2005/02/03/50940.aspx

posted Thursday, February 03, 2005 12:37 PM by runjan

partial types revisited
This page has been moved to CodeBetter.Com. Please update your links accordingly. The new post URL is: http://codebetter.com/blogs/ranjan.sakalley/archive/2005/02/02/50280.aspx

posted Wednesday, February 02, 2005 6:20 AM by runjan

On partial types in C# 2.0, and other redundancies
This page has been moved to CodeBetter.Com. Please update your links accordingly. The new post URL is: http://codebetter.com/blogs/ranjan.sakalley/archive/2005/02/01/49568.aspx

posted Tuesday, February 01, 2005 12:57 AM by runjan

SQL stored procedure to truncate all user data tables in a database
This page has been moved to CodeBetter.Com. Please update your links accordingly. The new post URL is: http://codebetter.com/blogs/ranjan.sakalley/archive/2005/01/29/48963.aspx

posted Saturday, January 29, 2005 3:18 AM by runjan

Suppress serialization of a public property
This page has been moved to CodeBetter.Com. Please update your links accordingly. The new post URL is: http://codebetter.com/blogs/ranjan.sakalley/archive/2005/01/28/48856.aspx

posted Friday, January 28, 2005 5:37 AM by runjan

40tude Dialog
This page has been moved to CodeBetter.Com. Please update your links accordingly. The new post URL is: http://codebetter.com/blogs/ranjan.sakalley/archive/2005/01/27/48817.aspx

posted Thursday, January 27, 2005 9:20 PM by runjan

"as" or "is" for decision making
This page has been moved to CodeBetter.Com. Please update your links accordingly. The new post URL is: http://codebetter.com/blogs/ranjan.sakalley/archive/2005/01/24/47964.aspx

posted Monday, January 24, 2005 7:40 AM by runjan

Get IP Addresses of all machines in your network
This page has been moved to CodeBetter.Com. Please update your links accordingly. The new post URL is: http://codebetter.com/blogs/ranjan.sakalley/archive/2005/01/21/46880.aspx

posted Friday, January 21, 2005 1:46 AM by runjan

Algorithmic and Heuristic approaches towards software development
This page has been moved to CodeBetter.Com. Please update your links accordingly. The new post URL is: http://codebetter.com/blogs/ranjan.sakalley/archive/2005/01/20/46490.aspx

posted Thursday, January 20, 2005 3:05 AM by runjan

Nullable Types in 2.0 and Serialization
This page has been moved to CodeBetter.Com. Please update your links accordingly. The new post URL is: http://codebetter.com/blogs/ranjan.sakalley/archive/2005/01/07/42249.aspx

posted Friday, January 07, 2005 1:01 AM by runjan

When you manage an off shore project......
This page has been moved to CodeBetter.Com. Please update your links accordingly. The new post URL is: http://codebetter.com/blogs/ranjan.sakalley/archive/2005/01/06/42022.aspx

posted Thursday, January 06, 2005 9:12 AM by runjan

Convert numbers to text
This page has been moved to CodeBetter.Com. Please update your links accordingly. The new post URL is: http://codebetter.com/blogs/ranjan.sakalley/archive/2005/01/05/41854.aspx

posted Wednesday, January 05, 2005 11:04 PM by runjan

Change the Positive Testing style.
This page has been moved to CodeBetter.Com. Please update your links accordingly. The new post URL is: http://codebetter.com/blogs/ranjan.sakalley/archive/2005/01/05/41850.aspx

posted Wednesday, January 05, 2005 10:56 PM by runjan

Speed up your lousy data reads
This page has been moved to CodeBetter.Com. Please update your links accordingly. The new post URL is: http://codebetter.com/blogs/ranjan.sakalley/archive/2005/01/05/41849.aspx

posted Wednesday, January 05, 2005 10:50 PM by runjan

VS.NET Wizard mayhem
This page has been moved to CodeBetter.Com. Please update your links accordingly. The new post URL is: http://codebetter.com/blogs/ranjan.sakalley/archive/2005/01/05/41848.aspx

posted Wednesday, January 05, 2005 10:49 PM by runjan




Powered by Dot Net Junkies, by Telligent Systems