Showing posts with label Development. Show all posts
Showing posts with label Development. Show all posts

Wednesday, 14 January 2015

The First Is A Lie

Lately, I've been hyper aware of the first choice in web drop down lists. Yes, yes, I need a hobby.

When unsubscribing from a bunch of mailing lists, I've found I lazily choose the first option for "Reason" when I'm asked. This goes back to me wanting a one-click subscribe but beyond that, I will also choose the first option.

If you are thinking about asking a question and not putting yourself out of business then think about what your first choice in a list is. Don't let it be your worst option, even if it is alphabetical.

Sunday, 11 May 2014

Top 3 Irrational Fears when Designing Web Sites for Mobiles



Over the last three years there has been an explosion of web development for apps being required to run in browsers on desktops, laptops, mobile and tablets. With the savvy user, moves to improved touch acceptance and further short attention spans, user interface design has changed.

Prior to the current climate, everyone wanted to direct users to their own native apps that would give a richer experience. It is now accepted that rich native apps are the domain of the user who has already committed to your brand, service or product. They have been using your online or offline business for a while and now want quick and continuous access to you.

It is not often the case that users are won over to loyalty and consistent use to mobile apps unless there is a gimmick, game or hardware specific reason for the uptake.

A lot of people are using the browsers on their phones and tablets, in the same way that they use the browser on their laptop or even more retro desktop machine.

This means that every web developer must be aware that they are designing their apps for users who will browse them on multiple platforms, in multiple browsers and with very little momentary predictability.

With this in mind, developers are freaking out about what good web site design means. With that panic comes fear of moving from old web design habits based in skeuomorphic principles to newer interactive flat designs.

When I work with people to build multi-view web applications (usually in ASP.NET MVC), I make an effort to beat out of them their top 3 irrational fears.


Mobile over Everything
No matter what you tell yourself or how much you want to believe that people lounge in front of their laptops on the couch at home using your web site, you will have to come to accept that the majority of people will view your site on a mobile device.

If this isn't in the case right now then it will be absolute within the next year. People use their phones to check the weather instead of walking outside. People use their phones to access social media before they roll over and kiss their partner good morning. People judge your web site by the way it looks in their mobile browser.

You don't want to fail at this step. Don't be afraid though, this like everything else in our profession is a solved problem.


Scrolling over Pages
As touch interaction becomes more useable with newer mobile phones, tablets and touch enabled laptops and monitors people are more inclined to click on links on websites. However, this is more usable in higher resolutions and not always so friendly in the phone space where you sometimes feel like you are bashing the screen with your gorilla fist.

With that in mind, the rule of never scrolling that we were taught at the start of Web 2.0 is no more. Scrolling is what people do without hesitation or irritation on mobile devices. It is an opposable thumb swipe that behaves exactly as they expect without the concerted effort of clicking a link between two other links that might not be the one you meant to click.

Stick with the rule of scrolling in one direction and you will have happy users. Never scroll in two directions because it jolts the user in to having to work out if where they are going and what they are doing. One dimension only.

Always choose to put more information on a screen and let it be scrolled rather than asking the user to page.


Minimalism over Sensory Overload
Flat design is the word of the moment, although it has been around and had requests for seconds since well before iOS7. Even Microsoft pushed for minimalism in Visual Studio 2012 onwards, to the astonishment and even disgust of some devs.

Developers, especially front-end focussed ones, still tend to lean towards bringing the richness of dedicated clients to the web. Instead, the current trend is to bring usability and simplicity to the web so that mobile users are not fighting the animations and over-populated screens to get what they want done.

If you can make it simple then do. No one is impressed with the equivalent of a 1997 HTML blink tag when they can look at a clean screen and find what they want with not too much mental effort.


Remember those three guiding principles and you can start moving in the right direction, if you aren't already thinking this way.

Monday, 7 April 2014

Define Done



Often when I read blog posts or articles about agile, they are talking about advanced concepts or solving funky problems that happen when you're in the depths of running an agile team.

The alternative are Masters of whatever flavour of agile is in at the moment. They are saying you start by following these exact rules that will save your whole team. I call bullshit on all of them.

