Thoughts on C#, Ajax, WCF, LINQ, Agile et al.
Leonardo da Vinci, when he painted Il Cenacolo, or as we call it here in the US, The Last Supper, produced studies for the work before he began to paint. Later, when the painting was restored in the 1970s, researchers used infrared reflectoscopy to look underneath the outer coats of paint to find that the original work of art was in fact very different from what tourists had seen for the past few generations - mostly because of the poor showing conditions for the painting, but partly because Leonardo ......
improve my => 'code' One of the interesting features of Agile development is the regular feedback created by the methodology. Continuous builds, especially when they show graphically when they are broken or have failing unit tests, give Agile teams a sort of self awareness about the health of their project. Many Agile projects even give visual cues regarding the health of the project for instance showing the health of the build through the use of traffic lights (green for good, red for broken). ......
improve my => 'code' Jeff Atwood wrote an interesting post today about Coding Without Comments. If you didn't catch it, he basically says that if a coder uses excellent naming conventions in his code, the code is eminently readable. So the need for comments is obviated. Partly true, I say. But there are significant exceptions to consider. If you have external customers using your code, public methods should have have lots of comments. With summary tags filled so your customer know what the methods ......
improve my => 'code' On weekends, I tend to go off tangent, and this weekend is no exception. I started to read some of the works of Levi-Strauss, the structural anthropologist, and it occurred to me that many of the positive changes from Agile Development are not merely the result of greater business focus. Agile also develops culture in a field that is generally devoid of culture. This can be a stabilizing factor for companies by - Reducing turnover by empowering team members. - Creating rituals, ......
improve my => 'code' I got some responses from a post I made on Saturday, that troubled me. I really think it is important to code to an interface whenever possible - not only to give your application to flexibilty, but to give it testability as well. So I thought I might give you an example. Say I have a class that depends on two other classes I have. In this example, Partitioner depends on SystemIOAdapter and MerchantRecordCounter. jstarr jstarr 2 0 2008-06-23T23:16:00Z 2008-06-23T23:16:00Z ......
improve my => 'code' Wow.... made my first WPF application in seconds flat on Beta 2. Now when you create a button on the form, you can double click it to make it's event handler, and code right in the contents. And even more important, the compilations are lightning fast now... Here's my first application - a Fizz Buzz game (must have beer on the brain). The XAML <Window x:Class="FizzBuzz.Window1" xmlns="http://schemas.micro... xmlns:x="http://schemas.mic... ......
Just downloaded and installed on my machine. It took forever to install... Seriously, I saw this picture without any updates for over twenty minutes on my 2GB RAM machine. Anyway, I can't wait to get me some Silverlight, and maybe spin the tires on WPF (as this version is supposed to be much more stable)... Hopefully I will have some time to share my experiences with you here soon. Happy coding, Jonathan ......
improve my => 'code' I was just reading Jeff Atwood's recent blog article Department of Declaration Redundancy Department He makes the case that writing code without static typing is easier to read, and "Anything that removes redundancy from our code should be aggressively pursued -- up to and including switching languages." My take is "maybe". Say I have a class named Example that implements two interfaces, IFoo and IBar. When I instantiate I have several options when dong so statically. Example ......
Every blogger I read claims to have superior coding skills, and every place I have worked claims only to hire superior developers. In my current position and in my prior one, my employers say they interviewed more than twenty candidates to fill each position. If that's so, where are the average coders? I heard one theory - they are all unemployed! And they keep trying to get jobs but they can't. So interviewers have a skewed sampling of coders. I will confirm that in my current and previous position ......
I have been pretty excited about LINQ, because it seems to do all of the optimization for me for free (kinda like T-SQL). Yow Han-Lee asks in his blog, Brainteaser #11, Given any two large List, what is the quickest way to find the mutual intersection of the two? Now take into consideration memory constraints? Well, the answer that only takes a minute or two for me is the following... Comments welcome! Jonathan Starr using System; using System.Collections.Generic; using System.Linq; using System.Text; ......
improve :my => 'code' I will be posting code examples soon.. But you may not need to wait for my examples to get started as it has really simplified JavaScript development for many. Several lines of code can be written in line most of the time using this library. Here's the link... http://jquery.com/ When you get there, please be sure to check out the many plugins that are available there. (BTW, I have been impressed by Script # from Mr Softie as well... It allows you to write debuggable .NET ......
improve my => 'code' I just started playing around with LINQ seriously, and I really love some of the features incorporated, like the Enumerable.Range() function and how it can be used for integer programming. Here's a simple function for generating lognormal distributions (could be useful for financial engineering). Hope you're enjoying the samples, Jonathan Starr public List<double> GenerateLogNormalDistributi... numberOfTimes, double mean, double standardDeviation) { Random randomGenerator ......
improve my => 'code' The following code (surprise, surprise) compiles. But it does not work as intended (you won't be able to "doSomethingElse()! Can any of you figure out why? (I have my suspicions.) Jonathan Starr using System; namespace test { internal class BaseTest { private int _prop1; public virtual int prop1 { get { return _prop1; } set { _prop1 = value; } } } internal class DerivedTest : BaseTest { public override int prop1 { set { base.prop1 = value; doSomethingElse(); } } } } ......
improve my => 'code' In the latest release of Orcas, one of the new features provided is "Automatic Properties" which allows developers to use a shorthand like the following: public class Person { public string FirstName { get; set; } public string LastName { get; set; } public int Age { get; set; } } and the compiler knows to interpret this as public class Person { private string _firstName; private string _lastName; private int _age; public string FirstName { get { return _firstName; } set { ......
improve my => 'code' Just a quick reminder to the Saint Louis developers out there. There is another Saint Louis .NET User Group meeting on Monday, January 14th at 2 City Place. Details are here in the updated Saint Louis Microsoft Technology calendar. Hope to see you there! Jonathan ......
improve my => 'code' I just read Jeff Atwood's post - Size is the Enemy - and I think his contention that Size => Complexity => Bad Application, is partly true. But not entirely true. How does an application become large in the first place? If an application is successful, and is widely adopted, there is a greater chance that the same application may be reused for more purposes than originally intended. To handle the new use cases, custom code is added and we get code bloat. This may be ......
improve my => 'code' I have always found the essential idea behind the Ship of Theseus interesting. From Wikipedia.org According to Greek legend as reported by Plutarch, “ The ship wherein Theseus and the youth of Athens returned [from Crete] had thirty oars, and was preserved by the Athenians down even to the time of Demetrius Phalereus, for they took away the old planks as they decayed, putting in new and stronger timber in their place, insomuch that this ship became a standing example among ......
improve my => 'code' Okay, I admit it. I don't like to use generation software tools - mostly because I know I can always do it better by hand. Also, cut & paste seems to be the most error prone way to write software - you end up writing everything twice that way. In my latest project, however, the sheer volume I had to write and test in a short period of time had me scrambling to use UltraEdit, Visual Studio Macros, Visual Studio snippets - everything but the proverbial kitchen sink - to ......
improve my => 'code' .. though it is not very well documented. I have found it very useful to expose internal interfaces for unit test projects in order to initialize many types of objects at one time (when they all implement the same interface). Of course, I did not want to switch over the access modifier for the interfaces every time I wanted to run unit tests, so I used the InternalsVisibleAttribute This attribute can also be very useful for types you want to expose to your own assemblies, ......
Apparently people will write compilers for anything... Kudos to the author for exending the CLR for .NET... LOLCODE Compiler Yeah, it's hilarious and hip according to the author... I also say he would be better off without the ALL CAPS coding style ......
Jeff Atwood wrote an interesting article recently Why Does Software Spoil? In the article, he notes that most software becomes bloated with extra features over time to the point of absurdity. I think that one of the most interesting things about software (and computer hardware) sales is the way it differs from other products. The word "New" has always been one of the most powerful words in advertising, but it much more powerful in the software industry. A company that is using MS Access 95 is considered ......