Wednesday, December 05, 2007
Well this blog, the wiki and all the other associated services disappeared for most of today... thanks to the magic of NoAuth ... for no reason that anyone could explain to me beyond "it sometimes happens" - Orcon lost Authority over my business DSL connection, and it reverted back to Telecom/Xtra (New Zealands "legacy" telco)... and it took must of today for them to get the authority changed back, I don't think this was any fault of Orcons, but it still pissed me off no end.

So appologies to anyone wondering where my blog went, or any of the related services - I do have plans to migrate the blog to US servers in the not to distant future.  And big appologies to all the Architecture chat participants, sorry I couldn't get a reminder email out sooner.

On a different note - It did identify a need for me to maintain a secondary connection, with a static IP, that I can fall back to if required... thankfully the three concurrent projects that have been in UAT over the last couple of weeks have all wound down now - so it didn't have as much impact as it could of.

Though at least they wouldn't have been able to log bugs about servers being unavailable, Trac would've been unavailable too ;o)

... so any suggestions as to what would make an adequate fall back technology (something other then DSL, I've used wired country two-way-radio to the sky tower in the past which has worked well, but it doesn't give much "bang" for buck and has a high up-front cost last time I checked) ... I'm not too worried about 1 day downtime, but if this had been 3 or 4 days it would've been quite damaging for me, customers and those intangibles like reputation.


At any rate - thanks for the patience, and I'll see some of you at the Architecture Chat tomorrow.

Cheers,

 - Alex
posted @ Wednesday, December 05, 2007 10:34:04 AM (New Zealand Daylight Time, UTC+13:00)    Comments [1] | Trackback |

That's right, it's time for another Architecture chat Tomorrow

So as I mentioned last week - The Architecture chat is being held this thursday, 11:30am at Sylvia Park in Auckland (at Garrisons), all are welcome and encouraged to come along and share your views.

Some topics / announcements that have taken my eye over the last 3 weeks which might make good discussion fodder:

And some conversational topics related to what I've been working on lately...

  • Agile model driven development and just how can you combine model driven architecture (MDA) with test driven development and code-level refactoring.
  • Writing parsers using F#, leveraging pattern matching & Active Patterns – and integrating with other languages like C#.
  • Visual DSL’s – the good and the bad, and at what point does it become justifiable to roll your own for specific business needs?
If anyone has any topic suggestions either leave a comment or email/IM me (IM details are on the left, in the "Who am I?" section).

See you all tomorrow!

Edit: and as a late edition, I've also had a play/look into the very recently released Volta if anyone is interested - if you've got the time before xmas, I'd definitely suggest doing their quick start tutorial - interesting.

posted @ Tuesday, December 04, 2007 8:14:16 PM (New Zealand Daylight Time, UTC+13:00)    Comments [0] | Trackback |
 Sunday, December 02, 2007
So a quick observation on the alt.net conference list:

"You’ll be happy to know then that in the new WPF Composite work we are doing, the DI/IOC mechanism will be decoupled and pluggable. Actually the next version of Entlib will be the same. There’s a new Dependency Injection block that will allow you to plug-in the container of your choice."

Which was posted on the alt.net conference yahoo list by by Glen Block from Microsoft.

I think this is very good news, at least for the WPF composite work they're doing - it might make it a great deal more appealing to me then the CAB was (I was never a big fan of the CAB because it didn't integrate well with the other stacks of technologies that made me productive).

I'm fairly ambivalent about the Enterprise Libraries upcoming pluggable IoC support however - surely the overlap between it and the facilities and services already provided by the IoC container you'd be plugging into would be great ... and IoC is only part of that story... for a number of common services (i.e. logging, transactions etc.) you're going to have create appropriate wrappers and sandwich things into the containers "abstracted" view of the world, or face tightly coupling your application to the Enterprise Library, I'm not sure there is much of a value proposition there... though I'm open to being educated if any P&P Microsoft people happen to read this.

Interestingly enough has picked up on this slip from Glen and noted that it also implies Microsoft are writing yet another IoC container that will probably ship with EntLib & the WPF composite work (in whatever shape it eventually takes) and they ask the question "why oh why!" .