In a previous post, I spoke about how there is no point is applying an agile band-aid if you don't work out where you are first and then add rigour to your current processes.

Once you do work out what practices your team is using and identify them and apply rigour, it is time to start putting in place some entry and exit criteria to initiate work and define success. I consider it drawing two lines in the sand that represent where we start and where we finish.

I always start with multiple Definitions of Done that apply to sprint tasks/stories, the entire sprint/iteration and the project.

This gives the whole team an idea of what it means to have completed a task and signed it off. That doesn't mean you comply with full continuous deployment and produce production releases at the end of each sprint (although we all dream of such a utopia) but it does mean that you have an end state that is achievable and universally understood. Working software is of course, part of this end goal.

It is important that this is understood before you even start the project so get this in place and get buy-in before you seriously put in any delivery effort.

Definition of Done for a User Story
I often treat the definition of done for a user story as the exit criteria for the swim lanes on a Kanban board. This defines when a user story that fits in a sprint is considered complete:

  • Business analysis is complete [Owner: Business Analyst][Swim lane: In Analysis];
  • Technical analysis is complete [Owner: Technical Lead][Swim lane: Ready for Dev];
  • Estimation of effort [Owner: Entire delivery team][Swim lane: Ready for Dev];
  • Implementation of the user story is complete [Owner: Developer][Swim lane: In Dev];
  • Implementation of unit and integration tests [Owner: Developer][Swim lane: In Dev];
  • Integration with all other sprint stories [Owner: Developer via Continuous Integration][Swim lane: In Dev];
  • Automated packaging [ Owner: Developer][Swim lane: In Dev];
  • Automated or manual deployment [Owner: Developer and Tester][Swim lane: Ready for Test];
  • Full functional testing in a partially integrated environment where mocks are allowed [Owner: Tester][Swim lane: In Test];
  • Sign-off of user story functionality, confirming implementation reconciles to requirements [Owner: Tester][Swim lane: Ready for Sign-Off]; and
  • Sign-off from product owner that the user story has been delivered [Owner: Product Owner][Swim lane: Signed Off]
Definition of Done for a Sprint
A sprint is considered done when:
  • Sprint planning was run and included the whole team;
  • All user stories are signed-off by business;
  • All user stories have been fully integrated with the current working software;
  • Automated test coverage meets the agreed team standard;
  • A retrospective has been run and actions owned or implemented by owners;
  • Backlog has been groomed for future sprints;
  • A deployable package has been prepared and versioned for release to an acceptance environment (that may be production); and
  • Actual versus Estimated Velocity has been compared for future planning.
Definition of Done for a Project
This is a much tougher one. It depends on the situation you are in and the environment. Often we aim for working software and successfully full requirements reconciliation. There are many other things though that make this list. It is one that must be agreed to prior to delivering the project.


The important thing about any definition of done is that you must know up front what the goal posts are defined to be and not move them. Yes, you can change the way you play the game but you still know what it means to be finished.

Don't start until you know what it means to finish.

Sunday, 23 March 2014

Forget Being Lean Until You Get Some Rigour



Over and over again, people talk about Lean like it is a giant waterproof, super-fast healing Band-Aid that will fix every delivery team. They say "Toyota this" and "Motorola that" and "you're not lean enough."

The problem I have with this is when the Band-Aid is being applied to a delivery team that has no structure at all. You can't make a cowboy team leaner or even more agile without putting structure in place and then improving it.

I don't mean picking Scrum or Kanban and saying do this and then become leaner. Instead, I mean that teams must become aware of their as-is way of functioning. Identify practices and articulate them. There always are practices in place but people are not always conscious of them. Without consciousness, there is no method. Once you have method, you can use it rigourously.

Become aware of what you do now. Decide on where you want to be. Map a course of action from one to the other and most importantly, give yourself time and give yourself permission to fail and correct.

Telling a team with no self-awareness to become leaner is pointless. First find the point.

Wednesday, 13 November 2013

Your compiler is your friend



Today, I spent a small amount of time helping a developer solve a problem.

That may be how I start a lot of my posts for a while since I am working with some smart chaps who are learning to be better devs. The thing about learning to be a better developer is that you learn it from writing a helluva lot of code and from working with old grey haired devs like me.

