Thursday, December 22, 2011

Ninth Software Craftsmanship Meeting

Our ninth #SCISR meeting took place on this monday.

I really enjoyed the mingling, the discussions and the energy in the air. This time we had an open panel with Ran Tavory, Elad Sofer and Lior Schejter talking about their experiences in Software Development.
I will post a detailed post about the meeting, but for now you can find below the recording of the session.



Software Craftsmanship in Israel Group Meeting #9 (Hebrew) by urilavi

Thursday, November 17, 2011

Software Craftsmanship and Apprenticeship Patterns with Ade Oshineye

During the Google Developer Day in Israel I met Ade Oshineye the co-author of the Apprenticeship Patterns for an informal talk on his book.

Unfortunately, my battery didn't allow me to record a longer session, but we did cover among others what is Software Craftsmanship, how Ade and Dave started to write the book and whether we can define mastership patterns...

In addition, after the recording we had a great time in continuing the discussion on various topics that deserve their own blog post.

You can view the short video here:

Friday, October 28, 2011

It's Alive

I and my friend are both in the process of building our houses (I actually already moved in, but the process never ends ;)).
Needless to say, that we invested a lot of energy (and money) to oversee the construction.

Somehow, during one of our talks, we touched a very interesting observation. We both hired an architect (a real one, not a software architect :)) and we both benefited from the great ideas these architects brought to the table.

You see, the house I am building is just a simple 5 rooms apartment, which will stay for me the same 5 rooms apartment regardless where the kitchen will be located. However, just from a quick glance at the sketches, my architect is able to spot things, that usually would take me a long time to identify and to appreciate as a better utilization of the space and the structure.

The interesting thing is that the same process happens to me while working with code.
Somehow the code becomes alive when I am looking at it.

These aren't just simple assignments or method calls. These aren't just simple lines of code.
When I read and write software (*) I see relations and responsibilities...
I see "real" interactions between objects trying to talk together in order to accomplish a task.
It is quite amazing, as sometimes I am able to "visualize" the code in front of me: It forms a story.


Usually I can follow the story by spotting who said what to whom; As all great stories I can spot the places where somebody said too much or tipped something to somebody he shouldn't. Following the plot, I can identify the core characters (the must components); Without them there is no point in the story at all. Watching the interactions enables me to visualize different abstraction levels; Those in turn will reveal the required actions on the core (or other) characters.

Definitely, I can continue on and on with the analogy.
Yet, I am not the first one to point about the relation between writing in general and writing (constructing) software.

If you really want to become a great programmer you should read (and write) code as a story; Visualize and watch the plot!

(*) The reading is intentionally before the writing

Friday, October 21, 2011

Fostering Software Craftsmanship (or How to Build Successful Teams) - Hebrew

Last month I presented a short lecture about Fostering Software Craftsmanship (or How to Build Successful Teams) to one of the top notch technological units in IDF.

The lecture is a hybrid of management and engineering skills.
It focuses on the dissonance between the needed software engineering skills in the industry and what happens in the reality. The main idea in the talk is that using Software Craftsmanship principles as individuals and as TEAMs makes it possible to create high quality groups that produce great products.

The lecture is in Hebrew and I hope that you will find it interesting...


Monday, May 16, 2011

The Code Room Event (SCISR)


I am happy to announce the first Software Craftsmanship in Israel Code Room event to be held in Google Israel which kindly volunteered to host us. (Many thanks!)
The Code Room

Have you ever wanted to code with the bests of the bests?
Have you ever wanted to learn from the real professionals how to choose the right architectures & designs?
Have you ever wanted to rub your elbows with the great developers?
Now you have the chance!
The code room meeting is all about coding a small project together.
The purpose is to enrich the participants with different programming approaches and styles (architecture, design, clean code, unit testing and etc...).
The session will be divided into several acts:
Act I    - Choosing the Architecture
Act II   - Choosing the Design and the Programming Environment
Act III  - Implementation
Act IV - Presentation (if the time permits)

Hurry up, there is only 50 places!!!

Please bring your laptops with your favorite programming environment set-up.
----

Here you can find a short movie that demonstrates how much fun we had :)

Thursday, April 28, 2011

Good Values Pay Off

(Cross post from IRefactor)

To simply put, we have been acquired!
For the past couple of years we have been working hard to enhance our technological solutions, the de facto: scalable, near exact match, visual search engine. Using this visual search engine as a backbone, allowed us to envision and to develop many of our great products.

Not surprisingly, PicScout not only became the market leader in the image copyright solutions, but also provided unique solutions in the terms of crediting every image on the web.

On a personal note; Serving as a VP R&D during this time, building the architecture, driving the technology and working with the greatest team ever - was remarkable and enjoyable. I am happy to be a part of a great team where professionalism matters and which employs many of the Software Craftsmanship values, I so deeply encourage!