Personally I think it makes good sense to provide an out of the box IoC container, with it the product is far more accessible to new developers and people reviewing the technology - especially when you consider that:
  • If support was added into say the Castle Windsor container, it wouldn't see an official release until RC4 was made public - and until then would be in a state of flux as part of the castle trunk.
  • People would expect Microsoft to "suggest" an OSS container that works best with their offering - and playing favorites with the .Net OSS community could only do harm to the ecology I feel.
  • Microsoft retain consistency with their existing approach of providing an entire stack of technologies for you to get the job done, if that's what your like/want or are told you want. 
  • They can provide a set of consistent tutorials and training materials for developers to "get up to speed" with for the product, without having to provide umpteen alternative examples for different containers, or explain why the container terminology is slightly different to the product terminology.
So in short, I think it's a positive sign, not a negative one, even if another container is introduced into the mix - I'll be interested in seeing just how they do it (both the container, and the extension points to allow for plugging in a different container)... Though it could just be a hack using IServiceProvider, I wonder if perhaps they may need to go a bit further, so they can register services into the plugged in container with the appropriate lifestyle and configuration etc.

Edit: I just noticed Ayende posted about this as well...  he seems pretty well aligned with the "why oh why" viewpoint, perhaps I'm missing something - but I just don't see it being all that practical in some scenarios to provide a product that wont work without the developer going through a separate selection process to pick an IoC container, if they don't already use one from the OSS community.
posted @ Saturday, December 01, 2007 11:08:07 PM (New Zealand Daylight Time, UTC+13:00)    Comments [1] | Trackback |
 Friday, November 30, 2007
clock_stopped.png

My vista64 clock has stopped in the system tray... the funny thing is Renee (My Fiancee for those who don't know) has been asking me for the last half hour what the time is... and I've kept responding almost 11:30...

I hope they fix that in Vista SP1 - Damned if I'm getting a wall clock for my office!


posted @ Thursday, November 29, 2007 11:13:43 AM (New Zealand Daylight Time, UTC+13:00)    Comments [2] | Trackback |
 Thursday, November 29, 2007
So I'm learning F# in my spare time... I don't have much of that however.. so I kinda squeeze it in where I can, so I'm not progressing as fast I would like... None the less it's quite an easy language to get up to speed with, even as I stab at it blindly for half an hour a week... but some fundamentals can really trip you up when you're starting to learn and experiment without having developed a good mental model of whats going on... being a wannabe "expert" in the .Net framework and BCL doesn't necessarily give you much of edge when your moving from an imperative to functional programming language.

To that end this post is going to cover some really trivial observations, so for anyone that actually knows F# it's probably going to be pretty boring... and you might as well read something else ;o)

Anyway.. so, first off lets take evaluation order.

In C# I might write some code like so...


char
[] characters = new char[] { 'A','B','C','D','E'}

 

foreach (char c in characters)

    Console.WriteLine("character: " + c);


Now in F# I could write something similar...


let
characters = [| 'A'..'E' |]

 

for c in characters do

  print_endline "character: " + c.ToString()


But it wont compile... because it's evaluated/applied from left to right, so it equates to (print_endline "character:") + c.ToString() ... which can't compile because print_endline returns a result of type 'unit' (think void... though it is actually a return value)... thankfully it's a compiled language so these things are picked up immediately - but it can make for silly/confusing compilation errors when starting out.

Now, moving on from there.. past experience has also helped screw up my mental model... for example iteration related functions - if I was going to write an iteration function in C# the approach would generally be to do something like this:


public
void ForEach<T>(IEnumerable<T> items, Action<T> action)

{

    foreach (T item in items) action(item);

}

 

string[] words = new string[]

{

    "somewhere", "on", "earth", "little", "kids", "teach", "themselves",

    "a", "whistling", "sound", "to", "imitate", "bombs", "dropping"

};

 

ForEach(words, delegate(string s) { Console.Write(s + " "); });


I had the expectation of finding replicas in the F# built-in functions like List.iter etc. - in fact I even wrote code like this to start with, assuming it would work in the same manor.


List.iter words (fun word -> print_string (word + " "))


After that didn't compile I just swapped the parameters... it worked... but I saw some unusual behavior when stepping through it with the debugger... and it required further inspection... looking at the signature for List.iter revealed that it was actually a function that returned a function ...  ('a->unit) -> (list 'a -> unit)... hmmm..

So it turns out most of the built-in functions take a single function and return a function... so unlike the C# equivalent, the F# foreach would look something like the code below (though I suspect an F# guru might be able to write it in a more terse manor).


let
words = [ "somewhere"; "on"; "earth"; "little"; "kids"; "teach"; "themselves";

    "a"; "whistling"; "sound"; "to"; "imitate"; "bombs"; "dropping" ]

 

let foreach f  =

  let rec foreachInList l =

    match l with

    | head :: tail ->

      f head

      foreachInList tail

    | _ -> ()   

  foreachInList

 

let n = foreach (fun word -> print_string (word + " "))

n words

 

// or

 

words |> foreach (fun word -> print_string (word + " "))

 

// or

 

foreach (fun word -> print_string (word + " ")) words


It took me a minute or so of going hmmmm to absorb the beauty of that approach... obviously this is bread and butter of a functional programmer, but for a non-functional programmer like myself you tend to just see twice as much "work" going on (two function calls for starters).

Take a look at the second way of calling foreach... in this case |> applies the RHS as a filter on the LHS... because the function takes a single parameter we can do this easily.. but we can also chain them together... so we could alter our foreach function a smidgen:


let
foreach f  =

  let rec foreachOnList l =

    match l with

    | head :: tail ->

      f head

      head :: (foreachOnList tail)

    | _ -> [] 

  foreachOnList


So it's signature is no longer ('a->unit) -> (list 'a -> unit) but is instead ('a->unit) -> ('a list -> 'a list) ... now I can chain calls to my foreach together...