Ok, I don't have grey hair but I do this wise Gandalf voice that really deserves some grey hair.

When I started developing, a compiler wasn't much without a linker. We spoke of lint and didn't mean the stuff left in driers. We had pet dinosaurs.

One thing that understanding the parts that come together to be the Build that we all speak of now is that we learnt to listen to what each part was telling us. No, no, I don't want you to go out and conduct some native American dreaming ceremony but I do want you to listen to your compiler warnings.

In today's adventure, I paired with a developer who was having issues adding a set of XSD schemas to a .NET schema collection. The thing is that this class was deprecated after .NET 2.0 and the reader feeding it was also of the past.

The compiler told us so.

The thing is that although many developers are warned over and over again that they are using an old API function and to use X instead, they persist. They ignore that and many other warnings. This however is the most common one I see outside of warnings about variables being initialised but not used.

Your compiler is telling you this for a reason. It isn't because it has had a slow day or it is having a grumpy moment. No, it consistently warns you that there is a better way to do things now and even suggests how you should attempt this.

So, we solved our issue today by listening to the warnings and using the latest and greatest (be it 3 years old) and all was well.

Yes, we have evolved as a profession to obey our build errors and not check in a broken build to avoid the hisses and boos of our colleagues. Now we must grow to listen to the warnings. They are not wasted cigarette lighters at a Pink Floyd concert. They are not a gasp of exclamation in a sea of squealing teenage girls at a boy band concert. They are not platform high heels at a Kylie Minogue concert. No.

To be a better developer, you will listen to the advice you get from your build, your static code analysis and your IDE refactoring suggestions. You will do it because it will make your code better and more up to date. You will do it because it will stop the bad things happening that happened to those before you. You will do it because it will stop my soul from hurting.

Be it Visual Studio or IntelliSilly, your IDE is your friend. Your compiler warns that there be dragons and you must listen.

Sunday, 23 June 2013

Visual Studio Tricks - UML Validation of your Intended Architecture



Now for the third post from the series of Visual Studio Tools I Can't Live Without on using UML diagrams to validate your intended architecture.

Part of what I do when I run a code review is to extend it with a report on design divergence. That is when I look at what the intended application design was and what has actually been implemented.

This takes several long and probing interviews with the application architect or technical lead, asking questions about what they think has been coded. Then I look at the code at a high level, with more attention paid to sections with more complexity.

Sometimes it is pretty spot on. Sometimes it is very very different when we get in to the code.

As mentioned in other posts, I will use tools like dependency graphs to get a quick high level understanding of a code base. Another tool that Visual Studio gives me that I didn't have in the past is UML diagram validation of code.

Visual Studio has a project type called a Modelling Project that allows you to create different kinds of UML diagrams that communicate what your intended application design is or are created from code and show the implemented application design.

Again, there is a lot of documentation on how to create these diagrams. The main thing to know is that there are many different types of diagrams and once you put them in place, they can be used to validate the actual code.


Using these tools, you can reverse engineer a code base quite quickly and take in the high level design visually, which is for me the fastest way to understand an application architecture.

It is also quite revealing in that it can show boundary violations between components that cause future extensibility pain. In one case, we identified calls being made from the view directly to the data access layer, bypassing business logic layers. The architect there didn't realise that some of the less experienced developers didn't know they shouldn't do things like that.

Layer and Class diagrams are my favourites. The ability to drag and drop a file from the Solution Explorer in to the diagram makes them a breeze to create.

Once I have diagrams in place, I communicate to the technical leads how to continue to use and create them for regular checks and even in gated check-ins.

A picture really is worth a thousand words.


Thursday, 20 June 2013

Visual Studio Tricks - Dependency Graphs



In the second post of this series of Visual Studio Tools I Can't Live Without are Dependency Graphs.

When I conduct a code review or set up a gated check-in, static code analysis will give a list of all the things that are wrong based on a predetermined set of recommended practices. These are mostly superficial and not 100% indicative of whether a code base is bad or terrible or should be burnt to the ground.

Usually, people will look at the number of of errors and warnings found by static analysis to draw conclusions. These can often be the same issue over and over due to things like copy and pasted code, generated code or agreed practices that counter recommended practices.

