It's been a long time between posts. I'm currently finishing up a project and moving on to a new client so I thought it would be a good time to document a few things I've (re)learnt along the way. The project I've been working on is for a large travel web site. In 6 months we have : - Replaced the backend web services with WCF services and connected these to new external providers and databases
- Upgraded the site from .Net 1.1 to .Net 3
- Replaced 60% of the pages and changed the rest
- Added significant AJAX functionality and lots of client scripts (JavaScript)
- Fixed numerous issues and bugs
Here's a list of my lessons in no particular order. MS AJAXThe new pages are composed of many integrated user controls, some of which use ajax functionality. UpdatePanels can cause grief to client side functionality and tracing the interaction can be a nightmare. Tip: Keep it simple! Only put update panels at the page level. Only have PageMethods and WebServices called from the page. Use properties and events in user controls to bubble up control to the page - or better yet use a strong MVP or MVC pattern. ASP.Net server controls can also frack with your brain. I would love to try creating a site totally without server controls and just use AJAX. I Love JavaScriptI could do it all day! Langauges like C# & VB.Net are certainly rich and powerful but JavaScript is small and elegant. Of course, you wouldn't want to debug a 5000 line JS file too often (and we had a few of those!). WCFWCF is very easy to use and configure but you can end up with some huge network traffic issues very easily. Try to keep your data contracts as small as possible. Compression helps. Visual Source SafeDont use it if you have any choice. Don't get me wrong, I actually like VSS for small 1 or 2 developer projects. My biggest issues are: - Exclusive checkout is a real PITA with devs in another room or building. Sure, you can do non-exclusive checkout but...
- It still doesn't play nicely with Visual Studio at time.
- It's slow
- I don't trust it because it does some really weird things
Task TrackingThis project would have benefited hugely from having Team System available. I really miss not being able to create work items when I find something wrong or need to remember something to do later. We are suffering at the end of the project because a few issues had been forgotten or deferred. Of course, you don't need VSTS to track your todo's but make sure you have somewhere to record things on the fly. Don't use email to tell your BA or PM - they are just as forgetful as you are! EnvironmentAlso take the time to setup a decent development and test environment BEFORE you start coding. We lost many days due to problems with the development server - too many projects using the same server, poor performance, lack of control etc. Web Application Projects
The file based web projects are ok for simple things but Web App Projects give you settings and properties and a few other nicities. I'm stuffed if I know why MS ever dropped them from VS 05. CSS & HTML Must Die
There has got to be a better way. CSS & HTML are ridiculously imprecise. I'm yet to meet anyone who can sit down and design a web page from scratch that is gaurenteed to work on all browsers and look like they expect it to (except for the simplest of pages). I'm sure there are a few genius designers out there you can do this, but they are few and far between. FireFox & FireBug
FireFox with Firebug is an awesome development tool for client side debugging. You can use FF to debug from Visual Studio by specifying it as the external startup program in your project web settings. Be Stong. Stay TrueSometimes you are asked to do things that you know are wrong. A good argument does not always convince a closed mind. Stay true to your beliefs but do what they want anyway - safe in the knowledge that you will have the last laugh.
Creating deployment documentation for .config file changes is a freek'n nightmare and something that should be automated as much as possible. I haven't found a tool that does this completely as I want but there's a number of XML Diff'ing tools around that do the hardest part of the job. I just found this one on MSDN. It's a little old now but it comes with source and it's fast and simple.
Ideally I'd like to be able to have XMLDoc comments in .config files and then generate some help from this - much like you can do with NDoc or Sandcastle for your code files.
Enough is enough. Outlook 2007 on my Notebook is just way too slow and bloated. In fact it's also causing me greif on my work desktop. I'm sure it's hardware and/or OS related (Vista on the Notebook and 2003 at work) but I just cant be bothered any more. So, I've migrated my domain email to Google Apps so I can dump Outlook. Time will tell if this was a good move or not - I'm not a fan of using Web apps for mail and desktop type work but there doesn't seem to be any other choice. The only problem I have now is hooking up dasBlog to Google Mail. I sometimes use email to post blog posts but I generally use Windows Live Writer. I can't get this working with dasBlog 1.8 at present - the SMTP notifications also fail. If anyone out there knows the settings to get this working,I'd love to know!
We are still hiring like crazy - or at least we would be if there were enough suitably skilled developers around. It makes it really hard to hire with so many great employers - now is a fantastic time to be looking for a development job!
If you are interested in working for Intergen then please don't be afraid to give me a call or email and I'll tell you what a fantastic company Intergen is.
Unless it was an April Fools email, I was re-awarded MVP status over the weekend. Once again, I am very grateful for the recognition for doing things I just enjoy doing. However, this is likely to be my last award as I'm pulling back on my user group and community involvment this year. Life is too complicated and I dont have the time and energy to do a good enough job. My wife also tells me I need to get a new hobby so I'm thinking about building something... not sure what yet, but I have a few ideas.
Resharper is great. It includes so many neat tools and shortcuts that it really is hard to argue that it's the best Visual Studio productivity tool available today. So - why do I hate it so much? 1: A lot of the tools are better versions of the standard Visual Studio versions - refactoring, templates/snippets etc. I find the VS versions good enough. 2: There's 3 pages of keyboard short cuts to remember if you want to use Resharper effectively. I have enough trouble remembering Ctrl+C to copy. 3: It's sooooo f-ing slow! VS runs like a complete dog when Resharper is installed. All those productivity gains are pointless if you are waiting for VS to respond. 4: It's noisy. I like VS clean and simple. I dont like all the Reshaper crap over the screen interfering with my train of thought. 5: It's a little buggy - well, I cant say this for sure, but I think it suffers from trying to be too clever and sometimes it gets things wrong, especially with ASP.Net tags. So, this time I managed to keep it on my machine for 3 days before removing it. I'll try it again in another couple of versions.
I'm back into VSTS with a vengence this week and I just read some announcements that I heard at the Summit that now appear to be public. Unit Testing to be included with Visual Studio Pro I never understood why it wasn't in pro to start with - my personal opinion is that it was interference from Marketing that drove this decision. Thankfully, Marketing also took note of the thousands of complaints and they have done the right thing. I fear it's too late though. Most dev's I know prefer NUnit. NUnit and it's add-on's have progressed a lot in the last couple of years so it's going to be hard for TS Unit Testing to regain ground. I'll be using it though - mostly for compatibility with Team Build. Looking at the road map for Orcas it's pretty clear that Orcas will RTM sometime towards the end of this year. This is the message we got at the Summit. Rosario includes a lot of new features to help with bigger teams and projects. Some of the features will be really useful for ISV's such as Intergen - we find it an ongoing battle to calculate future resource requirements. Having a tool that will help do this will be very useful. TeamPlain Microsoft has acquired TeamPlain, a web client that provides access to work items, source control etc. This is fantastic news! I love TeamPlain but could never justify the extra expense of it. Now I wont need to. Event better, I can get it now!
Just spotted this MSDN article on Asynchronous ASP.Net coding. It's a must read for ALL ASP.Net devs - weather you are creating a TradeMe killer or MySillyLittleSite.com.
Highlight: Utah - most any part of Utah is stunning and truly awesome. The desert is beautiful and quite unique to a Kiwi - we don't really have any deserts here. Bryce, Glen Canyon and Zion National Parks are very pretty but I wouldn't want to be there in busy season. Lowlight: Las Vegas. It takes about 1 hour to realise what a scummy place it really is. On the outside it looks interesting but as soon as you walk into any of the hotels on the strip they all look identical - full of sad pathetic losers glued to brain washing machines. I just hate all casinos... Highlight: The people are friendly and actually quite normal! Highlight: Apart from Seattle the weather was clear and hot - which is apparently unusual for March. Lowlight: San Francisco - I feel violated! For a big city it's not bad but we had a hotel in a very seedy part of town and we were constantly pestered by street bums, beggars and people trying to sell stuff. Waiting in line for a cable car we were hassled by 'entertainers' and beggars - not my idea of a great time. Highlight: Seattle - despite the weather I like Seattle. It has a nice feel to it despite having it's fair share of street people. I didn't feel as taken advantage of as I did in San Francisco. The pace seems more relaxed there too. Lowlight: Grand Canyon. From the air this is breath taking but like most of the USA, it takes more time to absorb than most people have in a life time. We only had 2 hours to spend looking over the edge but I felt it was too commercially exploited compared to Bryce or Glen Canyon. Lowhighlight: It's not that expensive. It's a lot cheaper than Europe or the UK for a holiday and certainly very easy to get around. Highlight: Driving in the USA is a joy. The roads in Utah, Nevada and Arizona are long, wide, mostly straight and not too busy. We drove about 1100 miles from Salt Lake City to Las Vegas in 6 days. Our biggest trip was about 450 miles on the first day which was a very leisurely 8 hour drive. Sticking to the wrong side of the road was a lot easier than I thought it would be. We spent most of our time in the Utah desert so overall, it was very happy experience - the lowlights of Las Vegas & San Francisco where very minor in comparison. We are thinking about Vancouver and/or Colorado for the next trip - once we pay for this one.
I’m a little late blogging about the MVP Summit – it finished on the 15th – but I’ve only arrived home yesterday. The wife and I took the opportunity to do some tripping around – more on this later.
The Summit this year was great. It was very well organized, the venue’s – Seattle’s Convention Center & Microsoft – were spacious and accessible. Transportation was very easy and well organized this time.
As usual, we also got to here from some great & famous speakers, including: Bill Gates, Anders Hejlsberg & Scott Guthrie – all of which were highlights in one way or another. We also got to learn about a few upcoming products and new releases – much of which I cannot repeat here – but here’s a few teasers.
- Orcas – there are a lot of nice new features and enhancements in this – particularly around testing, Javascript, AJAX, design etc. Debugging and development Javascript is a place I am very keen to see enhancements on and we saw some nice demos of improvements in these areas (including a fix for a long running complaint from many people). I think the March CTP has some or all of these features included already so check it out.
- ASP.Net v Next – Scott talked about and demo’d a few new features of the next version of ASP.Net in Orcas. Again, I think this stuff is probably in the March CTP but without looking I’m not willing to risk the lawyers! Lets just say that you will see more code-less provider model type things a some new controls that will save you a LOT of coding.
- LINQ – Anders did a great demo of LINQ for Objects & SQL. If you have been living in a cave and not heard of LINQ or have been ignoring it then RUN – don’t walk – to your nearest search engine and learn as much as you can about it now! LINQ will change the way you work with objects and data in ways you may not have realized… eg PLINQ.
- AJAX – Scott demoed some of the new Orcas features for AJAX. He also detailed some features of the current release I was unaware of, including pageLoad(). There’s a great blog post here that shows how to use this and some other nifty features.
- Team System – Rosario is the code name for VSTS after Orcas. There’s not much public information on this so I can’t say anything but the very few tidbits I did here about it sounds intriguing. Use your imagination and look at some of the research and tools the team has been talking about and you will get a fair idea of where they are heading.
- Lastly, some estimated delivery schedules were mentioned for Orcas & Longhorn… and I’m certainly not going to repeat those but it’s safe to say – I think – that by this time next year I’ll be blogging about Orcas SP1 :]
Here's the sample code from User Group demo I did this week on using JSON & ATLAS to create lightweight asynchronous web pages.
Enjoy!
JSON.zip (20.48 KB)
If you are into small devices in a big way then you should take a look at the new .Net Micro Framework, which will be released very soon. You can run this on your watch or similarly tiny devices as long as you have 300k RAM and 1M flash. There is a LOT of stuff missing from the MF but you generally wont want to do most of that sort of stuff - e.g., database access. As with the compact framework you can use Visual Studio to create, compile and debug via emulators, then deploy via USB or serial connections.
One aspect of this I find very intriguing is that the MF is self bootable - i.e., you don't need and OS.
Can you think of a use for this?
According to RNZ this morning rumors are spreading - again? - that Telecom's CEO, Teresa Gattung, is very likely to quit the job soon. Under her guidance, the company has managed to nearly halve it's share price, alienate a nation, invoke legislation, relegate us to 3rd world status and generally piss off a lot of customers and staff.
Well done Teresa! You've earned a nice long retirement.
Next month I'm off to the Global MVP Summit. This is a semi annual event for MVP's and provides the opportunity to meet with the product teams - yes real Microsoft developers and managers - plus some of the top execs. This year, Bill Gates is presenting the keynote - last time, Oct 2005, it was Steve Ballmer.
So, I've been thinking a lot about what I want to see and say during this 4 day pilgrimage. Here's my list thus far. I'd love you to add to it! Tell me what is important to you and I will endeavour to ask the right people and get an answer.
Orcas
- anything about Orcas, esp. Team System. At the 05 summit we where asked about some of the wizz bang new stuff they were thinking about putting into Orcas and beyond. It will be interesting to see how much of these ideas made it to a real product. At the time I was very excited by some of these ideas, particularly in the debugging area.
SQL Server v next
- it's hard to see how they could improve on SQL 05 in any major way but apparently the next version is under development.
- what's the future for WF, WCF & WPF?
- the expressions tools are very impressive. How will these fit in a development team currently using Visual Studio? Yes, I understand the promise but it would be good to here about the reality. I seriously worry about mixing developers and designers :)
Languages
- C# 3 is changing in many ways. The language gods are certainly taking note of functional and dynamic languages. It's hard to separate the language from the tool some times - i.e., what is C# like if you only have Notepad ? Will it be impossible to use C# 3 or VB 9 without Visual Studio or one of it's spin offs? Not that I would dream of doing this you understand, but I think it's an indication of the level of purity in the language.
AJAX & JavaScript
- I have a few issues with AJAX and the Asp.Net platform. I need to know if this is just me or not. Also, I have an idea for working with JavaScript in Visual Studio - I'd like to see if Microsoft have the same idea. I'd like to have Visual Studio provide better support for js files - the intellisence is not as good as it could be, but more importantly I'd like to have .JSX files - these would be JS files but with the ability to include server controls and markup (<% %>). So you'd have a CS or VB code behind file for them - this could also be the same code behind as the ASPX/ASCX that uses the JSX file.
Software Factories
- we have software factories for web services, web sites, smart client. What's next? What about EFx? I'd like to see this in action.
Can you add to this list? Please comment and let me know.
Oh, just remembered. Most of what we discuss and see at the summit is provided under a non disclosure agreement so I can ask your questions, but I may not be able to tell you the answer - at least not precisely :)
Well, not really free, but a great way to get Vista or Office is to attend the 2007 Technical Briefings. There are some good looking sessions there for developers. I'd reccommend attending the Sharepoint sessions in particular. This is a fantastic platform for back-ending many types of applications - it's not just for departmental intranets.
It's also a great event to smooze with local devs and business people. Unfortunately, I'll be out of the country for most of March so will miss it.
Go get it now!
ASP.Net 2.0 AJAX Extensionis officially RTM.
There's a few minor
changes from the release candidate, most notably the removal of the validation
controls, but it's a pretty simple upgrade.
Yet another reason
to use IIS and not the built in web server in Visual Studio (Cassini). I
have some PageMethods I'm calling from the page that tell me the progress of a
search. In Cassini these calls queue up while the async search methods are
running becuase it does not know how to handle multiple requests
concurrently.
Also, Cassini always
has Windows Auth turned on. It ignores the NTLM Auth setting in your
project.
I do find Cassini
fine for simple web pages though and I use it on my notebook for small site
development without problems.
Well, the ‘5 things about me tagging game’ has finally caught with me, thanks Darryl. I did miss your link though as I’ve been spending a lot of time lately getting Vista working sweetly, working on a couple of web sites and preparing a presso for the local .Net User Group - which conveniently gave me plenty of time to think about the 5 things – just in case I got asked. So here goes.
-
I lived in Sydney for a while in my youth and drove a cab for a year. Famous fare’s included Tim Finn, Barry Humphries (thankfully not in costume) and Yana Vent (spelling?) (but you have to be Australian to know her). Other interesting jobs include TV Aerial Installer, Bakers Assistant, Storeman, Egg Collector, Night Porter, Barman, Bouncer, Telephone ‘Operator’.
-
I live about ½ an hour out of Christchurch and have a lifestyle block with 500 or so olive trees, 3 kids, 8 chickens and 2 cats. Oh, and a wife :]
-
I seem to get sucked (?) into starting user groups and community ‘things’. I started the Christchurch Clipper User Group back in the early 90’s and I STILL think Clipper is a great development language.
-
Most exotic(?) place I’ve been to would be Brunei. My most favorite city? Have to be Florence. I spent a few days there about 18 years ago. Definitely want to go back and see more of Italy. Scariest place I’ve been? Johannessburg at night.
-
I hated school. I’ve never attended university and didn’t get UI either. Consequentially, my kids get off too easy from homework.
I’ll need to do some research to see who hasn’t been tagged yet. I’ll update this post later.
I've been doing a lot of fun JSON stuff lately using ASP.Net AJAX (aka ATLAS). This really is Fun with a capital 'F' but I struck a small problem today.
Given the following C# class:
public class PageData {
public string Name;
public string Address;
public DateTime DOB;
...
}
I serailize this to the page thus:
C#
protected void getPageData() {
PageData pd = new PageData("Peter Jones", "New Zealand", DateTime.Now());
return "(" + JavascriptSerializer.Serializer(pd) + ")";
}
ASP:
<DEFANGED script type="text/javascript">
var pagedata = eval('<%= getPageData() %>');
</script>
Now this works fine for all data types except DateTime. When you serialize a DateTime you get a value in JSON like this:
@7895678963897@
This is the number of milliseconds since 1 Jan 1970. When this is de-serialized with eval() you just get a string.
Instead of using eval() you need to use Sys.Serialization.JavaScriptSerializer.deserialize().
Update
This appears to have changed in the RTM release. Dates are now serialized thus: /Date(millseconds)/. However, I cant get this to deserialize using Sys.Serialization.JavaScriptSerializer.deserialize() so have reverted to using a string in yyyymmddThhmm format, which Date.parse() will happily convert.
I was reading a post from Rod about Telecom's stupid idea to sell Yellow Pages. I couldn't agree more, it is a dumb idea, but I have a more cynical POV on this. As a (very) small time share hold who bought at $8.60 I'll be very pleased to get some money back - even if it's just $0.25 per share.
Bad company decisions from bad companies and bad management hasten the demise of the company. Telecom is long overdue for annihilation. Govmint legislation and stupid ideas like this are a good thing if they lead to the death of Telecom - provided that it's a slow lingering death that gives the employees, vendors and customers time to 'adjust'. So I'll be sending a thank you note to Ms Gating and encouraging her to stay on for another few years. Think of all the future cock-ups we will miss out on when she leaves!
Heros by peter@jonesie.net.nz
I watch more TV than I really want to and I
generally hate most of it (note to self – get a life!) but one show I’ve
been watching recently (downloaded rather than live) is Heros. I see TV3
is playing this from next week. If you can’t get the clean HDTV
downloads then bear the pain of the advertisements and watch this show.
It is excellent – a great story with lots of twists and turns.
Holidays are great. You get lots of time to do all the work you don’t normally have time for. Yesterday I finally got around to upgrading my notebook to Vista from XP. Here are a few things I did that made the job easier.
-
Upgraded the RAM to 1 Gig. Previously I only had 256 + 128. How I have 1024 + 128. This cost $279 from Global PC. The tech in the local shop fitted it for me. I’m sure I could have found something cheaper on the Interweb but given the usual no return policy on RAM it’s sensible to let someone else take the risk.
-
Used the Vista Upgrade Advisor. This told me that I would have some compatibility issues with Visual Studio 2005, SQL 2005 and a few other items but that I could install anyway. It also told me that Aero wouldn’t work with my Graphics card which surprised me a little.
-
Downloaded Vista from MSDN. Thanks to Telecom’s Go Large / Go Slow plan this took 10 days for 2.5 GB. Thankfully though, the MSDN downloaded ensured that I had a clean uncorrupted download. Burnt this image to DVD.
-
Installed Business edition using the upgrade option rather than a full install. I figured I could always do a clean install later if I wasn’t happy with the performance or setup.
The upgrade took about 2½ hours. Once finished I uninstalled a bunch of stuff including Visual Studio Team Suite, SQL 2000, SQL 2005. For the small development work I do on my notebook I find that Visual Web Developer Express and the new Expressions tools work just fine – in fact, Web Dev Express is much easier and faster to use than the full VS 05. I also configured the standard windows components – removing IIS and installing Games – what’s the point of a home computer without Spider Solitaire???
At first, the hard drive was grinding for a long time and the whole install seemed very slow. However, I used a 1GB memory stick to provide some Readyboost and over night the search indexes completed building. Now the machine works very well. Outlook even manages to seem speedy! I’m very happy and not having Aero does not seem such a bad thing.
It seems I have a lot of fans in Poland. Actually I suspect there are a lot of spammers in Poland who are trying to scrape my site for emails or send comment spam. UAE & Lithuania also appear to be a problem. I'd really like to block big chuncks of the planet from getting to my site but I'm not sure this is possible. Anyone got any idea how to do this?
I just upgraded my blog site to dasBlog 1.9. It's been a long time between releases - which is a good thing - but so far I can't see a lot of difference from 1.8. There are a few new themes and 3 new settings - auto expire comments, html comments & gravatar icons (whatever they are). There is no support for Comment RSS and the activity reports still only work a day at a time (my biggest complaint). Still, it's a rock solid product and the upgrade was extremely painless, although my customised theme has broken so I need to do some work on that.
I switched my Xtra account to the new unlimited Go Large plan 2 weeks ago and have found that for anything other than surfing it is incredible slow - dialup slow. Yes, I know it's managed for peer to peer and bit torrent type stuff, but even basic file downloads over HTTP are rediculously slow. At the current rate, downloading Vista from MSDN will take 3 or more days. Now I can fully understand having some sort of restrictions but I live in an semi-rural area where there are not too many users and I do my big download at non peak times - from 6am to 6pm usually. Prior to Go Large I was getting about 5-8 times the performance.
There's a few others complaining about Xtra and reccommending a switch to Orcon or others which is a great idea for some people but where I live, Telecon are the only cable providers so while switching will not reduce Telecon's monopoly or profits it may restore my bandwidth.
The other option is to switch back to the previous 5Gb plan I was on. In most months this was sufficient but with school holidays 5Gb usually lasts about 2 weeks.
So, all I can really do is moan about it here and make sure I cross link as much as possible to get up the google hit list.
Oh, crap, just found this, I should have checked more before switching plans.
Ah, cancel that, just found this. However, it really does show how incompitant Telecon & Xtra are. I really feel sorry for the people that work there - and I know a few. It must be hard working for a company that is so hated by so many people, but really this is the fault of senior exec's and a few idiots in marketting. They will be the first against the wall when the revolution comes. Viva le revolution!
|