peer code review and ascii art
Mar. 24th, 2010 03:22 pm![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
While at Google, I believed in two things: peer code review and unacceptability of ascii art in the code.
Peer code review means you are supposed to show your stuff to somebody in your team before submitting it. So, when you want to submit the stuff in the end of the day (yes, all unittests pass), you are supposed to hold on, wait for half a day (the next day), not touching the code, get into a discussion, and then, eventually get through with it. Which means the code should be pretty solid. No way you would go ahead submitting something working but halfway through, or something that is in the process of being formed, in transition, work in progress.
That's bad. I found myself spending several days forming my ideas regarding how I can possibly specify binary output format in JSON, so that the format can be sent From Above to the client when requirements change (say, a new format is eventually implemented by busy/lazy server guys). If I had to submit a fully-implemented, fully thought-out, neat-looking code, it would take a couple of weeks. Thinking, prototyping, discussing, including three days of explaining how the stuff works and what JSON is, and why it is okay to use strings as keys, etc.
That's about pair programming too. Imagine pair theorem proving. Two guys are placed together by a senior mathematician, say, Grisha and Misha, and told to prove a theorem by the end of the week.
What I want to say: get the fuck off programmers' backs. If they want to work together, let them work together. If they want to work alone, let them work alone. If they want to be agile, let them be agile; if they want to be locally-convex, let them be locally-convex. On the other hand, if you, the manager, know better how to write code, how come you cannot produce in a week anything comparable to what a junior programmer can easily concoct in 30 minutes? Just kidding.
Now ascii art. Programming is art. Ascii art is a part of programming art. If a programmer thinks that his or her code reads better formatted the way the programmer formatted it, challenge this, the fact that it is, not the fact that it does not follow Coding Style Guide Laws.
Peer code review means you are supposed to show your stuff to somebody in your team before submitting it. So, when you want to submit the stuff in the end of the day (yes, all unittests pass), you are supposed to hold on, wait for half a day (the next day), not touching the code, get into a discussion, and then, eventually get through with it. Which means the code should be pretty solid. No way you would go ahead submitting something working but halfway through, or something that is in the process of being formed, in transition, work in progress.
That's bad. I found myself spending several days forming my ideas regarding how I can possibly specify binary output format in JSON, so that the format can be sent From Above to the client when requirements change (say, a new format is eventually implemented by busy/lazy server guys). If I had to submit a fully-implemented, fully thought-out, neat-looking code, it would take a couple of weeks. Thinking, prototyping, discussing, including three days of explaining how the stuff works and what JSON is, and why it is okay to use strings as keys, etc.
That's about pair programming too. Imagine pair theorem proving. Two guys are placed together by a senior mathematician, say, Grisha and Misha, and told to prove a theorem by the end of the week.
What I want to say: get the fuck off programmers' backs. If they want to work together, let them work together. If they want to work alone, let them work alone. If they want to be agile, let them be agile; if they want to be locally-convex, let them be locally-convex. On the other hand, if you, the manager, know better how to write code, how come you cannot produce in a week anything comparable to what a junior programmer can easily concoct in 30 minutes? Just kidding.
Now ascii art. Programming is art. Ascii art is a part of programming art. If a programmer thinks that his or her code reads better formatted the way the programmer formatted it, challenge this, the fact that it is, not the fact that it does not follow Coding Style Guide Laws.
no subject
Date: 2010-03-24 10:38 pm (UTC)no subject
Date: 2010-03-24 11:07 pm (UTC)no subject
Date: 2010-03-25 02:10 am (UTC)no subject
Date: 2010-03-25 02:41 am (UTC)А вообще, самое опасное во всяких методологиях разработки программных продуктов - когда они превращаются в догму. И группа начинает не код писать, а эту догму соблюдать.
no subject
Date: 2010-03-26 09:52 am (UTC)Нет субъекта. Понятна кому? ;-)
no subject
Date: 2010-03-26 10:19 pm (UTC)Вот это вот читабельно?
no subject
Date: 2010-03-26 10:42 pm (UTC)no subject
Date: 2010-03-25 02:08 am (UTC)По поводу coding conventions - это болезнь. Это то, что легче всего формализовать, поэтому большинство организаций, когда перед ними встает вопрос "как лучше программировать" начинают создавать 50-страничные правила именования классов. Объяснения, что это waste of time, обычно не помогают.
Что же касается get off programmer's backs, как Вы думаете, что сделает большинство программистов, если дать им полную свободу? Напишут ли они хоть что-нибудь в обозримые сроки? Я говорю именно про большинство, программистов от Б-га я прошу в расчет не брать - их ничтожные доли процента.
no subject
Date: 2010-03-25 02:43 am (UTC)no subject
Date: 2010-03-25 04:27 am (UTC)no subject
Date: 2010-03-25 06:32 am (UTC)no subject
Date: 2010-03-25 06:37 am (UTC)no subject
Date: 2010-03-25 07:26 am (UTC)no subject
Date: 2010-03-26 10:21 pm (UTC)Такого менеджера я бы глубоко уважал даже если бы он меня уволил.
no subject
Date: 2010-03-25 07:20 am (UTC)Второй рассказывал так: "Когда мы только начали заниматься ЭТИМ, нам очень не нравилось. Но потом мы привыкли, и сейчас даже не можем себе представить, как можно программировать без ЭТОГО".
Ну, как обычно бывает, после того как запахло жареным в смысле релиза следующей версии к JavaOne экспирименты закончились.
Дурь это все конечно. Если программист не может положить в репозиторий нормальный код без пайр-программинга из под палки, такого программиста в первую очередь не следует вообще нанимать.
no subject
Date: 2010-03-25 02:52 pm (UTC)А Дитрих, видимо, просто решил сэкономить на оборудовании - в голове немецкие тараканы.
no subject
Date: 2010-03-26 09:52 am (UTC)no subject
Date: 2010-03-26 02:01 pm (UTC)no subject
Date: 2010-03-26 09:51 am (UTC)Пардон, но программы пишутся не только для себя
no subject
Date: 2010-03-26 02:03 pm (UTC)no subject
Date: 2010-03-26 04:16 pm (UTC)%-)
Сказки какие-то.
И про ревью тоже очень-очень странно. Впрочем, если это мини-пузомерка, тогда без вопросов.
no subject
Date: 2010-03-26 04:38 pm (UTC)- сабмиты нужно делать часто, всяко не реже, чем раз в день;
- большой рефакторинг требует времени и определённой свободы исследования
то и получается, что, предположим, если я ревьюер, то должен понимать, что у ревьюируемого есть какой-то план, но промежуточный код может выглядеть довольно неуклюже и почти бессмысленно; а в результате получается вполне приличная вещь.
Это я поглядел на вещи с обеих сторон. И всем советую. Хотя, возможно, кто-то находится в процессе переосознания, и спешить, требуя от него полного понимания идеи, которая, может быть, и выражена невнятно (т.к. тоже находится в процессе формирования) было бы непрвильно.
Так понятней?
no subject
Date: 2010-03-26 04:42 pm (UTC)А внятное выражение мыслей - это и есть задача нашей профессии.
no subject
Date: 2010-03-26 10:20 pm (UTC)no subject
Date: 2010-03-26 10:33 pm (UTC)no subject
Date: 2010-03-29 07:09 pm (UTC)no subject
Date: 2010-03-29 07:12 pm (UTC)