In any code review I carry out, there is more than just a list of errors. There is an understanding of where those errors sit in the the scheme of things, how serious they are and if they are an indication of worse things to come.

To draw theses kinds of damning or freeing conclusions, an engineer must understand the code base. We have only days to get to this point so we draw on everything we can to help us with understanding what we are judging.

Years of experience will help.
A walk-through with the technical lead will help.
And a picture that speaks a thousand words will certainly help.

With Visual Studio 2012 (VS2012), I have embraced and celebrated the idea of Dependency Graphs along with Analyzers.

There are a lot of instructive posts about how you go about this. There is no need for me to walk you through it.

What I do want to do is make you aware that there is a way to look at the complexity in code in a visual way. You can find and explore circular references, unreferenced nodes and hubs which are highly referenced nodes.

One place this is valuable is in code reviews of pending change sets. VS2012 can filter to just pending changes. This allows a technical lead to ensure that unnecessary complexity is not introduced with bug fixes or added features.

If you need to understand how your code is connected then use this tool. You may even become dependent.

Visual Studio Tricks - Code Clone Detection



It seems that the tools I take for granted are not used by all. This is the first in a series of posts where I will be sharing some of my essential Visual Studio tools that every .NET developer should be aware of. If you already are then avoid me stating the obvious and go read something else.

Call me Code Review Girl and hand me a cape. In my role, it is common for me to travel the depth and breadth of Asia, Australia and New Zealand to conduct a code review and design divergence checks on very large government and commercial code bases.

Microsoft has internal tools that let us do that with great ease. This is always where we start. However, we often go further with remediation plans and sit with developers to show them the kind of things we found in their code that need improving. We don't just show them how to fix it but explain why these issues are issues and how they can be tracked down. In my case, I use pair programming to start. Teach a dev to fish and all that.

When I pair program with a developer, I will never let them copy and paste code. They can either type the whole thing from scratch or they can write a method and call it in both places. Copy and pasting code is an anti-pattern that will result in bloated code bases and often carried errors.

Now, that is all well and good when you are writing new code with another developer but for the times when you aren't watching and enforcing that rigour or for past crimes, Visual Studio 2012 gives you Code Clone Detection.

I won't go in to too much detail repeating what the link above explains but I will give you a quick summary of what you get and how to use it.

Code Clone Detection looks at code statements of 10 or more lines that appear in methods and properties across entire projects or solutions. It works on code with up to 40% of its tokens changed and with statements that have been rearranged.

There are two ways to use it:
  1. Highlight a specific piece of code, right-click and choose to Find Matching Clones in Solution; and find that specific code repeated; or
  2. Use the Analyze menu to Analyze Solution for Code Clones and find all occurrences of repeated code.
There are ways to exclude certain files like generated code and you will want to do that with large generated code bases.

I find this one of the most useful tools when looking at how to attack a large code base that needs a refactoring machete. This is a tech lead's best friend. Or at least one of them.

Let the clone wars begin.

Tuesday, 5 February 2013

ASP.NET MVC v ASP.NET

Having used ASP.NET MVC since it was in Beta in 2008, I am asked every time I mention those extra three letters why you'd bother moving a mature ASP.NET application to the new framework.

ASP.NET MVC is a framework that helps you build applications (note: I did not say web applications only) in a Model View Controller pattern. It breaks your applications presentation layer in to three distinct parts: The Model is the data. The View is the presentation. The Controller is the glue that holds it all together and manages interactions.

Traditional ASP.NET Application Architecture

In a classic ASP.NET application, the application logic is presented up to consuming applications through an ASP.NET container that returns web pages. If you want to access that logic through another consuming application that isn't web based then you implement web services that allow API access to that functionality. This is what you'd do to allow Javascript calls from your web application that didn't want to go through full ASP.NET page lifecycles to get standard HTML page data. Getting a JSON response is usual for an AJAX type call.



ASP.NET MVC Application Architecture

With ASP.NET MVC, one fundamental thing has changed. The ASP.NET application takes an HTTP Request and returns an HTTP Response of any type. That means that it can return HTML+CSS+Javascript to a browser if that is what it asks for or JSON or XML or any data format you want. It is just a generic HTTP response.