A few moments ago, we have officially announced that we (PicScout) have been acquired by Getty
Images
.

I am sure that our unique technological value will continue to benefit to the world of images.

Thursday, March 31, 2011

Cloud "Aware" Architecture

Below is a short talk I gave at the CloudCon 2011.

The subject is scalable and cloud "aware" architecture.

Friday, February 25, 2011

What should I learn in my CS degree?

My strongest believe is that everyone who devotes his life to Software Engineering, should have a CS degree.
Graduation

Why? Well, it's a different question, so I would postpone my answer for now.
Instead, in the following post I would like to emphasize the subjects (and hence the tools) one should acquire during his studies.
These tools are essential in creating a "shared" language between us the engineers.
These tools are essential in being the solid ground of our day to day architectural and lingual abstractions.
These tools are essential in being the means of our research capabilities, logical deduction, advantages and disadvantages of each method we apply and etc...
In my opinion, those are the topics one should concentrate on:
  • Data Structures - Any course that involves Data Structures, from basic to more complex Data Structures.
  • Algorithms - Graph Algorithms, Dynamic Algorithms, Greeding Algorithms, Aproximate Algorithms, Computational Geometry and etc...
  • Operating Systems - Everything that involves Operating Systems from theory to practice. If there is a lab on OS, take it!
    The importance of understanding the bits and bytes of the biggest abstraction we work against every day is priceless.
  • Artifical Intelligence - Searching techniques, Logic deduction, Decision tees, Learning technique such as Markov Chains, Neural Networks, Bayesian Networks and etc...
  • Programming Languages - No, it isn't "Programming in Java"; These courses involve the principles of Software Languages, which are crucial for identifying the right tools for the job.
    Imperative and Declarative Languages; OOP, AOP, Functional and Logical Languages; The more principles you learn (and the more languages you see) the more you will understand how to apply these languages and when.
In addition, I recommend taking a few "narrowing" courses, courses that are deepening your expertise in a specific field.
Some examples are: Natural Language Processing, Computer Vision or Distribute Programming.
It's worth noting that, in my opinion, practical principles of "constructing" software should be learned differently.
Those skills are better acquired by enrolling into an apprenticeship program, by reading classical books and essays, by rubbing elbows with others or by deliberately practicing.
If you are interested in such practical experience, please apply for the Mentorship/Apprenticeship program we enrolled in our Software Craftsmanship Group.

Thursday, February 24, 2011

One small step for a man, one giant leap for mankind


(Cross post from IRefactor)
Lately I had a lot of thoughts about how to introduce a change within an organization.
For a while now I am giving some talks about leading a software development team, focusing each time on a different facet, such as: Quality, Architecture, Recruitment Process and etc...
(I have combined some of those thoughts into a short lecture, which I entitled Fostering Software Craftsmanship (Building Successful Teams) and it is given as a part of the IL Tech Talks).
But here is a phenomena, I encounter each time.
Most of the audience understand the importance of the concepts, but really struggle with introducing them to their organization.

Martin Deutsch
  • Writing Unit Tests will lengthen my development time!
  • How much time should I "reserve" for doing Refactoring?
  • How do I explain to my manager that Refactoring is important?
  • Code Reviews are difficult, because people have different tastes!
  • Code Reviews are taking too long! We will not be given the time to do it, ever!
  • Continuous Integration will take a few weeks to accomplish. I won't be given any time to do it in the near feature!
  • Those concepts are great, but the time to do them should be allocated by the management.
  • ...
