Tuesday, October 13, 2009

Resource Links #6

submit to reddit

Other useful daily link blogs:

Alvin Ashcroft’s morning dew
Chris Alcock’s reflective perspectives
Jason Haley’s interesting finds
Bit my bytes
Rhonda Tipton’s blog

Monday, October 5, 2009

Dive into test driven development

submit to reddit

kick it on DotNetKicks.com

Are you an application developer? Do you write complex systems? Do you worry at night about regression? Do you dream about the build failing in the morning because you committed some changes last night – and they seemed to be okay still you’re not sure because you’ve seen that happen before? Do you wonder why to start? If yes, then test driven development is what you ought to be working at.
Complex (and even simpler ones, to a lesser extent) applications require a rigorous coding practice. As your code base increases, the chances are that the requirements are going to change (according to Murphy’s law). If you are doing Agile development you already have an idea how to handle that. Though if you are not using unit tests, you do not have an infrastructure to ensure that the system remains stable while you refractor your code according to the requirements.
Now we’ve seen large code bases without any automated tests. We’ve seen chronic regression issues (especially near the deadlines) and we’ve seen nightmares of it all hitting us back. We’re lazy to write unit tests (because if it works, why test it?). Its only later do we regret not writing unit tests. The best way to deal with this symptom is doing test ‘driven’ development.
Test driven development emphasizes on test-first approach.
For each atomic requirement:

  1. Write test.
  2. Run test. Verify the test fails.
  3. Write code to make that one test pass.
  4. refractor while keeping all tests passing.
Now this obviously seems tedious. Bad habits go hard. Jumping from not doing any kind of unit testing to test driven development will need some investment on your part. A number of books have been written on this topic but the only thing that you require right now is a TDD kata.

A Kata (from wikipedia):
Kata (型 or 形, literally: "form"?) is a Japanese word describing detailed choreographed patterns of movements practiced either solo or in pairs. Kata are used in many traditional Japanese arts such as theater forms like kabuki and schools of tea ceremony (chadō), but are most commonly known for the presence in the martial arts.
A TDD Kata is the method used by Roy Oshirove (ISerializable , 5Whys, Art of unit testing) to teach TDD to such an extent that it becomes a second nature of the programmer. Roy has put up a TDD kata on his blog. The basic concept is to pick a problem and align yourself to think incrementally while making the infrastructure natural.
For TDD Kata 1 that Roy has put up, I tried it and was able to do it in about 20 minutes. Here’s the final code that i was able to create:

kick it on DotNetKicks.com

Sunday, October 4, 2009

Resource Links #5

submit to reddit

kick it on DotNetKicks.com

.NET programming

.NET code garage sales

General development

Data structures

Implementing Fibonacci heaps and Dijkstra's Algorithm on top of it.

UI Patterns & Data visualization

UI patterns and data visualization, though not having to do much with .NET have an important application in the computing world. Lead about UI design patterns in the following links:

Pocket Mod v2 : A very neat way to organize yourself without having to buy a PDA or install arcane applications in your mobile phone.

Agile Software Design

Wednesday, September 30, 2009

Link blogs list v.0.1

submit to reddit

Here’s a list of link blogs I follow to keep up with latest is software development (primarily application development in .NET stuff).

Jason Haley’s Rambling of a .NET developer : A dedicated link blog of a dedicated developer. The links are organized nicely into Web, Database, Cloud Computing, Innovation, etc. It is updated almost daily.
Chris Alcock’s Reflective Perspective : Reflective Perspectives is another very well organized dedicated link blog organized into different sections and searchable as well.
Alvin Ashcraft’s Morning Dew : Alvin’s Dew drops is a must read every morning. A dedicated writer who also happens to be a Microsoft Valued Professional.
Rhonda Tipton’s Weblog : Very well organized link blog updated weekly (link posts, other posts are quite informative as well). Also blogs regularly on other stuff as well.
O’ Reilly Radar : Not exactly a dedicated or uber-regular link blog, but is a good resource on latest technologies from around the web. The blog is contributed by different people at O’ Reilly’s.

It’s nice to see the evolution of these link blogs and seeing a thriving community of people dedicated to putting up the best of the hand-picked stuff for others.

Saturday, September 26, 2009

Resource Links #4

submit to reddit

