Just Talking
Must Have NuGet Packages
2I am loving NuGet, and as it matures it just becomes more of a paradigm shift. How do you program without this thing? What was development like before it? So what are NuGet packages I am usually including in my projects. Here is a list of the them below, in no particular order.
- Depot (Common Caching)
- Dynamic Expression API (LINQ Extensions)
- ELMAH on XML (Error Logging)
- FileDB (a leap in storing files)
- SimpleMembership
- ValueInjecter
- WebActivator
- RhinoETL
- FluentMigrator
- RestfulRouting
- JQuery
- FluentValidation
- Entity Framework Code First
- NUnit
- Moq
- WaTin
- RestSharp
- MvcFlash (yes I am bias
)
Great respect goes out to these projects and their contributors, except MvcFlash cause I don’t want to strain my arm patting myself on the back
.
Update: How could I forget about MvcMailer.
Get a VS2010 Ultimate Experience for Less
3As of writing this blog post, there are thousands of developers converging in Las Vegas for the official release of Visual Studio 2010. I’ve been using Visual Studio 2010 for the a while now and it has been a generally positive experience. While as was exploring the VS2010 site I saw this question posed. “What Edition is Right for Me?” That prompted me to look through the editions. Microsoft has planned to sell for commercial versions: Professional, Premium, Ultimate, and Test Professional. A much smaller selection that the VS2008 editions, but that is a good thing. What shocked me was the outrageous price jump from Professional to Ultimate, from $799 to $11,899; that is over $11,000 difference for one copy of Visual Studio. So this blog post is to show you how to get an Ultimate experience for less, so that you can utilize that extra money for pizza and beers for you development staff.
1.) Visual Studio Professional ($799)
you are going to need this right? So what is missing from Professional that is in Ultimate?
- Intellitrace (Historical Debugger)
- Static Code Analysis
- Code Metrics
- Profiling
a.) Intellitrace ( $0 no alternative )
sadly I couldn’t find something that replaced this feature. It is very cool. Look at it this way though, the fact that Microsoft moved it up to the premium edition makes me think that they feel the common developer probably doesn’t need it. I also rarely used this feature in my own development.
b.)Static Code Analysis & Code Metrics ($410)
so what is static code analysis? Wikipedia defines it as the analysis of computer software that is performed without actually executing programs built from that software. Hmm… this sounds familiar, I think I’ve done that before. Oh wait I have! NDepend is a great static analysis tool that has been around for a while now.
c.) Profiling ( $0 – $500 )
There are a ton of profilers for the .Net framework, and some of them are FREE! In this post I chose the two that a company might buy ANTS Memory Profiler and JetBrains ReSharper.
2.) Testing
So you are a testing kind of developer, that’s great but you want all the extras that ultimate offers.
- Code Coverage
- Test Impact Analysis
- Coded UI Test
- Web Performance Testing
- Load Testing
- etc…
a.) Code Coverage ($479)
NCover is a mature and great tool for code coverage.
b.) Web Performance Testing and Load Testing($0)
The web has been around long before VS2010, so this problem has been solved a million times. Realizing that there are a ton of tools out there to do this and I won’t list each of them. Just Google and prepare to be overwhelmed by the possibilities.
c.) Coded UI Test ($0)
Watin allows you to code tests for UI interaction of web applications, which is probably the hardest interaction to test for.
d.) Resharper ($349)
I have to mention this tool just because it is so good and it improves the unit testing experience inside of visual studio, regardless of your framework.
3.)Database Development
the dreaded database…. how do we handle this stuff?
- Database Deployment
- Database Change Management
- Database Unit Testing
- Data Generation
a.) Database Deployment ($0 – not needed)
In theory this sounds great, but the majority of companies have a company structure that forbids any developer from making database pushes; the job of pushes are usually left to a Database Administrator. They will probably want to execute SQL that they have crafted and labored over.
b.) Database Change Management ($0 – code option)
again this is probably left up to your DBA with a combination of your source control (SVN, Hg, Git, TFS). I recommend looking into a migration framework if you really want to control the versioning of a database.
c.)Database Unit Testing (Whaaaaat? $0)
this troubles me on two fronts. First off you probably shouldn’t be unit testing enough of your database to have a whole project dedicated to it. Secondly, this is what developers refer to as integration tests and you don’t need any other tools other than your favorite unit testing package to do this. Granted, VS2010 probably has some nice UI tools to make this more pleasurable, but in my opinion tests are about results and not how pretty the UI is.
d.) Data Generation ($0)
This is a problem that isn’t that complicated to solve, and again has been solved. Check out AutoPoco which allows you to generate a ton of data easily through a fluent interface. After generation, just go ahead and pump this data into your database with your favorite ORM or DAL.
4.)Architecture and Modeling ($100)
Buy a whiteboard for modeling and get your team involved. There is nothing worse than an Ivory tower architect that pushes his architectural will on the team without discussion.
5.)Source Control ($300)
Unfuddle is a great online source control provider and in my opinion gives you a lot of things your business will use from Team Foundation Server. When I quote the $300, I am talking about for your whole company and not per developer. This is a huge cost savings. There are also a ton of other online source control providers that are similar to Unfuddle.
Tools I have to mention: TortoiseSVN, MsysGit, TortoiseHg, AnkhSVN (all free)
Conclusion and Total Price: $2637 ($2832 less than Premium and $9262 less than Ultimate)
That savings per developer is nothing to joke about. You could save over $9000 dollars but just looking around more. So what is the downside? Well you will have a hodgepodge of tools to use and many of these options might lack UI tools and possibly Visual Studio integration. Do your homework and see if the benefits of buying these tools outweigh your desire to have a all in one tool like VS2010. If you have a team of five developers, I just saved you over $45k. Your welcome.
Git –newbie –workflow
1Introduction
I recently found the time to dedicate to learning a distributed version control system. I had the choice between Mercurial and Git. Both are great systems but what it came down to ultimately was the fact that I already had TortoiseGit on my machine. Yes you read that right, it came down to the fact that I didn’t want another source control provider taking up space in my context menu; frankly my context menu is getting a little ridiculous.
I know it isn’t exactly a scientific method of picking between the two, but honestly, I see very little that is different between the two (for a learner).
Initial Reaction
When I first read the description of Git, I thought “who would be stupid enough to have source control on their own machine?” The second thought to go through my SVN-centric brain “I like SVN, so why should I change to Git?” The first question came out of ignorance to the ideas behind a distributed source control system, the second is a completely valid rebuttal.
I will attempt to address the first question. Yes your source control is on your machine but think of it as your own personal local copy of the “Truth.” You edit your version of the “Truth” until you feel comfortable with your additions and changes. The next step is to push your changes to a central version, possibly on GitHub or Unfuddle. That last step is important, because your source is no longer local. Your code now exists somewhere that is hopefully safe, secure, and accessible to you and your team of developers. What is powerful about Git is the fact that most of the expensive actions performed locally: commits, merges, additions, and deletions. This makes Git crazy fast, CRAAAAZZZY FAST! The two most expensive actions are pull and push, but even these can be quick if your central source control repository is on the local network. After a couple hours playing with Git, my ignorance about the ideas behind this system were overcome by an understanding and comfort.
The second question is valid. If you like SVN, why should you switch? Well nobody is forcing you to switch, and people won’t call you a loser if you decide to stick with SVN. I still have a warm place in my heart for SVN, it was the Han Solo of my escape from the Death Star known as VSS (Visual Source Safe). That being said, Git is a lot easier when it comes to branching and merging. In SVN branching occurs remotely on the SVN repository, which can be slow. In Git, branching happens locally and is even encouraged by most resources that I read. The one thing developers might gripe about Git is the fact that there really isn’t much Visual Studio integration. SVN has a ton of integration tools inside Visual Studio. What I would say about this though, is that the projects I work on have more than enough files outside of my VS Solution to negate the good aspects of integration tools. File types like third party assemblies, documentation, build scripts, and other files all exist outside the scope of my solutions. Now to add them to your SVN repository you are forced to use TortoiseSVN, a tool that exists outside Visual Studio.
I may or may not have convinced you to try Git, but I really feel you should. More and more compelling projects are being hosted on GitHub. How will you get involved and help these projects grow with a knowledge of Git? Also, Codeplex now offers Mercurial support, so don’t be suprised when your favorite projects on Codeplex start moving to a distrubuted SCM.
Basic Workflow
To get started with Git download MsysGit. This will setup an environment ready for Git on your windows machine.
I also recommend TekPub, they have a great series about mastering Git.
To learn about a system you have to use it, and that is what I did with Git. I wouldn’t call myself an expert but I do feel comfortable enough with it now to jump into a Git project. The basic Git workflow is as follows (type: “git help” in a command window):
- init or clone: if you are starting a repository use init, if you are getting use clone.
- branch: create a new branch to start working in or just work in the master branch.
- add: add any or all files involved in your project.
- commit: commit staged files to your local source repository.
- pull: get any changes that have occurred at the central repository.
- merge or rebase: make sure all your changes and branches are reflected in the master if need be.
- patch or push: some repositories online are private so you can produce a patch to send to the owners, if you own the repository the push away.
- Rinse and Repeat until content.
These are the commands you’ll need to know to just get by, but there are many more to become a master. I modified my environment to work with WinMerge for both merging and diffing. Below are the instructions to get that working.
- You will need to modify your git environment. This is done through modifying the .gitconfig file found in your user folder (C:\Users\<yourname>\.gitconfig).
*Note, when you install WinMerge be sure to check the box that installs WinMerge into your system path.
external = “c:/users/khalid abuhakmeh/difftool.sh”
[merge]
tool = winmerge
[mergetool "winmerge"]
cmd = ‘WinMergeU.exe’ \”$MERGED\”
trustExitCode = false
keepBackup = false
- Create a bash script to execute against WinMerge. Create a file called difftool.sh and save it in the same directory. Below are the contents of my file.
#!/bin/sh echo Launching WinMergeU.exe: $1 $2 "C:/Program Files (x86)/WinMerge/WinMergeU.exe" -e -ub "$1" "$2" | cat #!/bin/shecho Launching WinMergeU.exe: $1 $2"C:/Program Files (x86)/WinMerge/WinMergeU.exe" -e -ub "$1" "$2" | cat
Now when you execute the commands "git diff @{1}" (compares against previous version) or "git merge" you will get to use WinMerge to perform those actions. Pretty cool.
Conclusion
So there you have it, my initial interactions with Git and what I have learned so far. There are more things to learn, but I am definitely a convert to Git. Can you Dig Git?
New Year – New Developer
1So we are sitting on what is the precipice of a new year. We can either choose to change and evolve with the times, or we can stay stuck in our ways. I have decided to make some new year’s resolutions to make me a better person and developer.
1. Get Into Shape
As developers we can spend a lot of our time on our butts, up to 8 hours a day. That is why I need to make a strong effort to be active. My definition of active is a solid hour of exercise five to six days a week. Exercise is only part of the solution. Did you know your body expends more calories digesting food then it does when you exercise? That is why I have to make an effort to eat less calories. Now that the holiday season is over, the temptation of gorging is gone with it. And finally, cut out all high-sugar drinks. Developers live off of energy drinks but each can of energy drink can be as much as 400 calories. That is equivalent to the calories found in a bagel! Replacing those drinks with water can cut out a lot of unnecessary calories.
2. Work On My Communication Skills
I can talk to people, but sometimes I don’t fully get my idea across. This can cause frustration on both my part and the listener. That is why I have to work on my communication skills. I will do this by being more conscious of the words I say, listen deeply to my counterpart, and being less abrupt with my answers. I will also be working on my vocabulary. Adding words to my vocabulary can give me a more diverse set of words to express my ideas and intentions.
3. Swear Less
Swearing is a powerful tool when used properly. It can express frustration, anger, and happiness all in a couple words. There have also been studies that show swearing can lead to better rapport between co-workers. That being said, I have to remember that there is a place and time to use certain words and phrases. For example, a holy place is no place to start dropping the F-Bomb.
4. Be More Systematic
I am trying more and more to depend on systems to make me more efficient and dependable. This will help me reduce times where I am just thinking of what to do instead of doing what I need to do.
5. Be More Assertive
Over my life I’ve learned that people can take advantage of you if you let them. They can also mistake your kindness for weakness. Letting the other party know why I won’t do something, or the conditions on what I’ll do given a task will make my life much simpler.
6. Give Love to the People that Deserve It
There are a lot of important people in my life, and some not that important. Giving more preference to those I love will make everyone happier.
7. Read, Read, Read
It’s surprising how much more knowledgeable you get by just reading what other people are doing. So I am dedicating 2010 to reading more.
The year is early and things could change, but for right now these are my resolutions. Do you have any?
Coding With My Voice
0I was exploring some screen casting software the other day and I noticed that Windows 7 has speech recognition. It probably was there in Vista, but I never really played around with it. I wondered how easy it would be to program a “hello world” program while keeping mouse and keyboard strokes to a minimum. I started by starting my voice recognition on my instance of Windows 7 machine.
The next step is to announce to my computer to start Microsoft visual studio 2010. That command is “Open Microsoft Visual Studio 2010”
This is where it goes down hill for me. Visual Studio 2010 doesn’t have voice support for actions. I tried to say something like “File > New> New Project” but Voice recognition just ignored me. The second approach was to remember what the shortcut was to start a new project. Since I know it, I said to my computer “Control Shift N.” Soon after, I was presented with the New Project dialog. Another painful experience. I had to tab my way to a new project, and tabbing with your voice is not fun. Below is a play by play of my tabs.
Not exactly fun. The next step was to get into the code. I cheated here and had to click into my code. After some painful, painful, painful yelling at my computer I got this code. It took me about 10 minutes of backspacing, and fixing things to get a simple application.
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World");
Console.Read();
}
}
So you might be thinking, why would anybody do this?
Well I started thinking about scenarios where programmers could leverage their voice to program. Before we know where we want to go, we have to know where we are. Obviously we are not very far when it comes to programming with your voice. Below are some things that need to change for developers to start programming with their voices.
Context Switching
Programming languages are created to crudely mimic human language. A phrase could mean two different things to a word processing application and a development environment. Theoretically, when I enter Visual Studio my voice context should be switched to a developer context. This means that voice recognition is listening for different keywords to perform functions. Below are some examples of actions that could be present in a developer context.
- “Add New Class”
- “Add New Project”
- “Lambda x comma s executes s equals x” (x,s) => s = x
- “Console Write Line String Hello World End String”
- “Select Current Method”
- “Select Class”
- “Rename Function/Class/variable”
- “Comment Above Line ….”
In addition to knowing actions in this context, the voice recognition could know you programming preference and make appropriate decisions for you. This is primarily for casing variables, functions, and classes. When you say “Calculator Service,” The voice recognition should know that you mean CalculatorService.
Programming Language Hooks
The voice recognition software should be able to recognize keywords and namespaces of the programming language you are using. So if you say a class name, the voice recognition software should know if you are creating a new class or talking about an existing class. This approach could be achieved two ways: create an API that the voice recognition can call in an IDE, or create a dictionary that you could place into a location for the voice recognition. Either way, you are building an API to allow developers to extend the voice recognition for their particular programming language.
Fingers-Voice Hybrid
Right now you are able to type while you talk to your computer. I would expect that you could do the same when programming with your voice. Some things just might be faster using your fingers.
Conclusion
These are the first step to voice recognition for developers, they are obviously large steps to take. Clearly the current voice recognition in Windows is made to server the greater population of users, who are interested in word processing, email, and chat applications. It would be great if you could take the voice recognition in Windows and specialize it to be used with Visual Studio and other IDEs to boost the efficiency of developers. Microsoft, I hope you are listening.
Jumping Development Niches – Realizing Learning
0.Net is one of those great platforms that gives you so much value without having to re-learn everything. I recently decided to jump back into Windows Presentation Foundation, to keep my skills there sharp. What I was surprised to find is that it is evolving at break neck speeds, almost to the point of giving me migraines. Obviously Microsoft isn’t moving at this speed to overwhelm developers, but instead to give value to those developer niches. About 5 – 10 years ago Microsoft thought of a developer as a windows developer, creating applications solely for use on their platform. Everything Microsoft made was centered around rapid application development or drag and drop development. This is clearly evident when you look at Asp.Net Web Forms. Since that time the world has evolved, and so has Microsoft’s view of those developers.
Microsoft is developing niches, and although they don’t mind you jumping around from niche to niche, they want to make sure to help those loyal to those niches by continually providing new value in shorter release iterations. This can make it tough, but not impossible, to catch up in a niche like WPF or Silverlight development. So what are these niches? Well they aren’t officially defined, but there are strong lines. There is obviously some overlap, so you might see some things repeated.
.Net Niches
- Web Development
- ASP.NET MVC
- ASP.NET Web Forms
- Windows Communication Foundation (WCF)
- Cloud Computing (Windows Azure)
- Windows Applications
- Windows Forms
- WPF
- Silverlight
- Rich Internet Applications (RIA)
- Silverlight
- Enterprise Systems
- Windows Workflow Foundation
- Office Development
- Cloud Computing (Windows Azure)
- SharePoint
- Reporting
- Simulation and Games
- XNA Framework
- Microsoft Simulators
- Robotics
These are the major niches as identified by Aqua Bird Consulting. I’m sure there are smaller niches that we’ve missed, but these are the ones that the majority of developers are involved in. So the question is, can you get one developer to know all this stuff off the top of their heads? No, of course not, these frameworks are dynamic and with shorter and shorter release cycles it would be a 24 hour a day job learning it all. So what can a developer do?
I’m No Tabula Rasa
This sadly is what some developers do, they throw up their arms and say they don’t need to learn that new stuff. They believe that Microsoft writes everything sub-standard and that they know better. This usually means these developers are entrenched in building new frameworks and systems and not leveraging the work of external developers. Building frameworks is great for developers because they get to nerd out, but terrible for the business (unless the business intends to sell this framework, but you’ll find few willing to buy). A business needs to perform its business functionality, and the longer a developer can’t provide that the longer the business losses critical revenue.
Jack of All Trades, Master of None
The second approach is to learn a little about every topic and know that it exists. In fears of sounding like a G.I. Joe public service announcement, “knowing is half the battle!” If you know something exists, you won’t spend weeks or months home rolling your own solution. This can be critical to saving time and money. The best place to start is Microsoft Developer Network (MSDN). This approach requires a lot of time surfing the internet and reading blogs. With this approach, when presented with a project, you can make the best decision about what technologies to use and learn more about it during the process of development. This approach has its ups and downs, but can help make sure that your solution is on the latest platform.
Bring in the Specialist
Pick two or three technologies and go deep. Learn everything about these few technologies and be able to talk critically and intelligently about them. This approach can work well for developers when they know what is expected of them. If you are a web developer, then you probably don’t need to read about XNA for your job (although you could read about the XNA framework for fun). This can be a double edged sword for the obvious reason that the only thing that never changes is that everything changes. Your company might be entrenched in web development one year, but decide to go into game development the next year; your skills don’t fit the job description anymore (nothing that drastic will probably happen, just making a point).
Conclusion
Doctors have used a similar approach in their profession. You will first go see a family doctor and he will attempt to diagnose your problem and treat it. If he has diagnosed your problem but cannot treat it, he then goes ahead and refers you to a specialist. Microsoft .Net is growing, both in depth and width. You can either go shallow and wide or deep and slim. You, as a developer know what’s best for you. Also you as a business owner, if you are one, know what you want your developers to be. Keep in mind that it is never too late to jump from one niche to another, but to be effective in any niche you need to do your time and pay your dues; these dues come in the form of long hours reading, learning, and doing.
Happy Thanksgiving 2009 From Aqua Bird Consulting
0
As Developers we need to take time away from our development machines and realize what is important: life, love, and family. So on this day put down your hot pockets and spend time with family members and loved ones. Also think about those less fortunate and help in any way you can.
Happy Thanksgiving 2009 from all of us at Aqua Bird Consulting.
Aqua Bird Consulting Blog On iPhone
0Now you can read the latest from Aqua Bird Consulting on your iPhone. No more gesturing to shrink, zoom, and pan across the blog. As you can see from the screenshots below it is readable and syntax highlighter is supported. Oh Jeez!! I should really charge my phone.
So You Want To Build A Plug-in Enabled Application?
0Like the title of this post asks, so you want to build a plug-in enabled application? As a developer I’ve run across this scenario at different times during my career and every time it pops up, I always seem to know a little more than I did the last time I approached this problem. This post is about helping you think about a plug-in application of your own. First, let’s look at scenarios where you would want to have a plug-in architecture.
It’s Plug-in Time!
Ok before you use this hammer, you first have to know what you’re swinging at. Below are common usages for a plug-in application, but certainly not all the scenarios.
- Job Scheduler
- Content Management System or Blog Engine
- Integrated Development Environment (IDE)
- Highly Customizable Software Products
- And Much More!!
So those are a few ideas of where a plug-in architecture could be helpful, now lets look at what you should keep in mind when developing a plug-in based application.
Shells Aren’t Just For Turtles
For any good plug-in architecture to work it will need a solid shell. A shell is that part of the architecture that orchestrates and manages all those plug-ins you want to work together. Below are some
features to keep in mind when creating a shell. They are in no particular order of importance.
- Service Location : The shell should be capable of finding services, and giving a plug-in the ability to find a service as well.
- Strong Exception Handling: The shell shouldn’t trust any plug-in to do its job. If the plug-in is bad, that doesn’t mean the shell has to freak out.
- Logging: The shell should let you know what it’s doing, and what it hopes to do if all goes well.
- Instrumentation: The shell should let you enable and disable a plug-in. This could be as simple as deleting a configuration or building an admin tool.
- Abstract: The more abstract your shell is, the more the responsibility of functionality falls on your plug-in. This is a good thing.
- Orchestration Theme: The shell has a theme to its orchestration i.e. executing a scheduled job, displaying web pages, etc.
- Event Aggregation: Things happen in plug-ins, but how are you going to let other plug-ins know or the shell for that matter.
Keeping some of the things mentioned above in mind will help keep you on the right path when building the shell, but what about those plug-ins? That’s the next step.
It’s in the Contract
There are usually two approaches to allowing developers to create a plug-in. The one way is through inheritance. The developer inherits from “PluginBase” that has methods he needs to override. From my experience having a “PluginBase” has always lead to more headache than it is worth. I found that functionality would be inherited into a plug-in that I didn’t necessarily want. Any functionality I wanted in all and every plug-in usually ended up finding a better home in the shell.
The second way to allow developers to create a plug-in is through interfaces/contracts. Interfaces give developers a better understanding of what they need to implement, and with interfaces there is more room for composition. Remember .Net does not support multiple inheritance but it does allow for multiple interfaces. This allows a developer to build very specific plug-ins by only implementing the interfaces that make sense. i.e. a plug-in that has a UI might implement a UIPlugin contract, where as a plug-in that doesn’t have a UI would just neglect implementing that interface.
The Right Technology Stack
The success of your architecture depends on the technology you choose. As like any other development project, you have to choose the right tools for the job. If your plug-in architecture needs to span across networks and live on multiple machines, storing your configuration in files might not be a good idea. If your plug-in architecture exists on one machine, then you probably don’t need WCF or any other kind of remoting. That being said, you should build your architecture so that you can change major parts of your architecture without major effort or overhaul of the entire architecture. Using patterns like IoC can help make this less earth shattering.
Conclusion
Plug-in Architectures are very powerful. They can be the solution to a lot of problems, but I would not advise going down this route if you just want to flex your development muscles. A good exercise to do is to whiteboard the different aspects of your architecture. Draw a large circle in the middle of the board and label it “Shell,” then draw little circles connected to the larger circle for each plug-in. This will help you visualize what your plug-ins are, and what your shell needs to accomplish for these things to work together. Once you realize what the shell is and more importantly is not, you will find your plug-in architecture will fall right into place.
Good Luck,
I know these kind of projects can be really fun
Visual Studio 2010 : Surprise Feature
0
I’m trying this new method of programming where I can only see one parameter at a time. This approach allows me to stay focused on what I’m doing. Just kidding, but the screenshot you see above isn’t Photoshop. The picture is legit, apparently its a new feature in Visual Studio 2010 that lets you resize your font on the fly. I accidently stumbled upon it when I was resting my arm on my keyboard and was holding the the ctrl key and begin scrolling the mouse wheel up and down.
Surprise Feature:
CTRL + Mouse Wheel : Instant font size manipulation.
Pretty cool, especially when giving code demos or showing people code while they stand over your shoulder.