words
|> foreach (fun word -> print_string (word + " "))  |> foreach (fun word -> print_string (word.ToUpper() + "_"))


I really enjoy the elegance and simplicity of the filter syntax... if you replace the anonymous functions with functions you've already declared it suddenly becomes pretty, I think it reads nicer then chained extension method calls / fluent interfaces in C#.


let
capitalize (c: string) = c.ToUpper()

let pad c = c + " "

 

words |> List.iter (fun word -> word |> capitalize |> pad |> print_string)


At any rate, my half hour of F# exploration is up for the week.

posted @ Thursday, November 29, 2007 9:08:32 AM (New Zealand Daylight Time, UTC+13:00)    Comments [0] | Trackback |
 Wednesday, November 28, 2007
I came across this blog entry and to me at least, it just seems wrong?

To quote:

"These are two very different uses of the term that I've heard and both are explicitly not "automatically" in the true sense of that word. The point of automagically is when its not automatic at all and either you don't care (case one) or its a lie (case two). Now if people agree I'll update the wiki entry but I thought I'd first check what others had seen."


Perhaps I've been misinterpreting the use of the word, but In development circles I've always taken it to mean a process that does work automatically, as if by magic - potentially with a hint that there is definitely "magic" involved, i.e. perhaps what's happening automatically is not deterministic or a little dodgy (a hack), or is is in some way cool/extraordinary i.e. table names being pluralized automagically from their associated entity class names in an ORM, which when I first saw it done many years ago was "magic" by comparison to having to specify the pluralized names by hand.