I am sure we all heard those sayings. Heck, we even have given those once! (No... Not really :) )
Though I have a lot to say and comment about each and every one of the above statements - there are some broader aspects I must cover first.
We all hate changes, don't we? Doing Unit Tests, investing our time in Refactoring (or Builds) - those are just an extra activities that we have never done (or done correctly).
One should really invest his own time in order to polish those activities and doing so is just recognizing that we need to change. As humans, we find it extremely difficult to accept changes.
Jack Welch understood it perfectly, but nevertheless he succeeded to introduce a lot of changes to GE. Jack Welch found the change to be exciting, daring and imaginative.
GE success can be rooted to its ability to change and to change fast.
However, applying change in the simplest way doesn't work.
We cannot accept the change all at once. Evolution takes its time; Therefore, in order to accept the change we also should adapt one step after another.
(It's really like Refactoring Steps: One small change at a time, compile and test).
Sometimes it takes years to introduce all those concepts to your teams:
Start by a simple task, like code conventions or source control layout, then teach unit tests and invest in teaching code smells, continue by applying rigorCode Reviews and etc... and etc...
Doing everything in one big bang just doesn't work. I have seen several teams that got introduced to Scrum or TDD in a matter of weeks. Those are big changes to somebody who didn't evolve to the "right" point. Needless to say that the failures that those teams experienced were so discouraging that till now some of those Software Engineers hate TDD and claim that Unit Tests (even not TDD) are plain waste of their time.
You shouldn't be surprised that applying all the great concepts to your organization will take years.
One step after another; One small step for a Software Engineer, one giant leap for an Organization.

Close-up of Astronaut?s Foot on Lunar Surface - NASA Images

Seventh Software Craftsmanship Meeting

I am very excited to announce the 7th SCISR meetup.

How to utilize efficiently Programming Languages?

Lectures:

-Dynamic languages seem to be more concise and less verbose than their Static counterparts.

However, using Dynamic languages efficiently requires a different approach.

During the first part of our meeting Reuven Lerner will demonstrate the
differences between Dynamic and Static languages and present the right approaches to utilize the full power of a Dynamic language.

-While general purpose languages can solve any problem, the creation of special-purpose languages for expressing problems and solving a particular problem domain is highly efficient.

During the second part of our meeting Dror Helper will explain and demonstrate what are Domain Specific Languages (DSLs) and how they can be used to solve problems in a particular domain.

Hands On:

In the hands on part we will exercise writing DSLs.

Please bring your laptops (with the environments set-up) to the meeting.


Time frames:

Lectures:

18:00 - 18:25 - Gathering

18:25 - 18:30 - Short Intro

18:30 - 19:00- Static vs. Dynamic Languages

19:00 - 19:05- Break

19:05 - 19:35 - Domain Specific Languages (DSLs)

19:35 - 19:50 - Break + Giveaways

Hands On:

19:50 - 21:00- Implementing DSL


Giveaways:

We have great giveaways to give during the meeting. DON'T miss them :)


Food:

Although we are plaining to have basic food, please also bring something with you for the group.

(Thus we will be able to support the event with the user generated food).

Please register here.

Software Craftsmanship - Meeting 6

Chronicles of the 6th Software Craftsmanship (SCISR) meetup.

This time, we discussed and practiced my own very beloved technique - called Refactoring.

During the session Itay Maman demonstrated a real life project that he needed to refactor for his company.

On the first part of our meeting, Itay refactored a very lengthy method in the CustomAction class, called actionPerformed.

Here is the initial code of that method.

You can watch the session here, where Itay demonstrated his approach and the refactoring steps he applied.



On the second part of the meeting, we practiced by refactoring the same code, but this time without the unit tests.

If you are familiar with Refactoring, then you should know that it is totally incorrect to perform it without the "safety net", i.e. unit tests.

However, Itay's genius idea, just proved to all of us that changing the code without having the confidence of "not breaking" the system (i.e. unit tests) is very hard and almost impossible.

As usual, I had a great fun. My hope that the community will continue to grow!

SCISR6

Tuesday, January 11, 2011

Sixth Software Craftsmanship Meeting

Our six meeting will deal with a Software Engineering technique called: "Refactoring".
This is one of my favorite techniques, which is usually misunderstood and overlooked (e.g. Refactoring != Rewriting).

So, here are the details:
Subject: "Refactoring Workshop

We will refactor several real life examples in pairs (or triples). 
Also, we will be demonstrated with the techniques to create a better code.
Please bring your laptops (with the environments set-up) to the meeting.

Time frames:
18:00 - 18:25 - Gathering / Mingling
18:25 - 18:30 - Short Intro / Explaining the meeting's set-up 
18:30 - 19:30 - Refactoring I (60min)
19:35 – 19:45 - Break + Giveaways
19:45 – 20:45 - Refactoring II (60min)
20:45 – 21:00 - Wrap-up + Giveaway 

Giveaways:
We have great giveaways to give during the meeting. DON'T miss them :)

Food:
Although we are plaining to have basic food, please also bring something with you for the group. 
(Thus we will be able to support the event with the user generated food).
 You can register here.

Monday, January 3, 2011

Code Smells

(Cross post from IRefactor)

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);
            lock (_sync)
            {
               timers.Add(timer.GetHashCode(), timer);
               callbacks.Add(timer.GetHashCode(),
               x =>
               {
                  lock (_sync)
                  {
                     var t = timers[x.GetHashCode()];
                     t.Stop();
                     t.Close();
                     timers.Remove(x.GetHashCode());
                     callbacks.Remove(x.GetHashCode());
                  }
                  // invoke function provided by caller
                  timerCallback(null);
                });
            }
            timer.Elapsed += timer_Elapsed;
            timer.AutoReset = false;
            timer.Start();
      }
}

