News Archives 
   
(click month to expand)
  

Recent Technology News Stories

Solentive News
Visual Studio 2005: Cool Debugging Tricks  [click for more...]

some useful debugging techniques for developer productivity By Peter Bromberg.

http://www.eggheadcafe.com/tutorials/aspnet/1e7daccd-ed00-4a35-a2ed-92fb0ad72bec/visual-studio-2005-cool.aspx

6/12/2007   [Link]
Removing dead code  [click for more...]

Ambulance_Stretcher What does your code terrain look like?  Are there bodies of dead logic lying here and there?  Maybe they helped briefly while you worked towards a better solution or perhaps they just fell victim to changing business rules.

At a recent Code Camp, there was a question about code generation and I answered that we (as developers) are required to love every line of code (it drew a laugh from many).  But love isn't cheap ... it takes time, care and hard work.  Therefore we should only love and care for the lines of code that we absolutely need.  Anything not being used should be removed.

 

 

 

 

 

What excuses are there to keep unused code?

  • We may need it in the future
    • The classic argument - the typical agile response being YAGNI
    • Keeping it in the code-base takes maintenance in the form of understanding it, updating associated tests and working around it to add other functionality.
    • It will always remain in source control should we ever need it again
  • If it ain't broke, don't fix it.
    • Bob Martin sums this up well when he defines what "broke" means:  Code should 1) work 2) be maintainable and 3) communicate its intent.  Clearly dead code violates 2 and 3.
    • This idea also defeats the goal of loving every line of code - leaving something alone for no good reason is neglect.

I just spent a good half hour cleaning up some code and mostly removing unused code.  It was annoying since it wasn't even being used but at least I am happier with the code now.  A good tool when investigating code you suspect may be dead is ALT-F7 using Jetbrains Resharper - you can easily find all usages of a method or class even in large code-bases.  A cheap alternative is to use "lean on the compiler" (as discussed by Michael Feathers) - this is simply changing a class name or method name by one character and try to compile (the compiler will then let you know what is depending on that code).

Jonathan Cogley is the CEO and founder of Thycotic Software, a .NET consulting company and ISV in Washington DC.  Our product, Secret Server is a enterprise password manager system for teams to secure their passwords.  Is your team still storing passwords in Excel?

6/12/2007   [Link]
New Article: Create Rich Web Apps with AJAX  [click for more...]

I recently finished up a new article for Visual Studio Magazine that's now online for those that are interested.  It discusses how to integrate ASP.NET AJAX with back-end Web Services including Amazon.com's e-commerce service.  Read the article at the link below:

http://visualstudiomagazine.com/features/article.aspx?editorialsid=2374

Those interested in Silverlight can follow my Silverlight programming article series here.

6/12/2007   [Link]
Congrats to Faisal on his new role on the ADO.NET team  [click for more...]

My good buddy Faisal has moved from MSBuild to ADO.NET. Specifically, he's the Program Manager for LINQ to SQL and the Object Service for Entity Framework. He says you'll hear a lot more from him on these things, but of course if past history is any indication his blogging will be short lived :)

Either way, I'm still waiting for him to convince me why I should LINQ instead of SubSonic. The only issue we're really having now with SubSonic is with the JOIN story, and they're supposedly prototyping stuff to address this in the next build.

6/12/2007   [Link]
AJAX Control Toolkit Controls Grayed Out - HOW TO FIX  [click for more...]

a nice post by Bill Evjen about how to fix the disappearing of AJAX control Toolkit controls from toolbox when using them with Visual Studio 2008.

read it at Bill Evjen's Blog

6/12/2007   [Link]
2,5 ≠ 2,500  [click for more...]

Over in the microsoft.public.dotnet.internationalization newsgroup, Marcel asks:

Hi NG!
I have a little question about the localization of a double.

If I use the CultureInfo "en-US" I have the following behavior:

1.) If I enter the value 2.5 into a textbox the double.Parse(text1.Text) returns 2.5 as expected.
2.) If I enter the value 2,5 into a textbox the double.Parse(text1.Text) returns 25...why 25 and not 2500. The , is the group-separator.

Is it possible to ignore these behavior to ensure the 2,5 and 2.5 will always be interpreted as 2.5 (like in the calculator) ? Or do I have to implement this behavior by my self?

Regards
Marcel

Unfortunately, there is no way to do this within the .NET Framework. There is only one decimal separator. And the grouping separator is treated as an ignorable thing, without it having zeroes added aiutomatically....

And applications like the Windows calculator are doing what they do all by themselves.

Though it is worth considering what you would want an application to do with strings like:

1,234,567,890.123

1.234.567.890,123

Noting of course that the Windows calculator does not do much that one might expect in many different cases.

When one writes a parser, one should definitely keep the weird cases in mind....

 

This post brought to you by . (U+002e, aka FULL STOP)

6/12/2007   [Link]
New .NET Framework namespaces and types in French  [click for more...]
We now have a French language version of the .NET Framework namespaces and types poster available for download ....(read more)
6/12/2007   [Link]
Volta  [click for more...]

I have wondered for around 6 or so months now when the first CTP of Volta would be released and it seems that today is that day!

http://labs.live.com/volta

I have not yet looked at the bits but other than providing a nicer way to build web apps, Volta also has a compiler that compiles down to JS or MSIL.  You can probably target one or the other explicitly, but the beauty of Volta is that if the runtime detects a CLR on the users machine then it will gen MSIL and get all the performance benefits, etc etc, otherwise it will compile (or maybe translate) to JavaScript (cross browser of course).

Like I said I've not tried it, but its a very interesting approach - I believe that this CTP only works with VS 2008 RTM not past betas...I think.

6/12/2007   [Link]
Linq to SQL with VS 2008 and MOSS  [click for more...]
So here's my current plan for firing up these new technologies. As background, I gave a 15 minute presentation at a user group last night on the generalities of data abstraction and although I think I did ok, I also think that there are a lot more questions than answers in the developer community right now with regard to how to get data back into SQL Server through Linq. I'm going to start out doing just Linq as I think its a little deeper than EF and more appropriate as a starting point. I also...(read more)
6/12/2007   [Link]
Copyright © 2007 Solentive | Disclaimer | Contact | Home