Auckland Codecamp

The last codecamp was a huge success :D   We had lots of interesting speakers and I now know a lot more about the WCF service factory than I did before.

My session at codecamp was about Javascript best practices. I think it went pretty well judging by the reactions I got from some of the people in the audience.

I mentioned that I would put up my slides and the demo application

In the afternoon I did not stay at codecamp but instead went with Alex James and Nikhil Kothari to explore Auckland for a while.  During the exploration of Auckland we of course discussed some geeky things like Alex’s pet pieve : Data 2.0 and I could not resist talking about MVC and webforms with Nikhil, after all how often will I get the chance to talk to the architect of webforms face to face.

Anyway I’d like to construct a list of arguments in favor of MVC (eg. Castle/Monorail) and webforms.  So if you’re reading this blog and you have something you can contribute to this list please leave a comment.

So far I have : it’s easier to develop complex UI’s with an MVC type framework than it is with webforms. I’m more productive in the MVC framework than I am with the classic ASP.NET model.  The classic asp.net model promotes code duplication or at least makes it easier to fall into that trap.

 Nikhil has some valid points in defence of webforms:

Sooner or later you are going to need some state that’s why we have viewstate :) and you will typically maintain your own state in a hidden field. Webforms is a framework and you roll your own specific framework for every new site.  There is nothing you can with MVC that you can’t do with webforms. 

All his arguments are valid in my book.

I have to get back to teched now but as soon as I get some more time I’m sending Nikhil a very small project programmed in the MVC way and the same app in webforms.

 

Lunch with geeks (7/8/2007)

We had another geeks lunch on tuesday. We discussed a number of topics but focussed mainly on design patterns.

Some of the observations we made are the following.

The most overused design pattern : Singleton. With the remark that a singleton should only be used when you need to keep state in your object internally.

You shouldn’t care about design patterns until you figured out a couple yourself. This is a bit the chicken or the egg question because you would have to know the design patterns in order to know that you are using one.

Lot’s of programmers get by without the patterns although the solutions may not look as elegant.  Design patterns are in no way a silver bullet for creating quality software they just help you solve problems in a predictable way.

One of the ways suggested to start adopting these patterns is to write code that works first and then refactor it to use the patterns.

Next I’d like to list a bunch of resources/books that were mentioned during this discussion:

Thanks to Bevan Arps for this list of books:

Design Patterns (Gang of Four)
Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides
ISBN 0 204 63361 2

Refactoring – Improving the Design of Existing Code
Martin Fowler
ISBN 0 204 48567 2

Analysis Patters – Reusable Object Models
Martin Fowler
ISBN 0 201 89542 0

Refactoring to Patterns
Joshua Kerievsky
ISBN 0 321 21335 1

 

Ivan Towlson has put up a blog post listing the books that he remembered.

And here are some urls that hold some information on design patterns.

http://www.developer.com/design/article.php/1474561

http://www.dofactory.com/Patterns/Patterns.aspx

http://www.designpatternsfor.net/

 

 

del.icio.us tags:

Re: Monorail vs. Rails isn’t a meaningful question

Scott Bellware has put a post up with that exact title and this is my reply.

While I can understand that people are dissapointed in asp.NET webforms doesn’t mean you have to throw out the whole .NET framework.  As I stated before ever since I moved off of webforms with their viewstate i don’t get the wtf why isn’t this working moments anymore.

By now I have developped a number of small websites with managed content and a crm in RoR.  While I like RoR in my case it does not save me time as opposed to doing stuff with monorail for example.

I find active record to be quite constraining in some of the domain modelling i’d like to do. And the utter lack of proper tool support makes it quite a struggle to work with in my case. .NET has got visual studio which is an unparalleled IDE in my opinion.  I often don’t have to look at the code and only type the first 2 letters or simply press ctrl-shift-space.

While I do miss the fact that in ruby everything is essentially a hash and in .NET things are a little bit more complicated I like the fact that I get lots of stuff for free which require quite a bit of investigating in ruby. Applying the same things as I do in ruby that is I use quite a bit of reflection nowadays to set up some common properties if it is worth the trouble. If I have a smaller project i tend to just type stuff out. I don’t think in webapps reflection is too much of an overhead. Especially if you come from the ruby side of things.

One of the showstoppers for me is the fact that RoR has no proper support for the windows platform, getting it to use windows guid’s as primary keys for example isn’t too hard but again it’s not something you get out of the box.

Comparing .NET with a bazooka is going a little bit too far. I can see you can get infatuated by ruby but i don’t think that in it’s current state it is the greatest tool to build complex enterprisy apps in.  Deployment of a rails app is hell compared to deployment of a .NET app.  Yes you have to write less code but you have to write the full words and there is no contextual help or anything.

I’ve grown quite fond of Resharper over the last year and it is the first thing I install in visual studio when I rebuild my machine.

Monorail on the other hand does combine the best of both worlds.  It gives me the simplicity of the RoR (MVC) framework but also gives me the flexibility of the .NET framework.  Most components you get in .NET seem to have been written by people who take their job seriously and try to write proper software even if it’s open source.  Lots of things I have found in ruby seem to have been written by either students or people who have no clue about what they were doing. Almost 70% of the plugins feel like they are incomplete or just don’t do their job as expected. I dare you to find a good, full featured blogging platform in RoR (don’t tell me mephisto because where are my trackbacks, pingbacks, comment moderation, statistics and refferer information ?)

I have a natural dislike for people that shout really loud but the content doesn’t have the value of a person that really knows what they are doing and talks softly. The ruby community is full of them.

