juan_gandhi: (Default)
Juan-Carlos Gandhi ([personal profile] juan_gandhi) wrote2010-03-24 03:22 pm

peer code review and ascii art

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.

[identity profile] dkfl.livejournal.com 2010-03-24 10:38 pm (UTC)(link)
что-то не понял я аргумент про аски-арт.

[identity profile] yatur.livejournal.com 2010-03-25 02:08 am (UTC)(link)
По поводу code review - я на практике ни разу не видел эффективного code review. Они либо формальны, либо превращаются в борьбу эго - "а я считаю, что в этой строке слишком много скобочек, мне так непонятно". Особенно это заметно, если проверяющий не понимает, о чем идет речь (а он как правило не понимает, иногда потому, что дурак, иногда потому, что своей работы полно). Ему ничего не остается, как придираться к мелочам.

По поводу coding conventions - это болезнь. Это то, что легче всего формализовать, поэтому большинство организаций, когда перед ними встает вопрос "как лучше программировать" начинают создавать 50-страничные правила именования классов. Объяснения, что это waste of time, обычно не помогают.

Что же касается get off programmer's backs, как Вы думаете, что сделает большинство программистов, если дать им полную свободу? Напишут ли они хоть что-нибудь в обозримые сроки? Я говорю именно про большинство, программистов от Б-га я прошу в расчет не брать - их ничтожные доли процента.

[identity profile] aivanov.livejournal.com 2010-03-25 07:20 am (UTC)(link)
Что там гугл! Вот Дитрих в 2000, после того как прочитал Кента Бека, принял решение отобрать у программистов половину компов и половину столов, чтобы сделать пейр-программинг неизбежным -). Ценой очередного почти-увольнения мне удалось отбиться до состояния "пилотной пары". Потом бедняги должны были всем рассказать как им хорошо. Один на соответствующую презентацию вообще не пришел.
Второй рассказывал так: "Когда мы только начали заниматься ЭТИМ, нам очень не нравилось. Но потом мы привыкли, и сейчас даже не можем себе представить, как можно программировать без ЭТОГО".
Ну, как обычно бывает, после того как запахло жареным в смысле релиза следующей версии к JavaOne экспирименты закончились.

Дурь это все конечно. Если программист не может положить в репозиторий нормальный код без пайр-программинга из под палки, такого программиста в первую очередь не следует вообще нанимать.

[identity profile] vit-r.livejournal.com 2010-03-26 09:51 am (UTC)(link)
three days of explaining how the stuff works and what JSON is

Пардон, но программы пишутся не только для себя