If you haven’t heard or read Bruce Schneier on Security I suggest you head over to his blog. He’s a leading expert on all things security and a voice of reason in a mad world. It makes you wonder to what extent the ‘war on terror’ is simply a replacement for the ‘reds under the bed’ of the cold war.
admin
Are C# and VB.NET in Danger of Becoming too Complex for the Average Programmer?
I’ve spoken with several experienced developers in recent weeks, discussing whether the .NET framework’s two main languages, C# and VB.NET, are in danger of becoming too complex for the ‘average’ programmer, or indeed for the average programming task (whatever that might be). While you could argue that complexity is necessary to model complex problems and domains, the continuing abstraction of programming languages does not provide much support for this view. A complex, general purpose programming language will rarely be a good substitute for a domain specific language (generalisation versus specialisation).
Maybe I’m just getting old and my shrinking brain can’t handle all this complexity, but deep down I feel that code should read like prose. I do not want to waste valuable time trying to figure out what a chunk of code is trying to do, it should be apparent almost immediately. Is this unrealistic? Possibly, but the driving force behind the evolution of computer languages has always been to simplify and increasingly shield programmers from the low level implementation details so that they can concentrate on solving higher level business problems.
I have programmed in C/C++ for over 20 years. When I first encountered VB in 92-93, my first thought was that it was a ‘toy’ language designed for non-programmers to write quick and dirty GUI applications. I could not have been more wrong. I did not have the maturity at that time to realise what it represented and its possibilities. It has had a profound effect on the software industry not only in terms of what could be achieved quickly but it also raising the expectations of what could be achieved quickly! VB’s obvious attraction and strength was that it empowered less experienced programmers to achieve results that were previously only within the reach of ‘guru’ programmers. Of course, you still had to delve into the Win32 API to get at some of the more ‘advanced’ features (exemplified by Dan Appleman’s work in this area ).
What made VB so attractive was that it was simpler and much more productive than coding in C/C++. If VB.NET and C# both increase in complexity, is there a reason for having two languages that serve the same purpose? As C# and VB.NET evolve further, will a single generic .NET framework language emerge, or will a ‘new VB’ diverge from C#?
In this terse example on anonymous delegates from Developing for Developers “…, here’s two lines of code that produce a list of all files larger than a given size in a given directory”, it is not immediately obvious what is being performed inside the method even with the previous description (BTW that post at Developing for Developers provides a good introduction to anonymous delegates):
static List<string> GetBigFiles(string directory, int bigLength)
{
List<string> filePaths = new List<string>(Directory.GetFiles(directory));
return filePaths.ConvertAll(File.OpenRead)
.FindAll( delegate(FileStream f){ return f.Length >= bigLength; } )
.ConvertAll<string>( delegate(FileStream f){ return f.Name; } );
}
OK, this is a hand-picked, contrived example and not even the most efficient way to accomplish this. You could break this down into separate lines, but the point is the language is enabling, perhaps even encouraging us to write hard to understand (and therefore maintain) code. This reminds me a little of ‘dense’ C code! [In fact, this issue has recently been addressed in C# 3.0 using Lambda Expressions…]
You could argue that less experienced programmers will simply not use the new, more complex features of the language(s), but experience would suggest otherwise.
Please don’t misunderstand me: these powerful language features obviously have their uses. I’m just intrigued about the direction these two languages are taking. With power comes complexity, and with it also the possibility of subtle, hard to understand bugs.
Is there a need for a ‘new VB’?
Does .NET Rock?
I had to maintain some fairly straight forward pre-.NET C++ code today. It really made me appreciate the .Net Framework! I was experimenting with a few performance ideas and spent an hour researching why it wouldn’t compile (a conflict between STL library and MFC) which could only be fixed by moving an include into “stdafx.h” to precede all others, then another involved solving a linking problem caused by the common runtime library conflicting with the statically linked MFC library, which required an explicit library link order to be defined!
.NET really does rock!
More comments on “Why Vista ?”
Several MVPs have been talking about why Vista will or won’t achieve early widespread adoption and the underlying reasons: Why Vista?, Vista and Cars, Ford Falcon or Plymouth Fury – Is Vista good enough to sell?
I like playing Devils Advocate! As I mentioned in my reply to Darren’s post, I see Vista as overwhelmingly more important for developers than end users in the short term. I agree that applications maketh the OS (isn’t that always true?). End users want new features when they make their life easier (after factoring in the pain of any re-learning process)
Being able to blog from within Office 2007 is great for people who have a blog, but does the average user care? No, of course they don’t. Where are the adaptive applications that learn a user’s habits? That adapt to specific behaviour (not quite the same as annoyingly hiding infrequently used menu items!). If you give users software that feels like ‘it cares’ about the user you get ‘buy-in’ and a higher tolerance for change from them.
Here’s an idea: build in the ‘Adaptive Decisions Widget’ that keeps a track of all (revertable) decisions that the OS and Applications make on my behalf, for instance if I consistently reply X times to the same question, ask me if I’d rather not be asked, and store a decision if one is made. It’s a bit like Alan Cooper’s design ethic: don’t ask me to confirm a delete action, just peform the action but make it un-doable. Give me a warm fuzzy glow, instead of a resigned sigh!
Mitch Denny wrote:
>>”What operating system upgrades do is set a baseline which can shorthand
>>discussions, for example, because I know that Vista is going to ship with WPF, WCF >>and WF I can simply say “you must be running Windows Vista to run this software”.”
I not even sure that will be true: what about new versions of the framework? (we’ve had two versions in this XP iteration). We have even seen people in the ausdot stanski list saying that they had to stick with 1.1 of the .Net framework, due to the inability to get 2.0 installed (due to its size). Even if it is true, I still think it directly benefits developers of new software more than end users. If you write a new application and want to maximise your target market and profits, you do not force users to have the latest OS and nothing else!
Inside many organisations, the main (even single) driving force for developing browser based applications is the zero intsall footprint. Having gone down that path, there seems little incentive for such organisations to swap to vista so that you can re-write all your web apps to run as windows forms taking advantage of WPF, WF, WCF, WWF.
There are a heck of a lot of large organisations still running Windows 2000!
I lay down a challenge: name a reason why an average office worker will be better off with Vista! (I’m not saying there aren’t any, just curious that’s all…I wonder what the official marketing line is?)
PhotoSynth
Microsoft Live Labs have recently released details of PhotoSynth, an application that takes photo collections, automatically figures out how they relate to each other, and seamlessly stitches them together into a navigable 3D space. I was intrigued because a friend has been working on a similar concept for a several years.
Coding Horror!
I need one of these … for code reviews!
SQL Server Performance Tuning Resources
Here is a short list of resources for SQL Server performance tuning:
A good place to start is the excellent web site: http://www.sql-server-performance.com/
It covers basics and more advanced issues both from the DBA and developer points of view. Very readable.
SQL Team often has articles relating to performance.
Greg Linwood’s blog is a mine of information on performance tuning: for instance this article on Query Plan Guides (SQL Server 2005 only). Greg gave a great introduction to performance tuning a few months ago in Perth: the slide deck is here.
The SQL Server Query Optimisation Team also has an excellent blog, with articles like this one on Automated Auto-Indexing.
Ken Henderson’s SQL blog is here. Bart Duncan started blogging just recently, he is a recognised master. His weblog is here
Also check out webcasts by Kimberley Tripp, Bob Beauchemin and Bill Graziano to name a few. The main webcast events page is here. There is a whole section devoted to SQL Server here. There are more to watch than I can find time! These are a remarkable free resource.
There are some great books available:
SQL Server Performance Tuning Distilled by Sajal Dam is a good nuts and bolts introduction with examples.
SQL Tuning by Dan Tow is excellent but takes a bit of work to get your head around. Applicable to Oracle and many other databases.
The Guru’s Guide to SQL Server Architecture and Internals by Ken Henderson. Very thorough treatment of what’s under the hood. Not directly related to solving a particular performance problem but if you want to understand how the internals affect the layers above this book covers it in great detail.
SQL Express/MSDE Does Not have a 5 Concurrent User Limit
I came across a post on Euan Garden’s BLOG regarding the 5 concurrent user limit on SQL Express; it doesn’t have one!
When will we support Rongo-Rongo?
I just read a very funny anecdote over at Michael Kaplan‘s blog titled “When will we support Rongo-Rongo?” and just had to mention it!
Free Download: Microsoft MSDN Library May 2006
Microsoft has released the MSDN Library May 2006 Edition as a free download. The MSDN Library was previously only available for download to MSDN subscribers, so if you don’t have an MSDN subscription this is great free documentation. Future editions will be available as they are released:
MSDN Library provides access to essential programming information, including
technical white papers, software development kits and code samples necessary to
develop web services and applications. This is an updated version of the MSDN
Library for Visual Studio® 2005