たまには文法をきちんと解釈してみる。

最近 Refactoring の読み合わせをしているのですが、雰囲気で読んでいる箇所が多々あるなぁと痛感。

ということで、たまにはきちんと文法解釈してみようと思い立った今日この頃。

Refactor As You Do a Code Review*1

  • as は、「〜するとき」「〜しながら」を意味し、when, while よりも同時性が強い。*2

Code reviews help spread knowledge through a development team.*3

  • spread は原形不定詞。*4
  • Code reviews は help の無生物主語。help は「促進する」と解釈する。*5

They are also very important in writing clear code.*6

  • in は、状態を表す前置詞で、活動・従事・過程をあらわし、「するとき」と考えられる。*7

it's very hard for people to put themselves in the shoes of someone unfamiliar with the things they are working on.*8

  • "Put youself in the other person's shoes."で「ほかの人の身になって考える」という意味になる。このような感じで、yourself や the other person を変えたりして、いろいろなバリエーションを作れる。

Reviews also give the opportunity for more people to suggest useful ideas.*9

  • also は、接続副詞のうち、連結的なもの。前の文に対して「その上」という意味を付加する。*10
  • Reviews は give の無生物主語。"If you review code, you will get the opportunity for more people to suggest useful ideas."と変換可能。*11

I can only think of so many good ideas in a week.*12

  • only が主語以外を修飾する場合は、動詞の前が普通。"I can think of only so many good ideas in a week." と書くことも可能。*13
  • ロングマンの only (adv) 11 では、以下のように説明されています。

only so many/much used to say that there is a limited amount of quantity of something.

  • 上記より、「私は、一週間では限られた数のアイデアを考えることができる。」と訳せる。逆の言い方をすれば、「私は、一週間ではそんなに多くのアイデアを考えることはできない」となる。

Having other people contribute makes my life easier, so I always look for many reviews.*14

  • Having は、使役動詞としての have が動名詞になったもの。そのため、contribute は原形不定詞。*15
  • "Having other people contribute" は make の無生物主語。make は「〜させる」と解釈する。*16

As a result, I can come up with a second level of ideas that I would never have realized had I not refactored.*17

  • "had I" は、条件説の if を省略したことによる倒置*18
  • ideas を修飾する that 節は、仮定法過去完了*19

Not only are there suggestions, but also many suggestions are implemented there and then.*20

  • "are there suggestions" は、文頭が否定語のための倒置。否定語が文頭に来ると、必ず主語と動詞は倒置される*21

My experience suggests having one reviewer and the original author work on the code together.*22

  • Having は、使役動詞としての have が動名詞になったもの。そのため、work は原形不定詞。*23

This idea of active code review is taken to its limit with the Extreme Programming[Beck, XP] practice of Pair Programming.*24

  • 「積極的なコードレビューというこのアイデアは、XPのプラクティスであるペア・プログラミングにより限界まで高められた。」

Given software engineers infatuation with indirection, it may not surprise you to learn that most refactoring introduces more indirection into a program.*25

  • 先頭の Given は前置詞で、considering と同様の意味。*26
  • learn は、find out の意味。*27

If the internals also are written in terms of intention in yet smaller pieces, you can write code that communicates most of the important information about its own structure.*28

  • yet は、yet more/bigger/later のような使い方をして、「さらに〜」のような意味を持たせる。*29

Then the code can just be hung on the sturdy skeleton.*30

  • ここでの hang on は depend on の意味。*31

For this means that while I certainly believe you should try refactoring for the real gains it can provide, you should also monitor its progress.*32

  • while は、参考文献*33の亜種であると考えられる。参考文献では though と同様と書かれているが、意味的にそれが弱められて and に近い意味で利用されている。(と思うが、自信なし o..rz。英語に詳しい方、教えてください、、、。)
  • should は、提案を示すのかな?*34(Martin Fowlerが英国生まれで10歳まで英国暮らしだから、仮定法現在ではなく should を使っているのかな?)。

*1:Refactoring P59/L4

*2:参考:ロイヤル英文法 p610

*3:Refactoring P59/L6

*4:参考:ロイヤル英文法p466,467

*5:参考:ロイヤル英文法 p802

*6:Refactoring P59/L9

*7:参考:ロイヤル英文法 p691

*8:Refactoring P59/L10

*9:Refactoring P59/L12

*10:参考:ロイヤル英文法 p598

*11:参考:ロイヤル英文法 p801

*12:Refactoring P59/L13

*13:参考:ロイヤル英文法 p343

*14:Refactoring P59/L13

*15:参考:ロイヤル英文法 p390

*16:参考:ロイヤル英文法 p800

*17:Refactoring P59/L21

*18:参考:ロイヤル英文法 p769

*19:参考:ロイヤル英文法 p551

*20:Refactoring P59/L23

*21:参考:ロイヤル英文法 p770

*22:Refactoring P59/L26

*23:参考:ロイヤル英文法 p390

*24:Refactoring P59/L34

*25:Refactoring P61/L21

*26:参考:ロングマン現代アメリカ英語辞典 given

*27:参考:ロングマン現代アメリカ英語辞典 learn 2

*28:Refactoring P61/L35

*29:参考:ロングマン現代アメリカ英語辞典 yet 1-3

*30:Refactoring P62/L18

*31:参考:ロングマン現代アメリカ英語辞典 hang on 5

*32:Refactoring P63/L5

*33:参考:ロングマン現代アメリカ英語辞典 while 1-4

*34:参考:ロイヤル英文法 p458 提案・要望・命令・決定などの表現