March
5

I found myself in an interesting coaching spot - I am going to teach Alt.NET to a programming infant. I’m going to create the first Alt.NET baby.

baby Real life sometime brings you to strange situations. I lead a development team which is building a web application and we recruited a new member a couple of weeks ago. I’ll refer to him as “the baby”, since he never wrote a single line of code.

Why is he on board, you ask? Well, he’s a fresh computer science student and knows his way around the presentation side of websites (good knowledge of HTML, CSS, Javascript and good ol’ web black magic) so this seemed like a good trade-off for both sides - the baby will join the team and help us out with his mighty presentation powers and in exchange will be part of a real project for the first time and will get on-job-training.

This is an interesting spot. Computer science has brought his knowledge to a certain level so far (basic C) and I need to catch him up with:

  1. Object Oriented Programming,
  2. What design is,
  3. Separation of Concerns,
  4. Liskov Substitution Principal,
  5. The .NET Framework (3.5),
  6. A whole bunch of BCL,
  7. C#,
  8. Relational databases & SQL,
  9. Active record & SubSonic,
  10. MVC,
  11. Dependency Injection & Inversion of Control,
  12. Test Driven Development & MbUnit,
  13. Mocking with Rhino Mocks,
  14. Design patterns,
  15. Scrum,
  16. Continuous integration,
  17. Source Control Management with Subversion,
  18. Tools.

Oh, and this needs to be done as we go on with the project.

Can you think of anything I forgot to mention?

Does the order make sense or would you suggest a different one?

Eeek.
kick it on DotNetKicks.com

6
September
5

The Tree & Wind Analogy

Posted In: Design by rauchy

Over the past few years I found myself training several fresh computer science bachelors and introducing real world software engineering to them.

The easy cases were those who came by with a submissive approach and accepted just about any methodology I suggested. The hard nuts could be divided into multiple groups, but the hardest of them all were those who thought that design is unnecessary.

I’ve seen several pieces of fresh meat who thought that there is no real reason to model your application into classes, modules, components or layers. They’ve learned how to program in C back in college, and were certain that once you have a requirement you can start writing lines and lines of code.

Personally, I don’t feel comfortable giving orders to people on such issues. I can’t just force them to design, because I think you must believe in what you do and if you get an order from your boss to design, you will do it poorly and without putting your heart into it.

I’ve tried several approaches to convince these tough nuts, from lectures on different kinds of ilities to giving them small projects and changing requirements upon completion.

These seemed to have little effect as my students had quickly forgotten or ignored them. They insist that they can develop just about any application in a single class.
The best way I’ve found to open up their eyes was using what I refer to as the tree & wind analogy:

I simply take a student to the nearest window and point at the nearest tree, I ask him what kind of behaviour he sees. I tell him I see a tree, who’s leaves are being blown away by the wind. I try to make him understand that even in nature, there is no such thing as “just logic” and there is no behaviour in the world that is not related to an object.

Usually, after understanding this they start listening.

kick it on DotNetKicks.com

0
March
27

Why TDD Works For *Me*

Posted In: Design, TDD by rauchy

Having been involved in test-driven projects over the past 2 years, I found myself explaining the advantages and disadvantages that test-driven introduces to software projects to many people whom I taught, trained or coached.
I always stuck to the usual points, for instance, “design by usage”, “safety-net for your code”, “faster drilling to the heart of the problem”, “provides documentation for your code” etc. These are all great advantages for the project, and everyone in the project (including management) eventually enjoys them.

Lately I have been asking myself – why is TDD good for me? How do I profit from it? What’s in it for me? And most important: Why do I deliberately get myself into TDD adventures and even dare to say that I enjoy it?

Well, the answer is simple: Test Driven Development allows me to be an idiot, and keep getting paid for it.

When writing code, I face two tightly-related problems: Functional requirements (making sure my code does what it’s supposed to do) and design requirements (making sure the code is simple, efficient, coherent, extensible etc.).
Solving both these problems is a big headache, and I often find programmers failing to provide a solution for both of them. I often find poorly designed code which answers its requirements or well-designed code which does not.

TDD allows me to split this headache into two manageable problems.
Following the Red-Green-Refactor mantra carefully, I start with writing horrible, horrible code which answers the requirements. I continue making it all the way to the green stage and continue iterating until I have a hefty, sloppy method which answers all its requirements.
From that moment on, I do not need to worry about the functional requirements any more as my code is already obliged to solve them by unit tests, and any slight shift from that obligation will immediately come to my attention.
This is the part the real fun sets in. I have the freedom to design (actually, redesign) without worrying about breaking functionality. Like a lucid dream, you can do whatever you want, without the risk of getting hurt.

This way I can concentrate on each phase separately:
When answering requirements, I just have to make sure the code does what it is supposed to do, even at the price of code duplication, inefficiency and plain ol’ dumb code.
When refactoring, I have a well-set environment that allows me to apply design techniques without worrying about functionality.

This raises a question – can the role of the modern developer be split to two as well? A less-experienced developer will handle functionality and a more experienced developer will refactor?

If you liked this article, kick it on DotNetKicks.com !

3
March
16

The article discusses the crooked way that the Singleton pattern is used in many software systems. I’ll admit it - I made this mistake many times.
If I have to choose one thing to take along from this article, it is that Singleton should not be applied freely on types which access is to be restricted to, but only for those rare cases which the type models a real world restricted object, like a class which encapsulates access to a configuration file or a queue.
Certainly, Singleton should not be applied to every stateless class, use static classes for that.

http://aabs.wordpress.com/2007/03/08/singleton-%e2%80%93-the-most-overused-pattern/

0
February
15
0