I’m not the first developper to have moved back to .NET and embraced monorail/castle and I bet I won’t be the last.

However with the advent of IronRuby I think my opinion on the subject may change because that hopefully implies that visual studio will get full support for Ruby and that will finally give me the chance to evaluate my productivity in both languages more objectively.  But as things stand currently I like the language of ruby a lot but I am a lot more productive in the c# world.

del.icio.us tags:

Wellington – Lunch with geeks (24/7/2007)

I didn’t put the minutes up from last week because we had too many people there and we didn’t get a real group conversation going.. It was mostly little separated groups so I don’t really know what has been talked about.  I also have a deadline for a client rapidly approaching so I didn’t really find the time to add this to my blog.

But I would like to thank everybody that was there last week for attending.

Anyway today we had another Geek lunch and the topic of discussion was:

What will you do to become a better programmer this year ?

I’ll sum up the list of things to do that we all agreed upon.

1. Take an advanced reading course to improve your reading speed. People make a couple of really common mistakes when reading stuff and this course unlearns them. It improves your reading speed up to 3 times.. The course only takes 4 mornings so it’s definitely something I’ll be doing in the near future.

2. Read a new book every month/ 2months.

3. Take an advanced writing course in order to write that dreaded documentation a lot faster.

4. Learn a new language every year. By taking a quick poll around the table it seemed that the most likely candidates here are Smalltalk, Ruby, Errlang, …

5. Contribute to open source that way you get to meet a lot of good coders and you learn sooo much.

6. Get a membership with ACM they give you free books and courses if you’re a member.

7. Work with as much people and on as many projects as possible in order to gain more experience ==> See open source :)

 

I want to thank everybody for coming and making this lunch another great one :)

Woohoo IronRuby alpha1

Well I’m pretty excited about the drop of IronRuby

We took it for  a quick spin at work.. and it looks really promising :)

As you can read on John Lams blog there are a bunch of things that aren’t implemented yet.

One of those things would be to enumerate the methods of a class.

We thought String would be a good fit as John is explaining how much time they put in that one.

so this is what we tried.

start up the ironruby console

str_test = “Hello World”

10.times { puts str_test }

which gives the expected output

Iterations over arrays etc work as expected.

however one of the things i use a lot are the methods : methods and attributes

attributes shouldn’t exist on a string class but methods should only now it throws an error.

All in all I’m very impressed by what they’ve accomplished so far and I’ll definitely be looking at contributing to this project as soon as I have completed my last 2 projects for clients.

Alex James will be joining Microsoft

I always thought that if there was one guy in NZ that should be working there it’s Alex.

And today he announced that he will be joining Microsoft in September : http://www.base4.net/Blog.aspx?ID=538

 

Congratulations Alex. I for one am looking forward to the great things you will be doing there.

Dark Visual studio scheme with resharper support

This is more for my own reference but I decided to put it here.

This is the color scheme I’ve been using over the past couple of weeks.

It looks like this:

 ///

        /// Gets or sets the date.

        ///

        /// The date.

        public DateTime Date

        {

            get { return date; }

            set { date = value; }

        }

 

        ///

        /// Gets or sets the memberName.

        ///

        /// The name of the member.

        public string MemberName

        {

            get { return memberName; }

            set { memberName= value; }

        }

 

        ///

        /// Gets or sets the source of the member.

        ///

        /// The source of the member.

        public MemberSource SourceOfMember

        {

            get { return sourceOfMember; }

            set { sourceOfMember = value; }

        }

 

Oops.. looks like copy as html doesn’t quite look the same.. anyway you can give it a try if you want

Dark Scheme with resharper settings

What’s the deal with MbUnit

Consider the following code :

 

        [Test]

        public void StringFormatEqualsTest()

        {

            string firstString = string.Format(“{0}”, “test”);

            string secondString = string.Format(“{0}”, “test”);

 

            Assert.AreNotEqual(firstString, secondString); //test passes

        }

 

        [Test]

        public void StringEqualsTest()

        {

            string firstString = “test”;

            string secondString = “test”;

 

            Assert.AreNotEqual(firstString, secondString); //test fails

        }

 

Why does the first test (StringFormatEquals) pass ? In my opinion it shouldn’t. I raised a bug report on the mbunit site.

This behaviour doesn’t exist in nunit.  I’m just putting it out there because you do want your tests to reflect the thruth :) .

Code camp registrations are now open

How exciting.. we’ve been planning this for a while but now we can publically announce that code camp registrations are open.

Our next code camp will be the sunday before TechEd and we will be running it in one of the larger TechEd conference rooms.

Hurry to http://www.codecamp.net.nz for registrations and more details.

I know that we’ve got an impressive list of speakers.

 

Hope to see you there !!!

Unit Testing Legacy Code

Whenever I’m faced with a bunch of legacy code that I would like to write unit tests for I get quickly demotivated because I know the code works but still i’d love to know if the code will still work after I’ve been working on it.

Lately I’ve been faced with a lot of legacy code so I decided to make a little tool that does the same as what VSTS testing does when you select generate unit tests.

I haven’t made an add in yet, it’s just a little winforms app I started it this afternoon and i have something working now. It’s also one of my very first winform apps so things have a lot fo room for improving.

I’m open for suggestions and i decided to open source it so if you have a fix or would like to make it a better tool let me know and I’ll add you to the list of contributors

You can find the tool @ my subversion repo:  https://svn.koolkraft.net/test_generator/trunk

I know that it’s against the rules of TDD to do this stuff but i just want to save some time by generating stubs that don’t actually do anything except setup objects and initial values

Let me know what you think :)

Page 10 of 26« First...89101112...20...Last »