What this means is that you no longer have to build separate web services to expose application logic to consuming applications that do not want standard HTML. Those applications instead make requests and the ASP.NET MVC application is extended to process those requests and return whatever is required. The consuming application can be Windows-based, a mobile application, another web service or pretty much anything you can imagine.


There are a lot more differences between ASP.NET and ASP.NET MVC but this is an architectural one that will save you a lot of implementation time. Instead of wasting time on software infrastructure and scaffolding, you concentrate on writing business logic and exposing that business logic in consumable ways.

It is totally worth considering if you are have a greenfield project or are moving to later versions of .NET and are reconsidering ASP.NET.

Sunday, 2 September 2012

Preparing for Win8 App Excellence Labs

While running Win8 Application Excellence labs, I have seen developers hit similar situations each time, that take time away from the labs that could be used for more user experience (UX) and technical feedback.

These labs are sponsored by Microsoft Evangelists and executed by Microsoft Premier Field Engineers. We are trained and experienced in what a Windows 8 application built in the New User Interface should look like and behave.

The purpose is to enable developers as they prepare their applications for submission to the Windows Store.

You will hear people say that the labs are there to grant early access via developer tokens but this is not the case. Our primary purpose is to communicate a common understanding of the design guidelines (both technical and user experience) that make up the new Win8 user interface and underlying technology.

Over time, I have built up a list of useful links to help developers get their apps in to shape so they are most of the way there when they hit App Excellence labs or for when they submit to the store themselves.

Here are some links to help devs on their way to a well built and well design Win8 app...



Friday, 15 June 2012

A Lifetime of Events




Last week, I sat with a developer in an effort to solve an issue with broken Suspend-Resume handlers in Metro. The developer told me that he was getting inconsistent behaviour with his Suspend handlers and that he suspected a bug in the Metro framework.

When I got him to repro the bug, showing me how the error was caused and what the resulting output was, I found that he was not suspending and resuming but instead, suspending and on-launching.

He was exiting the application.

Metro triggers the suspend handler at that point. Suspend handlers run when you exit the application. Exit can be either suspending and leaving for a bit or quitting the application forever.

Now, one thing you should know about the Suspend handler is that it is paired with the Resume handler. If you can not see the Resume handler being called subsequently, after you add code to the Suspend handler then you are putting it in the wrong place.

The developer I was helping was putting his code in the wrong place. He was assuming that if he told Application.Current to persist something then it was so for as long as he waited to relaunch the application. He was wrong.

Web developers don't seem to hit this learning point but desktop developers do. It happens because they don't live inside life cycles. They have never been forced to understand that objects have lifetimes and you have to interact within the rules of that world.

When this developer called the Suspend handler and traced the persistance back to a file that stored the serialised version of his data, he assumed that it would be there when he started the app again.

That is an incorrect assumption.

Application lifetime lasts for the a the amount of time that the application is current. That means that when you launch it and when you exit it, the application is live. Outside of those boundaries, Metro does not guarantee anything. Files persisted to storage by the Application object are not always there and not always called the same thing. If it goes to disk, it could just as well go to memory and it is then just as fleeting.

There are matching pairs when it comes to exit-entrance handlers. With Suspend, you can count on Resume. With Exit, you can count on Launch.

Don't assume anything will be consistent, outside of the lifetime that your event belongs to.

If you want to ensure data or state persist then you must explicitly handle that persistence when it does not obey Application lifetime.

Thursday, 7 June 2012

Metro Design Anti-Patterns




Metro app development is young compared to other environments.

It is not a browser app.
It is not a Windows desktop app.
It is not an iPhone or Android app.

Although it isn't one of those well-known environments, it is built on two solid presentation layers. XAML from Silverlight fame and HTML+CSS+Javascript from well, everything-that-is-useful-on-the-Internet fame.

The technology space underlying Metro is not hard to adopt. It's the world from a Silverlight or web perspective with design constraints.

I have reviewed around 30 Metro apps in the last month and I keep hitting the same learning hurdles from the early adopting developers.

To start, developers that are early adopters are quite fearless. They march in, sometimes as canon fodder and sometimes as knights leading a rush. With this comes an exaggeration of all the things that could happen. An amplification of the mistakes and an enlightenment of the amazing successes.

