Probably you are aware of Edgecase Ruby Koans. In case you aren’t, let me introduce you to them. From Wikipedia, Koan: A kōan is fundamental part of the history and lore of Zen Buddhism. It consists of a story, dialogue, question, or statement whose meaning cannot be accessed by rational thinking, yet it may be accessible by intuition. A widely known kōan is "Two hands clap and there is a sound; what is the sound of one hand?" The Ruby Koans are a set of failing test that you need to resolve. Of course the idea is not just to resolve the test as fast as you can but to read the code carefully and understand why it’s failing and them provide the solution. Once you download the code you just run the rake command inside the folder where the Koans have been downloaded and you will be presented with a failing test and a message in the screen that indicates what you need to do to fix the test. You should take as much time as needed to contemplate the solution and internalize the code, the syntax and the constructs that Ruby use. I went through them once and I’m planning on do it again in a day of two. The Koans cover some important aspect in the following areas: asserts, arrays, arrays assignments, blocks. Classes, open classes and class methods. Inheritance, hashes, exceptions and so much more, this is the complete list of files in the Koans folder: 17/01/2010 11:25 PM 2,024 about_arrays.rb
17/01/2010 11:29 PM 1,015 about_array_assignment.rb
17/01/2010 12:27 PM 942 about_asserts.rb
18/01/2010 11:51 PM 2,392 about_blocks.rb
21/01/2010 12:02 AM 3,873 about_classes.rb
21/01/2010 06:20 AM 3,820 about_class_methods.rb
18/01/2010 12:11 AM 2,320 about_control_statements.rb
22/12/2009 10:24 PM 1,436 about_dice_project.rb
18/01/2010 12:24 AM 1,374 about_exceptions.rb
22/12/2009 10:24 PM 317 about_extra_credit.rb
17/01/2010 11:35 PM 1,765 about_hashes.rb
21/01/2010 12:07 AM 1,652 about_inheritance.rb
18/01/2010 10:10 PM 2,441 about_iteration.rb
21/01/2010 06:39 AM 4,277 about_message_passing.rb
18/01/2010 12:02 AM 3,613 about_methods.rb
21/01/2010 12:10 AM 1,132 about_modules.rb
17/01/2010 08:08 PM 1,020 about_nil.rb
21/01/2010 12:03 AM 920 about_open_classes.rb
21/12/2009 04:38 PM 3,295 about_proxy_object_project.rb
19/01/2010 12:10 AM 2,657 about_sandwich_code.rb
21/01/2010 12:15 AM 1,870 about_scope.rb
20/01/2010 11:46 PM 1,843 about_scoring_project.rb
17/01/2010 11:51 PM 4,725 about_strings.rb
22/12/2009 10:24 PM 771 about_triangle_project.rb
22/12/2009 10:24 PM 486 about_triangle_project_2.rb
18/01/2010 12:12 AM 788 about_true_and_false.rb
22/12/2009 10:24 PM 1,111 array_test.rb
21/12/2009 04:38 PM 19 code_mash.rb
21/12/2009 04:38 PM 4,498 edgecase.rb
22/12/2009 10:24 PM 15 example_file.txt
22/12/2009 10:24 PM 156 first_test.rb
22/12/2009 10:24 PM 2,323 GREED_RULES.txt
21/01/2010 06:32 AM 895 path_to_enlightenment.rb
21/12/2009 04:38 PM 159 Rakefile
02/01/2010 10:19 PM 5,482 README.rdoc
22/12/2009 10:24 PM 70 test_helper.rb
18/01/2010 12:29 AM 821 triangle.rb
|
Open your favorite editor, launch the console and start running the Koans, just type rake and you will be presented with messages like this,after fixing it your awareness will “expand”.
Thinking AboutOpenClasses
test_as_defined_dogs_do_bark has expanded your awareness.
test_after_reopening_dogs_can_both_wag_and_bark has damaged your karma.
You have not yet reached enlightenment ...
<"HPPY"> expected but was
<"HAPPY">.
Please meditate on the following code:
./about_open_classes.rb:26:in `test_after_reopening_dogs_can_both_wag_and_bark'
path_to_enlightenment.rb:28
|
It’s very addictive, the only complain/suggestion I have is to provide some answer to some of the question in the code. May be in a separate show?
# THINK ABOUT IT:
#
# Is it better to use
# obj.nil?
# or
# obj == nil
# Why?
In case you don’t know what it is. Codemash is a conference put together by volunteers. It has been running for four years now. The conference happens at the Kalahari Resorts and Convention Center that has reportedly the biggest indoor water park in North America. That is in Sandusky, Ohio. Organization I only have one world for it, spectacular. You come in and once you register you get your welcome package, a tag and a marker to write down your name, nickname, handler or however you want to be identified. (I saw one tag that only have a big E in it. And that is cool). A lot of attendees (me included) choose to add their twitter handle. If you think about it, at the end of the day a lot of us talk to each other or read each other on twitter so that makes sense. After that your only problem in the world is try to get to as many sessions or open spaces as possible. Content Multiple technologies and practices are been represented at Codemash. Ruby, Java and JVM languages, .NET and CLR/DLR languages, Python, Iron*, C. Functional and OO. SOLID, BDD, TDD, Lean, Leadership, Coaching, Patterns. Iphone, Rails, WebForms, Silverlight, WPF, Tapestry and more development platforms, etc. And if you can’t find what you want, you still have the open spaces, so go ahead and create your own conference. I bet people will join you. There is content at the Beginner, Intermediate and Advanced levels. I could like to see a few more 400 level talks but if you think that the idea of the conference is to try to get you out of your comfort zone that may not be very wise. Let me explain. The idea is to try to go to talks that are not about the same technologies that you use every day. For example I choose to attend some F#, Ruby, Python and Clojure talks. My level of familiarity varies so I was able to follow and take some good information from the sessions since they were at the intermediate/beginner level. Sessions and open spaces I enjoyed. The keynotes by Mary Poppendieck’s The Five Habits of Succesful Lean Development and Andy Hunt’s The Mother of all Bugs Some of the sessions/Open spaces: Presentation Patterns. What makes ruby different. Open space about FubuMVC. NoSQL: Death to relational DB’s. Introduction to Cucumber. Testing ASP.NET applications using Ruby. Being and evil genius with F#. 0-60 with Fluent NHibernate. Building webapps with Compojure. IronPython with ASP.NET. The venue Perfect. I think that the venue is part of the magic that make this Conference so special. Imagine that you are in this African themed hotel, where people wearing sandals and T-shirts around you will be checking their emails or updating their twitter timeline from their smart phones. Imagine going to a water park after the last session of the day, or just go and play mini golf with your son. That makes for a very relaxed vibe and you feel it and see it at the conference. The staff at the hotel is great, friendly and professional and all interaction (from the moment I made my reservation on the phone) was very pleasant. The food Ok. This is something I’m really surprised. You pay $175 for the 2 days of conference + $150 for the extra Precompiler day. That’s a grand total of $325 for a 3 day conference. So, you may expect to have some scarcity on the food supply, specially when you consider that you have breakfast and lunch all of three days and dinner on one of the days. Well, let me tell you something. There was not such thing. The food was good and plentiful. Actually It was fantastic. I went to conferences where I paid $2000 for the same number of days and all I got was a wrap or a sandwich that was prepared 12 hours before. On top of that there was coffee and pops (coke and sprite cans) available during the day to keep you going. What I will change Nothing from the conference, maybe extended to 3+1 days? My recommendations for new attendants. If you have a family take them with you, specially if you have kids. My only mistake (and seems to be a common theme among first timers) was to go along. The organization even has a KidsMash going on where the kids can play and be ask geeks as their parents when they are tired of the water park. Try to study the list of sessions in advance but relax and make sure you scan the Open spaces regularly and keep an eye on that twitter timeline. If you are not getting the most of the session you are in move to another one, just try not to disrupt And like in most conferences take a power cord (a long one if possible) with you. I’m already impatiently waiting for next year Codemash. I can only say a big thank you to all the people that works to make such a great experienced for all of us.
When the Codemash guys announced their API I decided to create an app using it. I wasn’t sure what to do at first but It was pretty obvious anyway. Some kind of scheduling tool. It took me some time to have the time to start and them to finish it. I finally was able to deploy this last night and today I add another feature to considered completed based on my initial goal. You can visit the tool here: http://mysessioncalendar.com/ What it does? The tool has three tabs one for each conference day and a third for the pre compiler. Each tab has columns (representing the rooms where the sessions take place, just noticed I don’t have the room on top) and them the sessions are displayed below ordered by time. The idea is that you can select the sessions you are interested in. The tool does not make any judgement calls and if you want to select two sessions in the same time slot is up to you. Once you mark all the sessions just click the “Save Schedule” button on top and a modal dialog will display with a link to open (in a new window) a list with the selected sessions. This time the sessions are ordered in three columns: One for each day and the sessions for each day are ordered by time. The page has the AddThis widget that allow you to twit, email, print, add to favourites, show them in facebook and more. Another cool option is to export them as iCal , this way you can add them to your google calendar and other tools supporting this format. How was done. The site have been implemented using ASP.NET MVC, jquery for all the JavaScript and the UI design using JQueryUI. Data is saved as xml so no need to use databases. Originally I started using Castle.ActiveRecord since the data model is extremely simple, but is so simple that the use of a db was overkill. The total time to have the site done was maybe 24 man hours divided in several coding sessions of no more than 3 hours at a time. The use a a widget like AddThis make implementing the sharing functionality a 15 minutes deal. Conclusion. There are some things that can be better like font sizes (thanks Ahmed for the report). Originally I wanted to have a better interface with drag and drop or double click in a session to select, but decided to go with a simpler implementation and get this out of my computer and into the wild.
I got my tickets the first week the conference was announced, not really knowing what to expect but exited on the opportunity to learn new things and talk to people that work in other languages/technologies beside the .net world. Once the sessions were announced my excitement decreased a little bit. Friday morning was miserable in the weather department, so going to the conference was a nice proposition. I print my ticket, pack my laptop into the bag and took the TTC. I arrive a little after 8:00, the registration process was fast and everything was really well organized. There was coffee, water and muffins in the breakfast area. Good vibes in the air and a general feeling of excitement in the public. I crossed path with some faces I know from other similar gatherings while getting my second cup of java of the day. After entering the auditorium Joel Spolsky addressed the audience with a key note about designing software products. He talk about how to make good products, the constant struggle between simplicity and features and how to achieve a balance. It was a vey interesting keynote. The first session was on Asp.Net MVC, Joe DeVilla and Barry Gervin give us a good overview. Nothing knew to learn for me, but the presentation was good, and a lot of the developers in the audience weren’t .net developers. After each brake, the conference resumed with some video from FogCreek, short but good, presenting some aspects of FogCreek or software development in general. The other session I enjoyed and the one that justified the ticket price was the one by Greg Wilson. He is not just an excellent presenter but he also has something to say. He talked about doing scientific analysis of development methodologies and use real data to make decisions on what practices are really beneficial to our profession. As a summary: one of five sessions + the keynote were relevant for me. For $99 it’s not bad value and I probably will go again next year if they decide to come back to T.O. Just hoping they rise the level of the sessions, maybe 2 at the 100 level, 2 at the 200 level and 1 at the 300 level.
I think this has been the longest hiatus since I started the blog. I have been busy with life, talking some time of, finishing tons of renovations at home and re-focusing my priorities from a development point of view. I'm looking forward to renew the posting pretty soon with the usual frecuency of one to two post a week.
Last weekend was the 2009 edition of the Toronto Code Camp were I had the privilege to participate as one of the many volunteers. This is a free event that runs from 9 am to 6 pm with 25 sessions in topics such as: Wix, Silverlight 3, ASP.NET MVC, F#, SQL Data Services, Extending VS, new features in VB10, Linq internals and more. I was impressed by how well organized the event was. The sessions I was able to assist were no bad at all. The presenters were experienced and well prepared. Most of the material was at the 100 to 200 level, maybe the Linq internals session touch around the 300 with expression trees. Even if you consider yourself at the 400 level, with so many sessions on so different topics you can always find something interesting and new things to learn. The interaction with fellow developers and the involvement in the community have a lot of value as well. There was a high sense of camaraderie during the event and the after party. On a personal note I was able to “infest” another volunteer with the MVC virus. If you haven’t attend a code camp near you city or town make sure to check for them and don’t miss it. They are a lot of fun. As a developer I want to thanks Chris Dufour for putting the time to organize such an event. P.S.: I got a cool Polo shirt sponsored by ObjectSharp.
This is what you see: Notice that the compatibility button is not shown by default. Looking at the code behind I see this:
<!-- No DOCTYPE for IE6--><html lang="en-CA">
<head>
What make’s me think that yahoo is misdetecting IE8?
In any case manually adding the site to the compatibility mode fix this.
You may think that both Yahoo and Microsoft will have look at one of the top 10 sites, don’t you?
Maybe this affect only the Canadian version of the site?
I’m surprised because this is the first site I found it doesn’t work. I was expecting some other sites to have problem but never Yahoo.
If you ever wonder what the compiler does to make the auto properties work let’s take a look at the code the way Reflector sees it. Let’s write some very useful code  public class AutoPropertiesDemo { public string MyString { get; set; } public int MyInt { get; private set; } public IEnumerator Enumeration { get; set; } } Compiler this hitting F5 and them open the dll using Reflector. And this is what you will see. public class AutoPropertiesDemo { // Fields [CompilerGenerated] private IEnumerator <Enumeration>k__BackingField; [CompilerGenerated] private int <MyInt>k__BackingField; [CompilerGenerated] private string <MyString>k__BackingField; // Properties public IEnumerator Enumeration { [CompilerGenerated] get { return this.<Enumeration>k__BackingField; } [CompilerGenerated] set { this.<Enumeration>k__BackingField = value; } } public int MyInt { [CompilerGenerated] get { return this.<MyInt>k__BackingField; } private [CompilerGenerated] set { this.<MyInt>k__BackingField = value; } } public string MyString { [CompilerGenerated] get { return this.<MyString>k__BackingField; } [CompilerGenerated] set { this.<MyString>k__BackingField = value; } } } Of course this is not exactly what the compiler does, since that will be IL. But is the way Reflector shows it as C# code. Interesting, isn’t it? If you are wondering changing the settings in Reflector to actually shows IL get this: .class public auto ansi beforefieldinit AutoPropertiesDemo extends [mscorlib]System.Object { .method public hidebysig specialname rtspecialname instance void .ctor() cil managed { .maxstack 8 L_0000: ldarg.0 L_0001: call instance void [mscorlib]System.Object::.ctor() L_0006: ret } .property instance class [mscorlib]System.Collections.IEnumerator Enumeration { .get instance class [mscorlib]System.Collections.IEnumerator Pronghorn.Core.AutoPropertiesDemo::get_Enumeration() .set instance void Pronghorn.Core.AutoPropertiesDemo::set_Enumeration(class [mscorlib]System.Collections.IEnumerator) } .property instance int32 MyInt { .get instance int32 Pronghorn.Core.AutoPropertiesDemo::get_MyInt() .set instance void Pronghorn.Core.AutoPropertiesDemo::set_MyInt(int32) } .property instance string MyString { .get instance string Pronghorn.Core.AutoPropertiesDemo::get_MyString() .set instance void Pronghorn.Core.AutoPropertiesDemo::set_MyString(string) } .field private class [mscorlib]System.Collections.IEnumerator <Enumeration>k__BackingField { .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() } .field private int32 <MyInt>k__BackingField { .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() } .field private string <MyString>k__BackingField { .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() } }
Sergio Pereira just posted two videos of Uncle Bob presentation at the Chicago Alt.Net meeting. The first video is the actual presentation and the second one the QA session that followed.
InfoQ has a video recorded at JAOO on witch Robert Martin talks about craftsmanship and ethics on software development. Martin is a very good presenter and the video captures his energy on stage.
On episode 20 of the Elegant Code Cast Matt Heusser talks about testing in general and the role of QA in an agile team. This may very well be the best episode so far. Heusser not only talks about testing but how testers should be counted during all phases of the development process. It’s not the Heusser is saying anything new on the subject, but maybe the way he presents the concepts that make his points very compelling. Even if you are already aware of the importance of a good QA team, I recommend to listen and read to Matt Heusser. If you are interest on the subject, there is also this nice video on Google about Agile testing with Elisabeth Hendrickson from 2005 where some of the same issues as discussed.
I have been playing with both Ruby and Rails for maybe two years. Never doing anything really “serious”, like an external project for a client. I kind of know my way around it when I need it, but I still consider myself a Beginner. So when a few days ago I read this post about Xprest I got exited. XPrest is; according to the project page (emphasis mine): This project is an open source enterprise expense reporting system. It's raison d'etre is to act as an example system for showing how to build RESTful enterprise systems. While it will be a functional expense reporting system, it is not designed to be a complete answer to enterprise expense reporting needs. There are already a few articles in the wiki: Introduction Overview Requirements and maybe the most important Development environment setup I suggest you tag along this project, it looks like the perfect opportunity to learn both a very good language and an excellent framework for development web apps. I also suggest you subscribe to Pete Lacey’s blog
A coworker uses Google Chrome as her primary browser and she sent me and email about my feeds not working. So I went to her computer and yes, inside Chrome when clicked the Icon on the top of the blog nothing happened. I remembered that I enable the feed:// scheme in my blog engine (this way if you have a Feed reader it will be picked up) and most browsers (IE, Firefox) will also pick this up. But nothing happened, so I have to disable it. We all know about the lack of support for feeds inside Chrome, so I did a quick search and I found this document where they describe how they are going to support Feed discovering and subscription inside in the future. You can tell from the document that it’s still a work in progress, (lot of TODO’s in it) lets hope they go to work on it soon. So far Chrome is my browser for web apps as I posted before, but for real world browsing I still use my faithful Firefox with my favorite extensions.
This looks very interesting. (from their site) ELMAH (Error Logging Modules and Handlers) is an application-wide error logging facility that is completely pluggable. It can be dynamically added to a running ASP.NET web application, or even all ASP.NET web applications on a machine, without any need for re-compilation or re-deployment. Once ELMAH has been dropped into a running web application and configured appropriately, you get the following facilities without changing a single line of your code: - Logging of nearly all unhandled exceptions.
- A web page to remotely view the entire log of recoded exceptions.
- A web page to remotely view the full details of any one logged exception.
- In many cases, you can review the original yellow screen of death that ASP.NET generated for a given exception, even with customErrors mode turned off.
- An e-mail notification of each error at the time it occurs.
- An RSS feed of the last 15 errors from the log.
- A number of backing storage implementations for the log, including in-memory, Microsoft SQL Server and several contributed by the community.
I haven’t use it yet, but it really sounds like something that I see myself incorporating into my tool box. You can download it from Google code.
I’m sitting besides my 19th month old trying to write some code. Of course he is trying to help me. Let me tell you his C# is not bad He was so exited about typing thaT I decided to give him something he could play with. I remembered Scott Hanselman’s baby smash. So I went to the site and install it. I have to admit that this have been the easiest application ever to install (I had .net 3.5 installed already). Just click once, one prompt, and there you go. My son got hooked immediately. Tree house was in the TV but he just couldn’t stop banging the keyboard. I still can’t write any code, but at least one of us is happy. I better go to get my other machine.
As you may have noted, the blog have changed name, domain and engine. My previous hosting company wasn’t able to fix a problem they created with their install of PHP. This cause that an annoying Warning pop up at the bottom of each page of my blog, but the real serious problem was that the comments post wasn’t working. So I decided to change for Go Daddy. This was a good opportunity to start using a domain a register some time ago: dynamicprogrammer.com. Since I was switching hosting I decided to move from Wordpress to DasBlog. Nothing wrong with Wordpress. I just wanted to play with DasBlog, I specially like the idea of not having to use a db. (DasBlog use xml files to store all the data). At the moment I’m using one of the default themes provided with the install. I will need to work on that. Another change is on the syndication feed, I decided to start using feedburner, so in case I decide to switch to another platform, subscriber to the feed will not be affected.
A few days ago was announced the date for the Professional Developers Conference 2009 or PDC. You can see the announcement or subscribe to the mailing list. The conference will be on November 17-20, 2009 in Los Angeles, California. Note: The page for the mailing list has the PDC 2008 logo, but that’s ok. Technorati Tags: PDC 2009
YAGNI or “You ain’t gonna need it”, is great. It keep people like me to over design systems. Now, every time that I start to write some piece of code I always have that said in mind. You will be surprised how many times I found myself telling me, YAGNI. Although, sometimes, this can be misused. Sometimes this “rule” may be used as an excuse to write tightly couple systems, difficult to maintain in the long run. I know that this is not the spirit of “YAGNI”, but a week ago somebody said that to me when we were talking about the importance of programming against interfaces. So let me tell you what my own interpretation of YAGNI is. Do not create that cool feature that nobody requested, but design your system in a way that when (or if) somebody request that cool feature, you will be able to implement it without rewriting the whole system. So what we do? Well, just apply solid OO design principles. Make your system extensible. This is not as difficult as it sounds. Design from the get go a modular system. Program against interfaces. This will facilitate the use of Dependency Injection to reduce friction. You should make sure that different compilation units do not depend on each other. Practice Test First (TDD or BDD) or at least have a good test suite in place so later on you can change your system with confidence. Make sure that you put your business rules in the right place and not scattered all over your system. Do not be afraid of aggressively refactor your code to make it more readable, even when the feature works, refactoring your code to make it extensible is not a violation of YAGNI.
A month ago or so I was talking to this developer on a party at a friends house. He was telling me how much he hated his work. The guy was telling me about some of his coworkers. The story goes like this. They had a new boss, and this new guy wanted to bring XP, pair programming and some other things like DI, DDD, etc. He also wanted to try MonoRails. The guy at the party was furious. He loved his drag and drop web forms and he saw no point wasting time sitting with another developer to do a data grid based report. Why they needed to move the code outside of the code behind to another project? Code reuse? What that's think about Unit test? He tested his pages all right hitting F5 and clicking the submit button. I was trying to be polite but I couldn't avoid to ask him: Don't you have problems during the maintenance phase, or each time you need to change something, something else brakes and you never find it until it goes to production? He looked at me like I was crazy and said: "Yeah, but there is nothing you can do about it. And besides if it's perfect they won't need me anymore." He was serious.
In the last year my team was able to successfully adopt the following practices in no particular order: Unit testing (mostly Test First or TDD) - we were doing no formal repetitive testing before. Continuous Integration using CC.net. - a build you mean F5 on VS? Nant to drive our builds. Subversion as our source control system (we have no VCS before!). NHibernate (we were using DooDads or simple Ado.NET before). DI with Castle.Windsor. Mocking (we started using NMock2 but we are moving to Rhino.Mocks now). Code reviews and some type of pair programming. Fogbugz as our bug tracking system (we had an in house tool before, but I hated that we also have to do maintenance of this tool and that have no value to the core business). Weekly meetings were we watch videos about the technologies we are using or we plan to use, we discuss methodologies or how to better use the tools we have. We read something and we talk about it. I found this meetings really productive. At the beginning it was difficult for some of the members of the team to participate, to express their point of views; but that have changed. This participation makes for a more cohesive team with new ideas and different point of views. We started to implement some automation in our regression and smoke tests as well, but we are in the exploratory phase here. This is a testimony to the mature of the team and how well they are taking on new challenges. Our next goal is to apply some of the Lean ideas like Kanbam.
One of the most difficult tasks as a team lead is to find the right people. I'm happy to say that at this moment our team seems to be working well together, but it took almost three years to get to this point. I have been thinking about why it's so difficult to find the right people and I will try to put down my thoughts here. The hiring process for the company may not be adequate for you team, it's not the same to hire a developer that a designer or a marketing person. HR should suggest practices but should not impose a pre defined hiring process. Each department should use it's own selection criteria (as far as the general guidelines are the same for the company). The recruiters companies may not understand what you need. We worked with several recruitment agencies and there is only one of them that take the time to sit with me to understand what I'm looking for, they ask about our development process, the environment and other details, so they can find the right candidate. This saves me a lot of time, since most of the resumes they send are from candidates that I wish to interview. It can also be that when I put the job description together, I'm not expressing my needs or the spirit of the company. The team change with time (hopefully). The developers get better and your development process should evolve as well (continuous Improvement). The company change so the expectations on performance will change. In this case a team member that look as a good fit a few months ago, may not be so today.There is no place for the Primma Donna Developer in a modern development team. A cohesive team is very important. It's good to have different personalities and cultural backgrounds but they should all work well together. This is even more important on an agile team. You. The team leader may not find the proper way to communicate to the team, and this is difficult to diagnose on your own. You will need somebody from outside to tell you. What do you think?
A month ago or so I found a mention to the Toronto Patterns Study Interest Group in the Toronto XP list. I made contact with them and I was reading the Clean Code book in no time. I have ben to two meetings so far and I can't be any happier. We are reading Clean Code by Robert Martin, a book that I had sitting in my library for a while. I really like the book and I mostly agree with all the concepts so far (we deal with the first five or six chapters so far). But I think that what I like the most is the interaction and how eterogeneous the group is. There are programmers that do Java, .Net, Python, C, C++, Ruby? on their day jobs, and this bring different perspectives. At the same time is fun to find that we all face the same issues with the code we have to deal with. It's nice as well to listen to those that disagree with my point of view or the author point of view and why. This make you, to further question your asumptions and the book as well. I did something similar a few months ago with my team, we all set up to read the Foundations of Programming ebook and them we discuss it during our weekly learning meating. Having to explain why you think that the author is right or wrong is a good exercise to fully understand the problem. Latelly at work I have been dealing with a piece of code that is not fun to work with (it's actually a real pain), so this meetings and this discussions help me to keep my morale high.
If you were wondering I just try the MLB streaming in Google Chrome. Silverlight works and I even had video, but the frames don't update and there is an ugly scroll bar at the bottom of the video screen. The audio works fine with no problem, something I couldn't said about Silverlight and Firefox for this particular site.

If I keep moving the scrolling bar the video frames refresh but that is kind of silly, isn't it?
Browsing around I landed on opgenorth.net blog an drift into his software tools page. Most of the tools I either knew or actually use, but this one I didn't. C# format is an online tool to format your C#, VB, HTML, XML, T-SQL or MSH code into valid HTML 4.01 complaint code to put online. The usage is dead simple, you just paste your code in a textarea, select a few options and click a button, voila! Your code have been formated and is ready for you to copy and paste in your HTML page or blog post.Between the options available you have: include line numbers, alternate code line background colours and embed the stylesheet. If you choose not to embed the stylesheet, you need to download the provided stylesheet and insert it in your page.I like this tool, I think that I will start using it from now on for my code post.
First let me said, thanks for this post. I always sustained that you can't do modern web development without using JavaScript. I never understood when in some user group presentation or a Microsoft product launch somebody drag and drop a control from the AJAX tool kit into a webform to provide some dynamic capability and exclaim "and you haven't wrote a line of JavaScript!". My though always was, aren't you guys web developers? If you are a database developer you don't want to learn T-SQL or P-SQL or whatever the SQL flavor of the database product you are using? I will concede that some developers may be better on the backend (I consider myself a really bad designer), but that is not excuse not to know your way on HTML, JavaScript and CSS. That is your presentation layer, even if you don't design it, you may have to maintain it. If not don't call yourself a web developer. Please don't misunderstand me, I'm not saying that you should know every little CSS trick or every possible browser implementation of HTML standard (does IE put the margins outside or inside the box?). I'm not even saying that you should be a javascript ninja. What I'm saying is that you shouldn't be afraid of those technologies, you should embrace them and learn them. JavaScript in particular is an amazing language with a lot of power and following a few simple rules will help you to discover the joy of working with such a language. And please if you haven't do it yet, take the time to learn how AJAX works, remember that there is not such thing as an update panel in HTML.
A second list of projects from Codeplex and google code. Visual Studio Comparison Tools: Requires WinMerge to be installed in the machine. Provides contextual methods in VS to make fast comparison between two files or a file and the clipboard. HTML Agility Pack: A nice library to parse html pages, very tolerant with not complaint HTML. JsonExSerializer: A framework to serialize and deserialize objects into Json format. An alternative to Newtonsoft Json library. NUnit AddIn for data-driven testing: From the website. "DataDriven Extension is an NUnit Addin that allows you to create test cases from any data sources (like database or plain text files etc.) and can used for parameterized test." SVN commit to FTP: It update files via FTP to a server after a commit is done into a svn repository. NHibernate helper kit: I haven't tested it myself but it promise to create a Data Model from an existing database using NHibernate, not quiet the right thing to do if you are going the TDD way but there are some times when you may find this useful.
Here is a list of some projects that look interesting for me. Extension Methods Extravaganza: A collection of some extension methods. You can find extension to the object the ICollection, IEnumerable, IList, String and StringBuilder. I specially like the StringBuilder and IList methods. I know I will be able to make good use of them. Reflector AddIns: The always useful Reflector gains power in a level of magnitude with this collection of AddIns. Special attention to Diff, FileDisassembler, ClassView, CodeModelViewer, CodeSearch and Deblector (allows to debug processes within Reflector). ProMesh MVC Framework: I saw this framework for the first time six or seven month ago and I was impressed. Later on the Microsoft ASP.NET MVC got my full attention and kind of forgot about this one. Take a look at it, there are some interesting ideas on it. CoolStorage.NET: It's a lightweight ORM framework very easy to use. I haven't use it in production yet but I played around with it and the learning curve is non existent, it comes with a very well written and detailed manual. ···Thinks you may like: No XML configuration required at all (I personally don't mind mapping files but I know that a lot of developers do.)···Thinks you may not like: All entities need to inherit from a base class. Entities expose methods like New(), Read(), Filter(), Save() etc. LazyParser From the same Philippe Leybaertfather of ProMesh and CoolStorage. An expression parser with support for C# syntax, very powerful. Utilities.NET From James Newton-King a complete set of utilities that you should have in your bag of tricks. Json.NETAgain from James Newton-King the bare bones for my REST services libraries. More to come in a future post...
Following to yesterday presentation at the TVBUG, Scott Hanselman gave the keynote on Data Services and Dynamic Data. Both of this two (products?, projects?, solutions?) are focus in different ways to provide access to your data.
Dynamic data allows you to very easy and quick create all the admin forms for a given database (similar but different to the scaffolding on Rails). The main difference is that there is not code generated for the pages you see. All the code is based on templates and every rendered field is based on templates as well, so you can very easily change the way a field will render.
Data services was already covered in my previous post about Scott's presentation at the TVBUG.
Scott Hanselmann and Beth Massi both gave a presentation today at the Toronto Visual Basic User Group about LINQ in general. Beth created a windows form app using VB.NET, LINQ to XML to and LINQ to SQL to read data from three different feeds and populate a simple database. She presented some nice queries and gloat a little bit on some of the goodness of LINQ on VB, making some good spirited jokes for the C sharp guys in the audience (like myself). Scott give us a nice preview of Astoria (ADO.NET Data Services) and show up some of the internal working, (how the magic happen as he put i). I really like that part of the presentation since I really like to know what's going when code is generated by the IDE. Data Services allow you to present some entities as REST services, it return both XML (Atom) and Json. Data Services comes in the new VS 08 and .NET 3.5 SP1. I will going to check it out as soon as possible.
I'm not always exited about Microsoft launches but the 2008 series (Server, Sql, VS) is quite good. So I went to this event with the highest expectation, hoping, for once, to be able to learn something. I chose the Architect track, since I have been playing (and using) VS 2008 since the beta 2 version and I have time to at least give a try to most of the new features, the developer track wasn't promising, since they were going to demoed all the features I already know about. The architect track seemed more promising, the first sessions was about SOA and how to implement an SOA in your company with the new tools, something that I'm actually doing right now. I should have known better. It started very good but rapidly became clear that was mostly a marketing pitch on how wonderful the new products are and how theya re the perfect tool to implement this type of architecture, without given any example or covering any real topic. It was a shame since the presenter looks like a very intelligent and articulate person. The next session was as wasteful as the first one, and once again I bet that the presenter was dying to give more details, but nothing. Both sessions ended up calling a Microsoft Partner to present a solution they developed using the new stack, so I lightened up and open my ears hoping to learn, see something. Once again a bunch of slides where, instead of give a problem and a solution to it, they keep repeating the same bullet points that I saw during the whole day. I want to make clear that I wasn't expecting to see a demo, I was counting with these sessions to be highly theoretical, similar to the sessions you can get in infoq.com or some of the chats on ArcastTV, but no, both sessions were a waste of time, at least for me. No real discussion or ideas presented. I will give it to Microsoft that may be if you are a professional that didn't have time to play with the tools, the presentations may serve as a way to open your eyes, so you go and give them a try, but it wasn't good for me in any level. Well, that's not completely true, I got a mini basketball hoop and a mini basketball ball for my kid.
I went today to the Nant site to check some documentation and I saw that the beta 1 of the new version is available, this version supports the .NET 3.5 framework, Mono 3.5, Silverlight 2.0 and Moonlight 2.0 The beta have been available since Decemeber 8, there are a bunch of changes, bug fixes and drop of some features that is important to take into consideration when migrating, some of your scripts may stop working if you are using some deprecated feature like the failure attribute, it have been replaced by the onfailure. I was hoping to see FTP support (ala Ant) between the new additions but I didn't saw it.
The guys from InfoQ has a very interesting video with Mads Torgersen, PM of C# talking about the future of the language. They talk about LINQ and the changes needed to support it in c#. There is a very interesting point on Extension methods a feature that fascinate myself and scare me a little bit. It's so cool that I know that we will overuse it at the beginning. Type inference is also referred in this chat and why the use of var have been included now (no, is not to make look more like javascript ). Check it out.
I just found this post with detailed instruction on how to make the MVC framework work in IIS. The instructions are very basic and you shouldn't have any problems making it work, but you may not know how to modify the extension handling in IIS, so I thought to add this. http://blog.pagedesigners.co.nz/?p=29
I just came across this: http://labs.live.com/volta/. I haven't downloaded or anything but my first impression is that this try to be some kind of AIR. It's not exactly the same, but the idea, according with my limited understading, is that you program an application using any .NET language and them you can compile the application targeting different architectures. The client side always run on a JScript interpreter, most of the time that will be a browser. I tried some of the examples and the load time seems to be a little too much for my taste. Upon looking at the Net tab in Firebug, a simple Ajax dictionary download 2.67 Mg of code mostly JavaScript files that map into .net classes, but that is not the worst part, the really bad thing is that it do this making 175 individual httpRequest!!!! To be fair this is just a Technology Preview and I'm sure that they may work on some of this issues. This came out just two days ago, so I encourage you all to download it and give a try to learn more, I know I will do that.
I'm working in an application originally programmed in 200 by only one developer. I really clever guy that put in place quiet a bit of base code. The original design of the application is not all that bad, but several waves of developers have done maintenance on it. The browser landscape have changed and the application, been live and having a lot of success have to be patched on the fly. This patches have created a lot of crud and the whole base coded it's getting tired. I'm not going to go in details about the server side code, I want to concentrate in the client side part of the app. We notice the problems mostly in the html generated. It's not standard compliance since was done back them when you needed to support Netscape 4 and IE 4 (that was a real nightmare) and most people was using tables for layout, images as spacers and the style was mostly applied inline (we know today that these are all very bad practices). The JavaScript code is also old and you find the same method that does almost the same thing in four or five places, sometimes we found exactly the same function copy and paste with comments and all in two scripts files, and them both scripts file were included in the same html page. So we decided that we had enought and was time to fix the problem. The application syndicate a lot of it's content in the form of widgets and we want to make sure that we are not breaking somebody else code (our bad html has been the source of complains from some bloggers). Also we need to be sure that the css classes and the javascript methods that our widgets use are not going to interfere with other people applications. This should be a common concern for anybody doing webs sites today. Web 2.0 may have lost it's original meaning and today is mostly a marketing term, but it's quiet possible that you end up doing some type of mash up in the near future. Some tips that you may found usefull: - Use a global namespace to contain all your global variables and global methods.
- Create other namespaces but try to keep the tree short (I try to keep my hierarchy under three levels)
- If you work in a shop that have more than one product, separate your common functions for that application intro specific scripts using a second level NameSpace.
- Do not use eval (just for security).
- Pass data around using JSON instead of a propietary format.
- Check all your scripts in JSLint either online or install YSlow on top of Firebug and run it there, there is a third option that allow you to run it in the commad prompt called jslint4java but I have different results in the same script running it this way.
- Sit down and try to map in a text file how your are going to divide your code (general rules, like naming conventions and directory structure) even if you do Agile a little bit of architecture never hurt anybody.
I recommend that you take a look at the serie of videos by Douglas Crockford in the YUI theatre.
WM 11 and Firefox don't like each other very much. The infamous squishy bug is plaging the web. It's almost imposible to find a custom player around the work as it's suppose to with WM embeded in Firefox. (Take a look at the player in mlb.com for example.) The problem is that the embed tag does not respect the height parameter. It does respect the width but resize the height to the original size of the video playing, this usually result in a disproportioned video window. There are some fixes around, for example in the Safari page for Safari on windows, you can download a Firefox plugin that solves this problem in most cases. There is also a plugin developed by the open source laboratory on Microsoft, Port 25. (I can't confirm this but both downloads appear to be the same). I have installed this plugin with very good results but last week we saw some incompatibility problems with a new clean Firefox install. After installing the plugin Firefox died on us and them WM died too. We saw the problem in two different machines one is running XP and the other Vista. After that we decided that we needed to look at a different way to provide proper support for WM, we have another custom player that works really well and what that one does is detect if the user agent is Firefox (or Safari now) size the video window with the appropiate dimensions (the ones from the original video). We are also using a web service to reload the url (since it needs an authentication token) when people use a filmstrip to start the video from an specific point. The solution works really well and we are happy with the compromise, we still provide our users with a link to the plugin from Microsoft in case they want to installed, but it's not needed. Being myself a Firefox user, I don't want to install a plugin to support a video player that should work fine with a little bit of ingenuity from the programmers.
I'm trilled to discover that I'm not crazy and that my search and adoption of alternative tools (alternatives to the Microsoft tools) to develop in .net is a philosophy adopted not only by me but for a lot of people. It even has a name ALT.NET a term create by David Larabee. Just to clarify is not that I hate Microsoft, I agree that they produce very good tools and very good software in general, even IE is not that bad, even when all of us that do Web development complain constantly about it, security holes, non-standard js and DOM implementations, etc. My problem with some of the Microsoft tools is that they use too many wizards for everything or they make things easy to use only if you want to do it the Microsoft way. The Redmond giant have been changing its ways lately and they are even releasing some really good and promising stuff, like Silverlight and the ability to run it in any browser (my test in IE and Firefox have been very promising, there is not support for Opera thought and Safari in a power PC only works with the version 1.0, but this is still better than using Windows Media player embed. My problems come when looking at integrated solutions to manage the development cycle. I took a look at TFS and the whole Team System ecology and they look fine on paper but they don't work really well for me. And what with the complicate versioning and licensing!!! For all my non .net development I settle on Eclipse, I rely heavily on it, I have integration with Ant and Subversion, support for editing Java, PHP, and AJAX based applications all in the same environment. I have been playing with Mylyn and a little plug in for FogBugz later and I'm very please that I don't need to leave Eclipse at all, I even have my UML tool of choice running on it, Paradigm. I don't want to be unfair, I have been able to integrate VS 2005 with Subversion and FogBugz as well. FogBugz provides their own add in and I'm using VisualSVN for Subversion (I like Ankhsvn but has issues with web apps, there are workarounds but VisualSVN cost almost nothing and works right out of the box, it leverage TortoiseSVN).
I have been playing with the new version of Flex and I'm very impressed with it's possibilities. I did try Flex when it was first released and even when I like it, the price tag and the needs to install an specific server to use it discourage me and I decided to focus on Ajax to create rich UI. There was also the fact that at that point integration was other technologies was only considered for Coldfusion and Java, .net was mentioned as a future release and php was not even in the list. Since version 2.0 (3.0 is coming) Flex is not tied to the server anymore, you still can use the Flex server to use what they call data services but you can use Flex as a front end technology without having to worry about the back-end. I have a web based music collection manager where I implemented the interface in Ajax, so I decided to try to create a similar interface using Flex. I was surprised how easily it was, mind that I never before sit and program anything with Action Scripts or even use Flex at all, previously I only read about the technology. Also I barely used action scripts in the few flash interfaces I worked on. I was able to reuse the same web services that returned information to my Ajax UI and consume them on my flex app. I did modify one of the methods to return a different structure but that was because the original implementation wasn't any good and not because of Flex. The end result was a cleaner, nicer and (the most important for me) faster interface. I was also able to use the Flash mp3 player capabilities and integrate the player in the same interface. I could improve the Ajax UI performance modifying the WS to return JSON instead of XML, but even loading the box covers (100 x 100 pixels thumb) is faster in Flex, I don't have to worry about cross browser javascript, css or even html and I'm sure that my app will render consistently across browsers and platforms as far as you have Flash 9.0 installed (Adobe claim that 98% of the computers have it). I'm not advocating to replace Ajax with Flex, but I think that you should give it a look if you are doing an app with a lot of Ajax calls where you change the presentation dynamically. A good place to start is the Flex developer Center, lots of demos and articles that will stir you down the right path.
|