Code Smells

יום שני, ינואר 3, 2011

If you like practicing in identifying code smells, then you can find below a short class called TimerManager. public class TimerManager { public delegate void TimerCallback(object data); private static readonly object _sync = new object(); private readonly Dictionary<int, Timer> timers = new Dictionary<int, Timer>(); private readonly Dictionary<int, TimerCallback> callbacks = new Dictionary<int, TimerCallback>(); public void SetTimeout(TimerCallback timerCallback, int snooze) { var timer = new Timer(snooze); ...

TechEd 2010 Thoughts

יום ראשון, ינואר 2, 2011

TechEd Eilat 2010 is long over... And with all the hassle of day to day work and other obligations only now I have found a few minutes to write my thoughts. As everybody who has previously attended such a venue would tell you, Microsoft really knows how to set-up and orchestrate such a huge event. It is really impressive to see... Instead of summarizing the events from each and every day I have decided to draw a different perspective and to provide some analysis (which of course reflects my and my thoughts alone) on Microsoft's behavior and its future roadmap... Here are...
תגיות: , ,
אין תגובות

Short Roman Numeral Kata

יום שני, אוגוסט 16, 2010

For our second Software Craftsmanship Coding Dojo, I have prepared a "Short Roman Numeral" Kata. In essence, a Short Roman Numeral is a number between 0 to 3999 that has a ToString() method which returns its roman presentation. The rules of roman presentation construction can be found here. After the meeting, I took some time in order to record the Code Kata. As you probably know it is extremely difficult to produce a well synchronized recording. Hence, after a few sleepless nights I have finished the recording with great satisfaction, only to discover (thank you my "dear" friend) that I made a typo during...
אין תגובות

ALT.NET Tools Night

יום רביעי, יולי 14, 2010

On 12.07.2010 we have a lot of fun meeting at ALT.NET Tools Night. The topics were: Test Lint - Eli Shalom. CodeRush & Refactor Pro - Me :). NDepend - Dror Helper. Process Explorer - Ariel Raunstien Iron Ruby - Shay Friedman Testify Wizard - Lior Friedman Below you can find three sessions I have managed to record. (Unfortunately, I didn't manage to record more, as I needed to leave earlier.) Enjoy! Many thanks to Lior Friedman, Shay Friedman and Ken Egozi for organizing the event.
תגיות: , ,
אין תגובות

Writing Readable Code – Complex Object Construction

יום שישי, אפריל 16, 2010

Once upon a time, there was a class called Invoice. Its responsibility was to calculate a final price being presented to the customer. Time went on; The autumn passed, the winter fade out and the spring was already at the door and our class started to rust. Each time a developer found a new set of relevant parameters (that should have been passed to the Invoice class) he added a new constructor, to support them. And so it happened, that after...
3 תגובות

Refactoring Tools Review – part II

יום חמישי, מרץ 11, 2010

Oh, my God! I am definitely in love! I finally had the time to play with the latest DevExpress's Refactor! Pro and Code Rush. Two distinct main features capture my eyes immediately: The ability to highlight the changes/code smells and refactorings inside the Visual Studio's Editor. It seems that the team invested a lot of effort in order to enable painting on the Visual Studio's editor and canvas. This enables a smooth user experience, without prompting and stalling with unnecessary dialogs. The changes are visualized directly on the source code. Below is one of my favorite refactoring steps: "Extract Method" visualized in Visual Studio 2008. A huge amount...
תגיות: , ,
3 תגובות

Prime Factors Kata

יום ראשון, מרץ 7, 2010

One of the key aspects of a Software Craftsmanship is constant practice. Kata (from Martial Arts) is one form of such practice. The notion of a Code Kata was first introduced by Dave Thomas and can be viewed as: Practice of the same methods, solutions and activities to a perfection. Practice of the same problem, tackling it each time from a different angle or with a different solution. Solving a known problem multiple times utilizing the same methods, enhances the understanding of the specific steps; It especially enhances the understanding of unit tests, refactoring steps or "Design" approaches. Moreover, striving to do better...
אין תגובות

LINQ Podcast

יום שני, פברואר 22, 2010

Here you can find a short podcast I recorded with Ran & Ori from Reversim; The subject is LINQ (in hebrew). The podcast is forty thousand feet overview on LINQ, but it was still a lot of fun :) (mp3 is here.)  Many thanks to Ran & Ori !!!
תגיות: ,
אין תגובות

Experts Days – 2009

יום שישי, דצמבר 4, 2009

This week we concluded the Experts Days. The sessions were effectively organized (by Eyal Vardi from E4D), the audience was amazing and the atmosphere was energizing . Here are the headlines of my sessions: I. What's new in .NET 4.0 and VS 2010: The main focus was to emphasize the most important (in my opinion) upcoming features. Here they are: Task Parallel Library, PLINQ and Coordination Data Structures Code Contracts Reaction (Rx) Framework Managed Extensibility Framework (MEF) Dynamic Language Runtime (DLR - and especially F#) Also, we reviewed a lot of other upcoming features in .NET 4.0 and Visual Studio 2010 (IDE). For those, willing to have a deeper look, here...
אין תגובות

DTOs, Business Entities and Persistency

יום שבת, אוקטובר 24, 2009

When designing an application, one can easily confuse DTOs, Business Entities and Persistency. Using the following simple examples I will demonstrate design considerations and thoughts that will dispel some mists. Consider that you want to represent an audio or a movie located on a web page. When you visualize such an object, the first thing you probably see is the data that characterizes it. No surprise here. You applied, without knowing it, an "Information Expert" pattern when you visualized the object's knowledge responsibilities. So, what are they? Clearly such an object will have: Uri - object's URL Content - object's content DateCreated - object's creation date Etc... I will...
תגיות: , ,
אין תגובות