Here are the patterns that I have seen so far in Metro application development and what you should think about when you build apps in this brave new world. This also applies to mobile devices in general.

Obey the Rules

Stay within the bounds of your framework and design constraints. If you have to exert enormous amounts of effort to achieve something that you think should be available then you might be doing it wrong. The guide lines are there to ease your progression, not counter it.

Some developers have a tendency to solve the same problem with every solution. They change languages but still write code that looks like their default language. They construct interfaces (programmatic of visual) that satisfied a past problem domain but don't satisfy the current one.

If you are going to change then change. If you don't want to leave what you know then stay with it. Concepts and constructs can be taken with you. Concrete implementations can not.

Metro is a new presentation layer but its strong guidelines are walls that don't entrap you but instead hold you up.


Don't Isolate Yourself

In a world where there is one dominant thing on their screen, users do not want to be locked in to that one thing. A feeling of isolation within an application is a major reason that users dump your app.

Often a screen shot is the only way to share out information from a mobile based app and there is often no real way to bring data in to the application.

Metro has the idea of Share Contracts. You can implements different interfaces quite simply that let others treat your app as a Share Target that can pull data in to your app or as a Share Source that lets you push data out of your app.

You can provide a multitasking operating system but without enabling easy sharing, you might as well promote isolation.


Move in one direction

Working with phone apps really restricts the dimensions in which you let your users scroll. Often returning to the larger real estate of a tablet makes people lazy or 'laxed or carefree because they forget the rules of touch and fall in to their old desktop ways.

Think about how you use a touch screen or watch a child and you will observe flick motions and movement in one dimension. Introduce another dimension and watch the confusion.

Google considers a link unvisited if you follow it and then click the back button and then click the next search result. Navigation is bad if a user moves in a direction and then moves back quickly because they didn't mean it.

Consider all of this when you build mobile apps.

Metro won't stop you from using multi-dimensional scrolling but the design principals discourage it.

If content is your primary navigation mechanism then don't distract from your content and purpose with confusion due to scrolling.



Let the guidance guide you.

Sunday, 3 June 2012

Windows 8 and Metro Development



Before we go any further... oh wait, let's start first. So before we start, let's get one thing clear:

Windows 8 and Metro are not one in the same thing. Windows 8 is an operating system. Metro is a tablet focused environment that runs on top on Windows 8.

When we talk about Metro development, we are talking about a set of design principles that are primarily focused on tablet and ARM devices and the powerful set of development tools that .NET now offers.

In the same way that iOS dictates that you will live inside it's pome ecosystem, Metro is guiding its developers through tools, libraries and UX guidance how to easily produce an application that is friendly to the touch world and still plays well with mouse and keyboard.

One thing I love about iDevelopment is that Apple has pulled the level of developers up again in to a world where you can wield the power of your respectable language with the aid of the brilliant Cocoa framework.

Metro is offering you the same thing but with the benefits of living in the Microsoft universe with access to a pool of technology, consumers and a development framework that is proven in all environments from the enterprise world to small teeny systems.

For developers, there is so much noise around Metro that it's hard to know where to start.

Start here...

Metro dev == (all things .NET) + WinRT + WinJS

Do not be overwhelmed. It's easier than walking in to a new language; going from desktop to web development; or learning graphic design skills. There are simple starting points that allow an attainable entry point.


Create a default project and then make changes to it and see how simple it is to start and produce a good looking, easy to use and robust application.

After running Microsoft Metro App Excellence Labs for over 2 dozen applications, I can only say that the less you fight the world presented to you by Visual Studio and the easy-to-interpret design principals, the better your app will be. As with all new interactive experiences, you may try to make it act like something you know better but it actually works better to let it be itself.

This is an echo of the advice I gave about writing iOS apps. Work with your environment. Learn what it does well and use it. Reinventing the wheel is self-validation for hackers.

Go forth and Metroply!

Tuesday, 11 October 2011

Too General


In the same way that we normalise and denormalise data in a relational database, we have to generalise and specify domain model design in the application.

Developers have a tendency to want to generalise things to an extreme but this often results in losing meaning. Whenever you see something called Object or Entity then it’s gone too far.