Developer Links

  • A mess is not a technical-debt: Bob Martin of Object Mentor elaborates on the oft-misused term ‘technical-debt’. What follows is an insightful discussion.
  • Changing prompt for cmd.exe: I needed this for a couple of tweaks to my command line building environment. Very handy.
  • .NET University: A great resource to catch up on latest in .NET world.
  • Code Rush eXpress: Download this handy Visual Studio Add-in that makes life a lot easier for developers. Lots of nice refactoring features.
  • Code Rush eXpress video trainings: If you one of those visual learners, then this resource is for you. Shows the handy Code Rush features as short screen casts.
  • Big Balls of Mud: A commentary on one of the cool articles in software engineering (html | pdf). Big Balls of Mud is the term given to “haphazardly structured, sprawling, sloppy, duct-tape and bailing wire, spaghetti code jungle.” If you have seen this type of code, go through the article.
  • Documenting your Air, Food and Water: Why you should document each and everything you know about your development environment.

Programming Practice Links

When was the last time you tackled a programming problem that truly got your head involved? When was the last time you learned a different language? (No, learning C# after Java or vice-versa is not counted). Here’s you change to keep or pick this hobby with online judge systems that give you a plethora of programming problems to solve in different languages.

  • Code Chef: With a wide variety of languages at your disposal, use your language  to solve problems and get paid. Code Chef has monthly competitions as well.
  • Code Golf: Show you code-fu by trying to solve problems in minimum possible number of keystrokes. Use Perl, Ruby, Python or PHP to solve problems and sharpen skills.
  • Programming Praxis: Programming Praxis is a blog dedicated to posting programming problems and readers submit code by comments. Any language is acceptable.
  • Project Euler: Project Euler is an ambitious project to get mathematical knowledge out there using programming tools. It has a series of regularly posted challenges which are mathematically or programming intense. They require more than just programming or math knowledge.
  • Top Coder: TopCoder is a crowd-source based company that’s gaining momentum very quickly. It has the most extensive set of competitions for programmers. One of the most loved one is the Algorithms competition that happens fortnightly. They also have attraction for software engineers and designers by putting different phases of software development to competition (i.e. Software Conceptualization, Software Specification, Software Architecture, Software Design, Software Development, Software Assembly, Testing etc.).
  • UVa Online Judge: An extensive list of problems to be solved using C++, JAVA, C, PASCAL, as used in university of Valladolid.
  • Timus Online Judge & Sphere Online Judge:  Provides a lot of problems and language support to train yourself to algorithmic problems.

Other Links

9 ways marketing weasels will try to manipulate you: Jeff Atwood picks from Predictably Irrational. Quite an eye-opener and interesting read (to stay away from and still use on others :P)

Thursday, September 24, 2009

Curious Case: Google Analytics not working with Blogger

submit to reddit

The problem

So after a couple of blog posts I decided to track Debuggerman’s stats (page visits, bounce rate, average time on site, keywords, etc.) and I setup Google Analytics account for it. The basic setup was straight forward and regular. You signup, give your blog’s address and then they give you a code to copy in your theme’s source “at the end of the theme right before </body>” tag. I did exactly that, but somehow it did not seem to work. Analytics kept showing me the warning sign. This post seemed like a ray of hope, but It didn’t work.

image I waited for a couple of days but still Google Analytics showed a warning sign in front of Debuggerman’s account. What to do? Did I do anything wrong? I searched the internet and could not find a remedy per se. So I dug deeper and viewed my blog’s source that is generated by Blogger. Not surprisingly, Blogger was adding extra widget source at the end of my post right before </body> and right after the Analytics code (see picture).

If you are suffering from the same problem, you can verify this by typing in your blog address in the browser (e.g. http://debuggerman.blogspot.com) and when it is loaded, right click on the page and click “View Source”.

The remedy

Simple. Move the Analytics source to right before the </head> tag. The reasoning for this that I can think of from top of my head is that Analytics source conflicts with some Blogger generated source (I'm not sure, I'm not Java Script or web-dev/design expert per se). So moving it to the <head> tag ensure that 1. it is loaded and 2. it is loaded before anything else.

Right after I made this change I went back to Analytics. On my Debuggerman’s dashboard there, I clicked on ‘Edit’ action and then ‘Check Status’ link as shown in this post. All seems to work now. Hence solved the Analytics/Blogger mystery.

Saturday, September 19, 2009

Resource Links #3

submit to reddit

Developer Links

  • Single Responsibility Principle: (PDF) There should never be more than one reason for a class to change. This principle has got to be one of the most important principles in software engineering. This is written by Bob C. Martin who is also the author of the Craftsman series and other articles.
  • Extract till you drop: Another great resource on Object Mentor on how far to refactor code and when is a refactoring complete.
  • BDD Test Framework Part 2: In my last post I posted a link for the first part of this series.
  • TDD for GUI Code: Have you ever had the nightmare of maintaining NUnitForm tests? How about doing things the right way – the software engineering best practices way. This article emphasizes on adapting TDD with GUIs.vs theme
  • The Humble Object: Continuing from the previous link, its really hard to extract logic from the UI code and then test the logic code. Obviously we’re not the first one to come across this problem and it lies in the category of Test Design Patterns (See below for the book of the week). In Humble object pattern, we extract the logic into a separate easy-to-test component that is decoupled from the environment. 
  • Debug.Assert vs Exceptions: Though quite debatable with Java aficionados, its still a good read. Also follow these threads on StackOverflow.
  • Visual Studio Text Editor Themes: Bored of the same old visual studio theme? Ever wanted to make it look like you want it to but never could? Scott Hanselman has collected a set of such themes that you can download and apply. Checkout my theme that i picked from them on the right.
  • Observer Design Pattern and Event Pattern in C#: This is an excellent article on the very useful Observer design pattern and how C#.NET incorporates this pattern as a first class language feature as Events.


    Technology Links


  • Multi-Threading in .NET: On when to use System.Threading.Thread, System.Threading.ThreadPool and System.Component.BackgroundWorker or delegates invoked in async fasion.
  • Windows UX Guildelines: Microsoft has released a new guidelines document that covers Windows 7. A must read for any UX (User eXperience) developer.
  • Using Markov Chains to generate Test Input: Markov Chains allow you to generate contextual yet pseudo-random values, where next value depends on the previous ones. This has an interesting application for developing Test cases.
  • Effective A/B Testing: Do you develop UI interface? Does your user always like them? See how A/B Testing has fine tuned the way we get users to converge on a design.
  • What’s new in BCL 4.0: See what’s new in .NET Framework 4.0’s Base Class Library. .NET 4.0 is expected to release by the end of this year together with Visual Studio 2010.
  • Interview with Anders Hejlsberg:  Hejlsberg is the Chief language strategist at Microsoft and is one of the prime designers of C#.NET. In this talk he highlights different influences on C# from different languages like Delphi. He also discusses an informal roadmap for C#.
  • Development Trends in Emerging Software Markets: See how the development trends are evolving in the emerging markets of south Asia and Asia.
  • Office 2010 Web Preview: Microsoft offers a preview of the latest and sexiest Office 2010 web. If Microsoft can roll it out in time and ‘free’, I think it will give a hard time to Google Docs.
    Microsoft Launches the CodePlex Foundation which will be a link between open source and other developer community.

Business/Career/Management Links

Other useful Links

Are you a developer? Are you getting adequate sleep? Do you sleep comfortably at night? Do you feel fresh 9-6? If not then you need to find the root cause and fix it. Sleep helps in a lot of natural processes, especially memory retention, concentration and others. Take this BBC Quiz to asses your sleep deprivation level and read this article for more information.

Book of the Week

xUnit Test Patterns: Refactoring Test Code by Gerard Meszaros
I'm a slow reader these days but I'm almost half way through this book. An excellent resource for software engineers and other IT professionals who develop software for a living. Having unit tests cover 100% code is a dream - but this book starts from that dream because beyond that is a nightmare :). Nightmare of re-factoring test code when your actual code changes. Over time several design patterns have emerged in software testing and test code re-factoring as well and this book is the ultimate resource for that.
Till next week,
Ciao.
- Zaki

Thursday, September 17, 2009

Resource Links #2

submit to reddit

Feeds to follow

  •  Patrick Smacchia : Patrick is C# MVP and the man behind NDepend. If he knows something very well, its .NET! Especially code analysis and code quality. 
  • 5Whys : Roy Oshirove, the writer of Art of unit testing and Iserializeable blog, has dedicated this blog to the budding and blossomed teamleads, basing it on the famous 5 whys model of toyota. He talks about keeping things in focus and getting things done, especially in an agile context. He has also been the architect of TypeMock mocking framework for .NET.
  • APCMag : APCMag is a tech magazine based in australia. It features latest hardware and software reviews as they happen.
  • Ayende Rahien : Orin, the guy who developed NHibernate and Rhino Mocks blogs about these products and more related to .NET.
  • High Scalability : Ever wondered what's under the hood of your favourite greatest applications like Facebook, Myspace, Google, Twitter? Find internals about these and many more application's setups.

Tweeple to follow

Programming Links and Resources

  •  Do you create XSL/XSLTs often? Is it a hit and try method? Read how you can debug XSLTs inside visual studio.NET. Very helpful. 
  • Learn about Agile Requirements best practices.
  • Test coverage of your code is a big issue. Is 100% test coverage mythical? Patrick Smaachia (NDepend ) thinks not. Read why here .
  • A highly motivational rendition of Hare and Tortoise story for the likes of us. Read it here.
  • Tim O'Reilly, the person who coined and defined 'web 2.0' talks about Gov 2.0 and how Governments can provide a platform for better citizenship and commerce using the technology.
  • Google wave hits the market at the end of this month. Read 5 ways it MIGHT change the world. See official wave demo here
  • Behavior driven development from scratch teaches the difference from regular unit testing and TDD in .NET. Garry Shutler starts a series of these articles from this post.
  • If there is one company that has taken .NET WPF seriously, its Thirteen23. Checkout their demo applications like Blu (a really sweet twitter client). Also check out their TED player.
  • See Ayende (creator of Rhino Mocks for .NET) screencast and teach the use of rhino mocks in this 10 part series.

Resource Links #1

submit to reddit

Feeds to follow

  •  The Old New Thing : Raymond Chen 's regular blog about all Win32 API and internal, not-so-common, wisdom about windows operating system.
  • Coding Horror : Jeff Atwood's always loveable regular rants about technology and computing - for the daily users and developers. 
  • Faboulous Adventures in coding : Eric Lippert's senior advice and wisdom on C# and other Microsoft technologies.
  • Joel on Software : Joel spolsky's discussions about software design and best practices. 
  • Mark's Blog : The WinInternals and now SysInternals guy. The technical fellow in the platform and services devision at Microsoft. Its a low volume, high wisdom blog. He solves one case at a time, cases that annoy us all the often. Also, a regular insight into Windows internals. Do you use SysInternal tools ? You should. For example ProcessExplorer , TcpView , Procmon. They definitely give you more control over Windows system so you can diagnose problems easily. Download the complete suite here

Tweeple to follow

  • @zakimirza : Thats me :). Follow me to get updates on myinconsistent self, rambling, links and blogposts, occassional cursing on speghatti codes and what not. 
  • @shanselman : Programmer, author, teacher, speaker, web guy, podcaster, starving stand-up comic, diabetic, Microsoft shill. Social Media! Why not?
    Scott Hanselman is a very renowned blogger, tech analyst and computing enthusiast. Upto date tweets on the latest.
  • @stocktwits : Real-time stock conversations.
  • @timorielly : Founder and CEO, O'Reilly Media. Watching the alpha geeks, sharing their stories, helping the future unfold.
  • @google : News and updates from Google

Programming Links & Resources

  • Checkout Roy Oshirove's post about other blogs that emit daily news about .NET etc here A very useful reference indeed!
  • StackOverflow is a rapidly growing question/answers site developed by Jeff Atwood and Joel Spolsky. Has answers to questions spanning from best practices to code problems. 
  • Tim Orielly talks about Govt. 2.0, its all about the platform. Read it here.
  • CodeBetter is a colgremate of blogs to promote better coding practices.
  • Read about latest in .NET's base class library (BCL 4.0) .
  • A success story using NDepend to make better managed code of a large application. Its all about the design.I wil blog about NDepend and its usage pretty soon.
  • 7Zip is an opensource windows utility for manipulating a large variety of Archives. 
  • Ever needed a good CLR profiler? Try dotTraceand Intel prallel studio to find profile your application for performance, memory leaks, deadlocks and much more. Both of these integrate well with Visual studio.
  • Visual Studio 2010 is just around the corner. The new UI is designed in WPF. Yes really. Read VS's architect's take on this here
  • Check out Scott Hanselman 's 2009's top utilities here.