DCSIMG
Uri Lavi

Tenth Software Craftsmanship In Israel Meeting

On our tenth Software Craftsmanship meeting I was very excited to host Corey Haines.

Corey flew to Israel on Tuesday just to conduct 2 code retreats on Wednesday and Thursday so obviously he was a bit tired when we gathered for the meeting. Corey gave a short talk, concentrating on reminding us what is the value for the business that we should provide.

Here it is:

After the talk we broke into pairs in order to hand interpreter a Piet language. Piet is a stack based language whose programs are bitmaps that look like an abstract art. In our exercise we needed to hand interpreted the "Hello World" program which looks like that:

This really makes you to appreciate your compiler (or interpreter)!

Personally, I had lots of fun and my hope is that Corey will visit us soon again.

Posted by Uri Lavi | with no comments

Two Code Retreats & 10th Software Craftsmanship Meeting with Corey Haines

I am very happy to announce a few very interesting events, coming at the end of this month:

Code Retreat with Corey Haines:

Corey Haines is a Journeyman who went for an year of pair-programming tour.
Corey is highly involved with the Software Craftsmanship movement and is a frequent speaker on various conferences on the matters of code quality, skills and professionalism.

We will host 2 code retreats events on January the 25th and January the 26th (These are the same events, so please register only to one of them).
The details and the registration can be found here: Code Retreat - Take I, Code Retreat - Take II.
*** The number of seats is VERY limited ***
Please hurry up to register and if you know that you cannot attend, please remember to release the place for somebody else to attend.

10th SCISR Meeting

As you already guessed, Corey will be the key speaker on our next meeting.
The meeting will take place on Thursday, January the 26th.
The agenda and the time frames will be posted separately.
Please follow up the registration page; I will update the agenda, the location and the time frames once it will be decided.
(Please note, that there are some difficulties to find a big place to host the event. If you have suggestions, please feel free to contact me).

Agile Practitioners

For ones who are interested, Corey (and for the due diligence me and other group members too) will give a talk on Agile Practitioners conference on January the 31st.
More details can be found here on the conference's page.

Sponsorship

If you are interested in those events (and you should be ;)), I am still seeking for sponsorship to help me with the logistics of hosting Corey in Israel.
If you would like to propose some sponsorship, hosting the 10th meeting, taking Corey out or giving him a tour to Kibbutz :) please feel free to contact me.

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

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:

Posted by Uri Lavi | with no comments

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.

Writing a book
By AllOfUsAreLost

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

Posted by Uri Lavi | with no comments

Fostering Software Craftsmansip (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...

Posted by Uri Lavi | with no comments

The Code Room Event (SCIL)

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.

Posted by Uri Lavi | with no comments

Good Values Pay Off

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.

Posted by Uri Lavi | 1 comment(s)
תגים:

Cloud "Aware" Architecture

Below is a short talk I gave at the CloudCon 2011.
The subject is scalable and cloud "aware" architecture.

Posted by Uri Lavi | with no comments
תגים:,

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.

Posted by Uri Lavi | 1 comment(s)

Seventh Software Craftsmanship Meeting

I am very excited to announce the 7th SCIL 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 or directly from my blog:

 

Software Craftsmanship - Meeting 6

Chronicles of the 6th Software Craftsmanship (SCIL) 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!

SCIL6

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.

Posted by Uri Lavi | with no comments

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

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.

Warning

  • 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 rigor Code 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

Posted by Uri Lavi | 1 comment(s)

Code Smells

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);
More Posts Next page »