A co-worker and I had a discussion about creating a class called LookupItem to represent all reference data. There is no domain meaning in the term LookupItem. It is not a word that our business users would use so it isn’t a word we should use. If you find that commonality then let all your domain model classes inherit from a base class but still have their own class with a meaningful domain object name.

You will end up with lots of small classes but you retained a lot of meaning. Someone who walks in after you and goes to maintain the system will not have to read through the code and see what your named variables to see what a class is used for. It is in the class name.

There is also extensibility inbuilt in to this kind of structure. Often extensibility is required when there is an exception to a rule. Always build your generalisation so they can cope with exceptions to the rules.

Generalise but don’t lose meaning.

Friday, 23 September 2011

A Process for creating an MVC View of Partial View


Developers were adding New MVC Views to the web application project manually and that is an anti-pattern. We want to make sure that Controllers own Actions that own Views that are bound to strongly typed view models.

This is where this process comes from. ReSharper is required in this process.

Thursday, 22 September 2011

A Thousand Words


When I find myself explaining a concept over and over again to the same or different members of my team, it is a signal that I need to draw a picture.

Often, I draw the picture for a few people before it clicks that I should put it on an A3 piece of paper and stick it on a wall or take a photo and send it around in an email.

In the case above, I was explaining mapping between model classes coming out of different layers of the application. All sorts of words were being used to refer to these objects and it was getting confusing.

This image has given us an explanation of where mapping classes exist; what models coming out of different layers are called; namespaces to be used when creating or referring to mappers and models; and a common language for technical discussion.

To write that in a document would be long and cumbersome.

When you aren't explaining it in code, explain it in pictures.

Sunday, 4 September 2011

Quality Assurance is a myth


Anyone who stands before you and tells you that they can assure quality in your application is talking rubbish.

There is no way to achieve assured quality. Quality can not be assured. I was taught this by some of the best QAs in the world. Let me explain to you what they explained to me.

The first thing that people seem to tout when they instigate continuous integration, X driven development or employ a QA is that they can now assure quality in everything they build.

Let me break the truth to you. There is absolutely no way of ASSURING quality in anything you build. Ask the guy who forgot to used the metric system and caused the Mars Orbiter to crash. NASA has the strictest of all environments to assure there are no mistakes.

The way I build software is to ensure rigour. To ensure that the practices that are used in managing a team, gathering and expressing requirements, writing the code and meeting the acceptance criteria are so engrained and bought in to that quality emerges.

People speak of methodologies. I speak of rigour.
People speak of best practices. I speak of rigour.
People speak of theory and practice. I speak of rigour.

There is a distance between the project management focused Scrum and developer focused XP. Companies can sell you their flavour of this and that but the truth is that you need to find the way that works best for you.

Find that way. Find the practices and methods that bring the benefits to you and your company. Hold on to them and repeat them. Do them over and over in small sprints or iterations or bursts or waves. I don't care what you call them. Just find them and correct them as you travel. Allow yourself to be wrong and fail as long as you learn from it.

It's not rocket surgery. Consultants try to tell you it is. It's not. Good software can be built in a way that allows quality to emerge. It is a craft and as such must be built by craftsman.

Companies try to undervalue the craftsman and sell their solution. The reason is because they know that software is a true craft and it must be taught by a master craftsman to a novice. Great software takes great individuals. It takes guidance and a honing of skills. It does not come from big M methodologies or style focused companies.

If you want to build good quality software then find a very good craftsman and let them build a team. Let them teach the team. Let them guide your progress. Close your eyes and take a leap of faith. You will be rewarded.

Quality comes from great team work. Great practices. Rigour. Craft. Buy in. Pride in product.

This is why it seems random. You are looking for the wrong patterns. Find a great lead who enables and cares and you will build bliss.

Sunday, 14 November 2010

Don't Panic

This is not a new area of discussion for me. You will see that a theme runs through my views on software development. It can be summed up to two simple words and one large exclamation mark: Don't Panic!

There will always be deadlines - be they realistic ones or complete death marches.

There will always be defects - found in testing or left to the point of blowing up in a user's browser.

