What happens if you link to a js file twice in your page?
Here is a contrived example.
Notice that we are including bad-example.js twice. Do modern browsers somehow realize they loaded this file already and skip this? Not yet, as we’ll see!
Imagine bad-example.js had this code in it. Continue reading
Do you think you need a Window’s app for your next project? Here’s a thought: No you don’t.
Let me give you one less reason choose the rocky-road of desktop apps today. You’ll hear people tell you that if you build applications for business users (so-called LOB apps) that are input heavy or have complex navigation, your only choice is to build a Windows application.
Why? Because your power users will want hot-keys. They don’t want to use the mouse and navigation and all that stuff that makes the web less usable. They’ll just want to hit a few keystrokes and jump from place to place and do that quick look-up or data entry.
If you haven’t looked carefully around the web lately, here’s a revelation:
Real web apps have hot-keys too.
So you’re ready to start that new and ambitious ASP.NET MVC project. Maybe you’re kicking off a new startup or just finally moving that old-and-crusty webforms project into modern development world. Either way, here are a few very simple things you can do immediately after creating that new MVC project that you will thank yourself for as your project grows in complexity.
1. First of all, even MVC 3 has old-and-crusty aspects lurking in its projects. There are old MicrosoftMvc*.js AJAX and validation libraries that have be replaced with new jQuery hotness. These *.js files aren’t used so just delete them.
2. Many of the dependencies of your MVC project are out-of-date as soon as you create your project. You have an old version of jQuery, Entity Framework, etc. Luckily Phil Haack and crew had the brilliant insight to link these to NuGet. So the next thing you do is just run NuGet and choose the Updates tab.
While ASP.NET MVC promotes clean separation-of-concerns for your web applications, there are some short comings. A problem you’ll run into on large ASP.NET MVC projects is the Views section of your web application becomes completely crowded with hundreds or thousands of files.
Usually, these view files are organized into sections by controller which keeps this manageable. For example, your solution might look like:
In Part 1 of my Building a Cloud OS for .NET Developers series, I talked about setting up a pure cloud OS focused on developers. But the one crucial aspect I left out was the developer tools.
In this second installment, we’ll be covering exactly that. How do we manage having Visual Studio and associated tools and servers universally accessible in the cloud, even on mobile devices such as iPads?
Let’s talk about cloud operating systems. This article explores the options and potential of moving entirely “To The Cloud” for developers who normally demand significant offline power from their applications (IDEs, compilers, debuggers, etc). We’ll focus on .NET / Visual Studio developers, but I’m sure you can adapt this to your technology of choice.
I’ve been fascinated with what Google is doing with Chrome OS. I think finding a way to fully “live in the cloud” has a lot of promise. However, in practice Chrome OS is entirely unappealing to me. It’s just a single browser window, maximized. Yuck. I don’t mind doing most things in the browser, but I’d like multiple non-maximized browser windows and a desktop to organize things like shortcuts. That’s OK though because Chromebooks aren’t the only option. We have decent operating systems right now that can function largely in the same way if we set them up with discipline.
So maybe I’m late to the party, but I recently started playing with NuGet. It’s a killer new way to find, install, maintain, and manage references to open source libraries in Visual Studio 2010. Plenty of people have written about it (Phil Haack and Scott Hanselman for example). Let’s just say you should learn about NuGet if you don’t know it already.
What I want to talk about is all the cool open source projects I found just by flipping through the pages of the NuGet directory in the Visual Studio “Add Library Package Reference” dialog.
This article is a follow up one I wrote last week entitled “The NoSQL Movement, LINQ, and MongoDB – Oh My!”. In that article I introduced the NoSQL movement, MongoDB, and showed you how to program against it in .NET using LINQ and NoRM. You can also watch my conference presentation at MongoDB Seattle 2011 or this DevelopMentor webcast.
I highlighted two cornerstone reasons why you might ditch your SQL Server for the NoSQL world of MongoDB. Those were
1. Ease-of-use and deployment
For ease-of-use, you’ll want to read the original article.
This article is about the performance argument for MongoDB over SQL Server (or MySql or Oracle). In the first article, I threw out a potentially controversial graph showing MongoDB performing 100 *times* better than SQL Server for inserts.
“A potentially controversial graph showing MongoDB performing 100 times better than SQL Server”
We’ll see source code, downloadable and executable examples and you can verify all of this for yourselves. But first, here’s a new twist on an old proverb:
“Data is money”
I recently wrote an article for DevelopMentor‘s Developments newsletter entitled Building a Twitter Application in .NET. You can read it at the DevelopMentor website:
I’ve republished here for my readers. Enjoy!
Building a Twitter Application in .NET
by Michael Kennedy (@mkennedy)
Twitter has become one of the web’s hottest properties. It is a central part of mainstream news programs such as CNN’s Anderson Cooper 360, congressional debates, and talk shows. In fact, it grew at a rate of 1400% this past year [bit.ly/jG9BG].
If your company wants to interact with your customers in a modern and engaging experience, you need to be on Twitter. In fact, if you have customers that really like or dislike you, they are probably talking about you on Twitter. You should be part of that conversation.
In this article, we will explore how to build a rich interactive experience on Twitter that goes beyond just creating a new Twitter account. We will build a .NET application that uses the Twitter API (a free service) alongside other cool technologies such as the WCF REST Starter Kit [http://bit.ly/v8mBb] and LINQ to fully leverage the Twitter experience.
This post describes a unit testing library for testing Windows Workflow Foundations.It is not a framework like HarnessIt, NUnit, or MsTest. Rather it’s a library that can be used in conjunction with any of these testing frameworks.
Download the library with sample test project here:
Kennedy.WorkflowTesting.zip (216 KB)
You can also just jump to the code.
First a Little History:
Last September I posted this teaser entitled Unit Testing Coming to a Workflow Near You. My intention was to post this article that you’re reading now shortly thereafter when I got some free time to polish things up. In that previous post, I highlighted what I could determine to be the current state-of-the-art with regard to unit testing workflows, circa September 2008.
I’m pleased to announce that MSDN Magazine just published my Windows Workflow article entitled
“ASP.NET WORKFLOW: Web Apps That Support Long-Running Operations”
I hope you find it useful and interesting.
[Update: See the follow up post "Significant Advances in Unit Testing Windows Workflow"]
If you’ve been working with Windows Workflow, you’ll find it has some cool features for orchestration, long running operations, state machines, etc.
However you won’t find very much support for Test Driven Development (TDD) or unit testing in general. In fact the architecture that makes Windows Workflow powerful (strict separation of workflow, activities, and the host for example) really gets in the way of unit tests.
There has been some work done on unit testing Windows Workflows. Here’s some links:
These are all very creative solutions. But, personally I find all of them more complex than they need to be. So in the near future I’ll be putting together some libraries and samples on unit testing Windows Workflow. I think you’ll find them far more powerful and at the same time simpler than anything out there.
So until I get that finished, if you have any feedback or considerations on unit testing Windows Workflow I’d love to hear it. If there are other articles I’m missing, please post them in the comments.
I think you’re going to like this…
I recently wrote up an overview of the new ASP.NET MVC Framework for the Developments newsletter.
I encourage you to read it on the DevelopMentor website. It’s an interesting programming model.