Is this really a negative term suggesting that somethings not automatic at all? Is my whole life a lie? (Don't answer the second one ;o)
posted @ Tuesday, November 27, 2007 9:01:55 PM (New Zealand Daylight Time, UTC+13:00)    Comments [2] | Trackback |
stump
I’ve seen a few posts flying round between Ivan (1,2) and Ayende (1) re: meta programming in C# v.next and the implications of it being a statically typed / pre-compiled language...

It’s an interesting thought, but I can’t help wondering if implementation of a rich meta-programming environment in C# - allowing changes at both a class and instance level at run-time - wouldn’t go against the original spirit of the language itself, for me at least I’d be looking for a different language if I yearned for meta programming on a daily basis... one that was built from the ground up with my desires in mind.  Take a moment to consider if C# had been built with meta-programming in mind from the outset, would we have bothered with declarative attributes?... ruby seems to get on fine without them (well at least until you try to integrate ruby with Java or .Net libraries)... and what about interfaces, what’s the point of them?

Language spirit is an interesting thing – I don’t think it’s something intangible (this is science after all), but often it’s something that’s difficult to put into words, because it’s a feeling coming up from a rapid and subconscious judgement call as you work with a language (ah la Blink) – it’s also something that’s difficult to appreciate until you start sitting down and thinking about writing a programming language of your own (what you haven’t? For shame!)... and it builds an immediate appreciation for languages like C# and ruby and there founders – there are lot of difficult decisions, compromises and reasonable defaults that need to be decided on – and a massive amount of jiggling to make sure it all fits well together – so that you can finally identify the essence of the language – and worst of all you’re not just having to satisfy your internal subconscious judgement calls, but a large audience in the development community, so that your language will be adopted by people because it feels "right" to them.

I still gravitate towards programming language pragmatics as a good book for examining the spirit of languages throughout the years and guises – it's definitely a book computer science student’s should all be armed with on their first year, though I doubt many will be interested in the nuances of Fortran today.

Now, following up on that – I’d like to contrast meta programming with functional programming... are we in need of meta programming as we move towards a more functional approach by necessity (to reduce the overall complexity of software, and take better advantage of existing/emerging hardware by working at a higher level of abstraction, allowing for judgment to be made on our behalf i.e. about parallelization) and what makes more sense for a language like C#?

Personally I see C# moving more and more towards providing a pleasant bridge language between the imperative world and the purely functional word (weighed in favour of the imperative world, where as F# is weighed in favour of the functional world) ... and as such it makes more sense to me at least to draw inspiration from that domain, then dynamic languages and meta programming... just my opinion of course. 

Given the time frames between C# versions – IronRuby should be mature enough by the time c# v.net arrives that it should be a moot concern, and IronPython is already pretty capable in the meta programming stakes as well, if you can hack the whitespace sensitivity.

Funnily enough (and this a bold claim I know :) – but I think the pattern matching support and associated features in F# would prove far more valuable tools for solving many of my day to day problems in C# than meta programming would be, when I take a subjective look at the code I write and the goals it’s generally trying to achieve combined with the existing features and practices I’ve already embraced in C# (IoC/DI) it looks to "click" together in a much more cohesive manor.

Thoughts?
posted @ Tuesday, November 27, 2007 8:01:50 PM (New Zealand Daylight Time, UTC+13:00)    Comments [0] | Trackback |
 Tuesday, November 27, 2007
Just a quick note that the Architecture chat that was scheduled for this thursday is going to be postponed until Next Thursday (December 6th) because I'm unavailable this week.

I'll post about it and email the dot.net.nz user group (for you non-subscribing philistines :) next week to remind you all.

See you all next week!

posted @ Tuesday, November 27, 2007 9:15:32 AM (New Zealand Daylight Time, UTC+13:00)    Comments [0] | Trackback |
 Thursday, November 22, 2007
I'm not going to be around Thursday next week to host the architecture chat...

There are a couple of options:
  • The show goes on as usual, and someone else can flick me a brief summary.
  • We reschedule for another day (Wednesday or Friday)
  • Have it the following Thursday (December 6)
Let me know what everyones preferences are...

Chez,

 - Alex

posted @ Wednesday, November 21, 2007 7:03:28 PM (New Zealand Daylight Time, UTC+13:00)    Comments [0] | Trackback |
 Tuesday, November 20, 2007


For those that are interested, there is an Enterprise Architect Symposium being held in Auckland and Wellington at the end of this month (Thursday 29th November in Auckland, and Friday 30th November in Wellington) - click on the image or link above to see a schedule or to register interest.

There are some interesting nuggets there for an architect/analyst, especially around model driven architecture/generation and UI/UX prototyping - with people presenting from Sparx Systems in Australia (the company which develops Enterprise Architect), Catch Limited and a number of business in New Zealand including the North Shore City Council and IAG.

posted @ Monday, November 19, 2007 7:44:35 PM (New Zealand Daylight Time, UTC+13:00)    Comments [0] | Trackback |
Search
FeedCount

Tags...
Who am I?
Alex Henderson
Alex Henderson
Auckland, New Zealand
Managing Director at Dev|Defined Limited

"Self Confessed Coding Junky for 15 years"
View Alex Henderson's profile on LinkedIn
 
Mobile: +64-21-402-969
Email: bittercoder 'at' gmail 'dot' com
MSN: bittercoder_nz@hotmail
Skype: alex.devdefined
Navigation