There will always be uncertainty - from not deciding what colour to paint the bike shed to wondering if you should ever have become a programmer.

If you plan on staying around in the volatile world of software then you are going to have to learn to take a few deep breaths and deal with the problem at hand. Fainting at the slightest sign of a challenge is not going to help you work through that issue. Remember that unless you plan on never waking up from your fainting episode then the problem will be there when you are offered the smelling salts.

Do not become one of those people who stands back and has some other calm person fix your issues. Instead, be the calm one. Be the go to person. When the fit hits the shan, don't join the throng of zombie fearing masses. Step back and remember that you are building software, not searching for weapons of mass destruction. A bit of broken code or integration issues will maybe cost some money or annoy a few customers but nobody will die. It is software and it can be fixed.

Rectifying a situation and solving a problem is important but jumping at it with reactions rather than sanity will not bring peace to you or the issue.

What can you do?

  • Walk away for a minute and get your thoughts together;
  • Don't make changes until you know exactly what the problem is;
  • Find someone to discuss the issue with. Explaining it to others can help you sort through it. They may also see something or know something you can't see through the haze of stress;
  • Let the people who are going to be affected know that their may be an issue and actions are being taken to remedy it; and
  • most importantly, DON'T PANIC!

Thursday, 4 November 2010

Take 2 Cygwin a day and call me in the morning


For developers who have never ventured out of their Windows environments and in to the world of UNIX based operating systems (like Linux and Mac OSX), the command line is an often under-utilised tool.

This is quite understandable in the case of the Windows command line that lets you relive your early DOS days. With all the lack of power of DOS, the command line was long ago abandoned for many mouse clicks and maybe once in a while a RUN command that is copied straight off the Internet and into the START->RUN control.

For the uninitiated, who have never dropped back to a command line or shell or who never even started there like us oldies, the commands look like line noise. Amusingly enough, those who were not Bourne from a shell probably do not even know what line noise is. Ahh, the days of whistling along to our high speed 9600 baud modems are long and lost along with bulletin boards and green on black screens. Those days are lost because the world has progressed to the point that you need not listen to the squealing down the phone line or force your eyes to work in a Matrix like world.

The good things haven't gone. The powerful languages that let their engineers create low level code like C and C++ are still around. Even if more and more amazing higher level languages appear, there will always be a place for the land of hardcore programming. They are needed. They are powerful tools. Weapons even. When wielded by good software engineers, great things happen. Of course, you do need the high level languages because who really wants to spend all their time perfecting memory management and automation of the reinvention of the wheel.

The other thing that will never leave us is UNIX land. The beauty and capacity of the UNIX tools will never become obsolete. They have been ported to every new environment to follow UNIX and implemented as APIs wherever possible. To live without these tools is for some developers, like cutting off a limb at the neck. It's a horrid disabled world.

Windows is one of these worlds that lacks the default access to UNIX tools. The DOS command line is not a poor substitute because it's not even in the same league. It's like comparing Java as a programming language to pig latin. It's simply a silly and meaningless comparison.

For those of us (usually .NET devs) who must play in an exclusively Windows world, we have a few ways around it. We either have a non-Windows machine at hand or we use Cygwin. Cygwin is a library that provides POSIX functionality in the Windows environment. You install it on any Windows machine (an install that takes at least four coffees) and it gives a UNIX like environment for Windows. The Cygwin commands look like UNIX commands but are actually wrapping Windows system calls that do a similar thing or have been extended to do so.

There are of course limitations to the scope of Cygwin that are based in the fundamental differences between the Windows and UNIX based operating systems. Pretty much, the foundations aren't the same so only so much can be faked. Often that much is enough to provide a developer with these much needed tools.

Now Cygwin on it's own is a nice little tool and a lovely idea but the serenity comes from all the tools that are built on this basic foundation. There are shells that let you believe you could be using bash; text tools like grep; and much more.

The zealots will kick me and say this is a poor replacement in a bad environment. I tend to agree but it's the best thing out there for us .NET devs. How any developer can live without it, is beyond my understanding.

You'll find Cygwin here.

Have fun.

Acknowledge Me

Apple started a user experience trend many iOSes ago when it accepted Settings changes and did not ask for confirmation. Once the chang...