Here are some Code Smells, that can be identified:
  • TimerManager (a weak smell) - Everything that is called a manager alerts me a great deal.
    Usually managers are God objects, have low cohesion and high coupling and violating too much
    OO principles...
    It doesn't necessary mean that the same happens here, but it should be noted and then verified in the code.
  • TimerCallback should be generic or restricted by a Data Type.
    It's better to specialize the TimerCallback with more concrete type parameter. Having said
    that, it might be that the author wanted to use the built in TimerCallback in .NET.
    In such a case the declaration is redundant.
  • static _sync object.
    The class has only instance members, besides that _sync object; Will it make sense to do the following?
TimerManager timerManager1 = new TimerManager();
timerManager1.SetTimeout(...);
... 
TimerManager timerManager2 = new TimerManager();
// here timerManager2 will block on the same object as the timerManager1
timerManager2.SetTimeout(...);
  • Both Dictionaries are just plain procedural programming definitions; It is the same like having 2 arrays aligned by their indexes as both the dictionaries will be accessed by the same index (an int). Behold, as one mistake (accessing the wrong index) can lead this code to an undefined behavior.
  • GetHashCode shouldn't be used to identify uniquely an object.
    Let me repeat again... GetHashCode mustn't be used to identify uniquely an object...
    GetHashCode's implementation is needed for collections (and Equals, see below).
    Sometimes the same result of the hash code will put two different objects in the same hush bucket - which means those are not unique identifiers!!!
  • Once implementing GetHashCode, the Equals method should be implemented as well.
  • Consider the follwoing code:
t.Stop();
t.Close();
  • One should be familiar with the tools at the hand.
    Close() does what Stop() do and more... Calling Stop() and then Close() just makes the method a little bit longer without any effect.
    When in doubt, consider to take a few moments just to review the provided API.
  • Redundant Remark.
    The remark repeats the code, doesn't bring anything informative enough and affects the length of the method.
    It can be safely removed.
// invoke function provided by caller
timerCallback(null);
  • Thanks to Aviv the following is of course another smell: passing null to the callback function (i.e. declaring the parameter in the callback and eventually passing null).
timerCallback(null);

Sunday, January 2, 2011

TechEd 2010 Thoughts

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 some facts that I have learned:

Windows OS

Windows OS:

Windows 7 is considered to be a very good operating system.

Microsoft revealed that in 2010 over 240M licenses were sold, almost 88% of the business are moving to Windows 7 and their projection for 2011 is ~409M in licenses.

The adoption of Windows 7 is important because most of the users/businesses previously voted by not upgrading to Vista operating system. Being able to move the users to Windows 7 is important in order to minimize the risk that the users will stay with an old platform and thus (potentially) will be more open to move to other browsers and operating systems. Therefore Microsoft can rest in piece for now, as its clients starting to upgrade to their best OS (till now) which of course opens different perspectives and deepens the control of the IE (Internet Explorer) browser.

And while talking about the browser...

Silverlight IE9

HTML 5/Silverlight:

After having the web filled with rumors that Microsoft is killing Silverlight and the official blog post by Bob Muglia, Jason Zander specified in his opening talk that Silverlight should aim for the following scenarios: a. Business Applications b. Devices (Windows Phone 7) c. Streaming Media. He also emphasized that as Micrsofot were always good in supporting standards, Internet Explorer 9 fully supports HTML 5.

Looking into the future it's actually not surprising. Our web browsers can be safely considered as the next operating systems. Our work routine is around a browser, not only by browsing web sites, but also by utilizing them as applications for news, newspapers, eBooks reading, e-commerce, banking, development and etc... Therefore it is very important to Microsoft to be as much compatible to the standards, especially when Silverlight didn't provide the expected adoption rates.

Jason mentioned that the IE team has rebuild the JavaScript Engine and improved speed, GC and its interop with the DOM. Everyone who is familiar with the speed comparisons between the browsers will say that it was a necessary step in order to allow the IE to compete with others. Just a thought here, how about releasing the JavaScript Engine as an open source :) ?

Azure:

TechEd2010.Thoughts.WindowsAzure.PNG

Finally a cloud; Microsoft invests a lot of effort in Azure. It starts in investing a lot in explaining why PaaS (Platform as a Service) is a better choice for developers than IaaS (Infrastructure as a Service), continues with providing very good tools for developers (about that in a moment) and finishes with demos and facts about the ease and speed of the development on Azure.

One of the really good demonstrations was a demo of how to develop one application and deploy it on Web (ASP.NET MVC), Windows Mobile Phone 7, Kinect and Azure. Microsoft has been known for years for their top-notch development tools which easily integrate one with another. By allowing developers to deploy the application into the cloud (Azure) in a minimum effort, Microsoft's assures better chances of adoption.

All in all, I had a great time.

Thanks to Microsoft for inviting!