суббота, 3 декабря 2011 г.

Coderetreat in Lugano

On Saturday, December 3, the first Coderetreat took place in Lugano. It was leaded by Hamlet D'Arcy and hosted by Ex Machina. JetBrains was among the global sponsors of the event (thanks to it I increased the number of my T-shirts by one).

Coderetreat is a world-wide event where software developers exercise in writing code. In particular, this Coderetreat was organized in six 1-hour sessions (45 mins for coding, 5 mins for discussion and 10 mins for a break) + 1-hour free lunch. In each session the rules were the following.
  • Developers implement the same task (which was the Conway's Game of Life, described below).
  • The work is done by groups of two people. The groups change each session.
  • In the end of each session all the code is deleted.

The Conway's Game of Life is a self-developing world of cells that can be either alive or dead. The rules of the world are the following.
  1. Any live cell with fewer than two live neighbors dies, as if caused by under-population.
  2. Any live cell with two or three live neighbors lives on to the next generation.
  3. Any live cell with more than three live neighbors dies, as if by overcrowding.
  4. 4. Any dead cell with exactly three live neighbors becomes a live cell, as if by reproduction.
Note that the world can be infinite and/or closed from any side (i.e. a cell going to the left arrives from the right). Also the cells, theoretically, may be of any geometrical shape.


The whole idea of the event is that every session a set of suggestions is given encouraging developers to explore different approaches to the task implementation. In particular, the following suggestions were given session by session.

1. Developers got familiar with the task and started designing and implementing the solution without any restrictions.

2. As a result of the previous session, most of the groups had the concepts of a Board/Grid and a Cell that had a boolean state isAlive. First, it was proposed to get rid of the primitive types like boolean and replace them with abstractions. For example, the class Cell may have subclasses AliveCell and DeadCell. Another suggestion was to use "visual" tests, i.e. the tests that can be visually understood even by non-experts, because the game is actually visual. To summarize, the suggestion were:
  • abstractions;
  • visual tests;
  • test first.
3. Since most of the groups followed the standard approach, where the nouns were used to determine classes, it was suggested to think more about verbs and to build classes around them. For example, the main class may still be the Game class, but we should think primarily of its actions that are calculateNextGeneration() and render(). These methods can by directly tested by visual tests (draw a game before and after one step of evolution and compare these two instances) and then implemented. So the suggestions were:
  • verbs;
  • methods <= 5 lines, classes <= 3 methods.
4. Ping-pong session: one developer writes a test, another one implements it. After some time developers change the roles. Developer that writes tests usually thinks of the trickiest tests he/she can write.

5. After the previous session the code was not deleted but each group summarized the advantages and disadvantages of their code on the paper. Then the groups changed the computers. Thus each group was given a code by another group and a summary of its strengths and weaknesses. The task was to improve the code.

6. Each group could choose one of the following restrictions:
  • change a programming language;
  • do not use the if construction;
  • do not use the inheritance (?).

To my opinion, the event was extremely useful and it is a pity that it happens only once in a year. I think a week of such training may improve one's programming skills considerably and, in fact, there are many companies offering such courses for a huge amount of money. So all in all I would recommend everybody to participate in this event at least once.

вторник, 22 июня 2010 г.

SPbSU are the finalists of the SIGMOD 2010 Programming Contest

(translated from Dmitry Barashev's post)

The team of the Information Management Research Group of the University of St.Petersburg became the finalists of the ACM SIGMOD 2010 Programming Contest. The Contest was about the development of a distributed engine for querying relational databases. 29 teams took part in the Contest and 5 reached the final. The first place was won by the Stanford University as its Database Group is one of the strongest in the world. The winners will present their works at the ACM SIGMOD 2010. Congratulations to the SPbSU team!

понедельник, 1 июня 2009 г.

The end of the academic year at USI

2008-2009 academic year at the University of Lugano, the Faculty of Informatics, finished on Friday, May 29, with presentations of students' achievements. The event consisted of several parts dedicated to a separate course each: one part for every year of the bachelor program (3 in total) and one part for the master program. Every part started with a course overview, given by a professor, and continued with students presentations describing their achievements within the course.

Bachelor session
First year bachelor students go through "Programming Fundamentals" course, which ends up with mini-projects written in Java, one for 2 students. Two projects were presented. One calculates the fastest path for a given map and a given vehicle location with respect to a current traffic (!). The map and moving vehicles are represented graphically. One can generate new maps and manually drive a vehicle. The other project implemented fully functional Arcanoid game up to a level editor (!). Thus the students were able to manage pretty complex algorithms implementations and graphical applications within a first year, which is very impressive for me. During the course and the project students also learned patterns, UML and version control system.

Second year bachelor students dealt with web-programming. As a result they developed an on-line web-page editor (like Google sites). The choice of the programming language was a little bit strange for me - they used smaltalk. Moreover, it is not clear how much did they do on their own besides frameworks and libraries used. Unfortunately the result was not as impressive as that of the first year students. The system is only in its initial state now and is not user-friendly, one has to click a lot to work with it.

Third year bachelor students within the course of "Theory of Computation" invented a boolean formula of sudoku. Based on that formula and one of the SAT solvers they implemented a simple application which generates sudoku of different sizes with some predefined numbers. Although the course is more theoretical and is not as visual impressive as the previous ones, the work done was significant and the presentation itself was very good.

Bachelor session ended up with 2-minutes bachelor projects presentations. During the bachelor program each student was involved in some research activities within one of the Faculty's research groups. Students accomplished some practical tasks in the scope of the group they worked with. The bachelor projects defense will take place on June, 16.

Other sessions
When presenting the master program of the Faculty, Professor Pedone asked, how many third year bachelor students were going to participate. Only 3 out of 10-12 answered in the affirmative. (Here I have to mention that we have only 10-15 students per year, which is less then a little). On the other hand, the Faculty is supposed to attract people from outside Ticino canton (and from outside Switzerland as well) to take the master program in Lugano. The more students come the more funding the Faculty gets.

The overview of master projects was presented. The defense will take place on June, 18.

I also have to mention that the Faculty offers summer internship for students. Again students have to work within one of the research groups for 2 month. The achievements of two such interns were presented.

The event ended up with a small banquet organized by the Faculty.

Overall impression
Not only the current students achievements impressed me much, but also the possibilities for studying and practicing they have here. Their success is caused not only by their passion to study and work, but also by a quality of professors and courses offered by the Faculty. Several young professors passioned to teach use the latest technologies both in informatics and teaching. Most of the professors try to make their courses as much interesting for students as possible. And I am happy to take part in this process.

Another very good point is that students always present their works, both during a semester and in the end of it.
  • This gives an impression of educational milestones other than exams.
  • Students practice presenting their work a lot.
  • It makes them fun.
I have to say, that students' presentations on the whole were much better than those one can expect from professors and researchers. Presentations were well-formed and well-presented with a sense of humor almost in each of them.

Again, my impression is that hard-working students, supervised by good professors (and assistants) can do almost everything.


Some notes on the curriculum of the Faculty of Informatics, the University of Lugano.
According to Bologna process, informatics curriculum is divided into bachelor (3 years) and master (2 years) programs. On top of that there is a PhD program (ideally 3 years, but actually 4 years), which forms 3-5-8 formula. As soon as students can change their specialization after bachelor program (continuing, for instance, in economics or whatever else) the task of the Faculty is to give "full" informatics education in 3 years. Therefore the curriculum covers only required minimum of disciplines needed by an average IT specialist, although there is at least one theoretical course almost every semester.

вторник, 12 мая 2009 г.

Leslie Lamport at USI

Leslie Lamport visited the University of Lugano on 11 - 13 of May and gave 3 talks. His main idea is to use math in programming. Before writing a code programmer should try to represent the idea of a program mathematically. This is needed
  • to understand better, what he / she is going to implement;
  • to formulate the idea precisely without any natural language;
  • to avoid bugs before implementing the code.
Lamport did not talk about proving the correctness of programs, but showed on several examples that it is possible to "assign meanings to programs" (see the paper by R.W. Floyd), i.e. mathematical meaning.
Obviously, it is impossible to convince everybody from programmers to CEO that it worth spending time on that (for the same reasons which Fowler mentioned in his "Refactoring"). Therefore this "math" idea can be treated as a long-term message to the software engineering community. Lamport proposes to start from university education and make an emphasis more on math than on programming skills. As soon as a new generation with such an education appears, it will not be difficult any more to convince anybody to use math in programming.
Lamport talked about TLA+ language, which is again a formal math (+ couple of temporal logic operators and some others like ') and about its application for writing specifications. He also presented PlusCal algorithm language, which is based on TLA+, and encouraged to use it in writing algorithms instead of pseudo-code because of PlusCal preciseness. His book on all this stuff is available.

P.S. This text is my own understanding of what was presented and can be different from Lamport's point of view.

пятница, 21 ноября 2008 г.

JUG Lugano

Yesterday was a first meeting of JUG Lugano.