zashii-1434

Stats of My Life(おいしい人生を味わうために、コツコツとチャレンジしたことを書くブログ)

「リーダブルコード ―より良いコードを書くためのシンプルで実践的なテクニック (Theory in practice)」読みました。(2017年15冊目)"Readable code - Simple practical technique for writing better code (Theory in practice)" I have read. (15th year of 2017)

リーダブルコード ―より良いコードを書くためのシンプルで実践的なテクニック (Theory in practice)

リーダブルコード ―より良いコードを書くためのシンプルで実践的なテクニック (Theory in practice)

 

 

■感想


エンジニアの中では有名な本なものの、きちんと読んだことがなかったので
読んでみました。

 

感想としてはとてもわかりやすいかったです。
もっと早く読んでおくべきだったなあと思います。

 

ちなみにスクーにもリーダブルコードの授業があります。
こちらと合わせて読むと、より理解が深まると思います。

 

schoo.jp

 

<メモ>


第1章 理解しやすいコード

・コードは他の人が最短時間で理解できるように書かなければならない

第2章 名称に情報を詰め込む

・明確な単語を選ぶ
・汎用的な名前を避ける
・抽象的な名前よりも具体的な名前を使う
・接尾辞や接頭辞を使って情報を追加する
・名前の長さを決める
・名前のフォーマットで情報を伝える

第3章 誤解されない名前

・名前が「他の意味と間違えられることはないどろうか?」と何度も自問自答してみる

第4章 美しさ

・読み手が慣れているパターンと一貫性のあるレイアウトを使う
・似ているコードは似ているように見せる
・関連するコードをまとめてブロックにする

第5章 コメントすべきことを知る

・コメントの目的は、書き手の意図を読み手に知らせることである

第6章 コメントは正確で簡潔に

・複数のものを指す可能性がある「それ」や「これ」などの代名詞を避ける
・コードの意図は、詳細レベルではなく、高レベルで記述する

第7章 制御フローを読みやすくする

・比較対象
 ・左側は「調査対象」の式。変化する
 ・右側は「比較対象」の式。変化しない

・条件は否定形よりも肯定系を使う
・単純な条件を先に書く。

第8章 巨大な式を分割する

・巨大な式は飲み込みやすい大きさに分割する

第9章 変数と読みやすさ

JavaScriptでは変数の定義にvarをつけないと、その変数はグローバルスコープに
入ってしまう。

第10章 無関係の下位問題を抽出する

・プロジェクト固有のコードから汎用コードを分離する

第11章 一度に一つのことを

・一度に一つのタスクを行うことを考える

第12章 コードに思いを込める

・プログラムのことを簡単な言葉で説明することで、コードがより自然になっていく

第13章 短いコードを書く

・コードをできるだけ小さく軽量に維持するしかない。
 ・汎用的なユーティリティコードを作って、重複コードを削除する
 ・未使用のコードや無用の機能を削除する
 ・プロジェクトをサブプロジェクトにする
 ・コードの「重量」を意識する。軽量で機敏にしておく

第14章 テストと読みやすさ

・テスト関数に説明的な名前をつけて、何をテストしているのかを明らかにする

 

■Impression

Although it is a famous book among engineers, I have never read it properly

I tried reading it.

 

As impressions it was very easy to understand.
I should have read it earlier.

 

Incidentally, there is also a class of readable code on the school.
I think that understanding will deepen as you read it together.

 

schoo.jp

 

<Memo>


Chapter 1: Easy to understand code

· The code must be written so that other people can understand in the shortest possible time

 

Chapter 2 Stuffing Information in a Name

· Choose clear words
· Avoid generic names
· Use concrete names rather than abstract names
· Add information using a suffix or prefix
· Decide the length of the name
· Tell information in format of name

 

Chapter 3 Misunderstanding Name

· Try to ask yourself a number of times that the name "will not be mistaken for other meanings?"

 

Chapter 4 Beauty

· Use a layout that is consistent with the pattern that the reader is accustomed to
· Similar code looks similar
· Block related codes together

 

Chapter 5 Knowing what to comment

· The purpose of the comment is to inform the reader of the intention of the writer

 

Chapter 6 Comments are accurate and concise

· Avoid synonyms such as "it" and "this" that may refer to multiple things
· Describe the intention of the code at a high level instead of the detail level

 

Chapter 7 Making Control Flow Readable

·Comparison
· The left side is an expression of "subject of investigation". Change
· The right side is the expression of "comparison target". It does not change

· Condition uses positive system rather than negative type
· Write simple conditions first.

 

Chapter 8 Split huge expressions

· Huge formula to split into easy-to-swallow size

 

Chapter 9 Variables and Readability

· If you do not add var to the variable definition in JavaScript, the variable gets global scope
It enters.

 

Chapter 10 Extracting irrelevant subordinate problems

· Separate generic code from project specific code

 

Chapter 11 One thing at a time

· Think about doing one task at a time

 

Chapter 12 Thinking about the code

· By explaining the program in simple terms, the code will become more natural

 

Chapter 13 Writing Short Code

· You have to keep the code light and light as small as possible.
· Create generic utility code and delete duplicate code
· Delete unused codes and unnecessary functions
· Make a project a subproject
· Conscious of the "weight" of the code. Keep light and agile

 

Chapter 14 Testing and Readability

· Provide a descriptive name for the test function to clarify what you are testing

「斎藤一人の成功している人の見た目の法則」読みました。(2017年14冊目)I read "The Law of Appearance of a Successful Person of Saito Kazuo". (14th year of 2017)

斎藤一人 成功している人の「見た目」の法則

斎藤一人 成功している人の「見た目」の法則

 

 

■感想

 

「見た目はその人の入り口、中身は出口」

と表現すればいいでしょうか?

 

その入り口はちょっと気をつけるだけで劇的に良くなることが理解できました。

本を読んでていいなと思うフレーズがいくつかありました。

 

<例>

・おしゃれとは好きなことを増やすもの

・ここぞの運が悪い人はクツが汚い人

 

特に私は最近あまり見た目に対してメンテナンスをしてなかったので、してみようと思いました。

 

■Impression

 

Should it be expressed as "the entrance is the entrance of the person, the contents are the exit"?

I could understand that the entrance got better dramatically just by being a little careful.

 

There were several phrases that I think may be good to read a book.

 

<Example>

· Fashion is what increases likes

· People with bad luck are dirty people

 

Especially I recently thought that I tried doing maintenance because I did not maintain it so much.

 

「現役東大生が1日を50円で売ってみたら」読みました。(2017年13冊目)"I tried selling one day at 50 yen for active students at Tokyo University" I read. (13th in 2017)

 

現役東大生が1日を50円で売ってみたら

現役東大生が1日を50円で売ってみたら

 

 

■感想

「自分の1日を50円で売って、なんでもさせていただきます」

とインターネットで募集をして、著者がいろんな人と交流して見たこと、感じたことが書かれています。

 

読んでていいなと思ったのが、著者の性格が自然体というか、無理していない感じが文章を通じて伝わります。

 

なので、いろんな人と交流して書かれている内容は共感しやすいです。

普段接することがないような人と接することで、今までにない発見が出てくるのは楽しいですよね。

 

私もやってみようかな笑。でも東大生じゃないので、キャッチーなフレーズがなかなか思い浮かびません笑。

 

著者は今も続けているようなので、興味がある人はコンタクトを取ることもできるかもしれないですね。

 

あと著者はブログも開設していたんですね↓

www.ryosuke-takano.net

 

■Impression

 

"I will sell my own for 50 yen and I will do anything."

And recruiting it on the internet, it says what the author saw by interacting with various people, felt.

 

I thought that it is okay to read, the feeling that the character of the author is a natural body or not is transmitted through sentences.

 

So, it is easy to sympathize content written and interacted with various people.

By touching people who do not usually come in contact with us, it is fun to discover unprecedented discoveries.

 

I guess I should try it too. But since it is not Tokyo University student, I can not imagine catchy phrases quite easily.

 

It seems that the author still continues, so if you are interested it might be possible to get contact.

 

Also, the author also opened a blog ↓

「面白い生き方をしたかったので仕方なくマンガを1000冊読んで考えた→そしたら人生観変わった」読みました。(2017年12冊目)"I wanted to do an interesting way of life so I had no choice but to read 1000 comic books → I thought about life" then I read it. (12th year of 2017)

 

■感想

 

堀江さんがいかに漫画から自分の思想や生き方に影響を受けたかがわかる内容でした。

 

もちろん、漫画をどう読むか、どれが好きかなんて人それぞれなんですが、堀江さんが漫画を読む観点はなんというか、単純に面白さよりも「学べるところがあるか?」という思考が強いような気がします。

 

私も似ているかもって思いました。

 

ちょっと惜しいなあと思うのは漫画の紹介なので、図版が多くあってもいいのかなって思いました。

 

著作権の問題があって難しいのでしょうか?

 

本書を読んで、今まで読んだことがない、面白そうな漫画を知ることができて良かったです。特に下記の漫画は読んでみようと思います。

 

栄光なき天才たち

・服を着るならこんなふうに

MASTERキートン

 

 

 

 

服を着るならこんなふうに (1) (単行本コミックス)

服を着るならこんなふうに (1) (単行本コミックス)

 

 

 

 

■Impression

 

It was content that understands how Mr. Horie influenced his thought and way of life from manga.

 

Of course, it is people who read manga and who likes which, but the point of view that Mr. Horie reads cartoons is what it says, rather than simply entertaining, the thought that "there is a place to learn? I will do.

 

I thought that I might be similar.

 

I think that it is a little regrettable because it is an introduction to manga, so I thought that it would be good if there were many illustrations.

 

Is there difficult copyright problem?

 

It was good that I could read the interesting cartoon that I have never read before reading this book. In particular I think I will read the following manga.

 

· Genius without glory

· If you wear clothes like this

· Master Keaton

アーセナルよ、どうした?エジルよ、どうした?バイエルン対アーセナル(2017/02/16)Arsenal, what's up? Ozil, what happened? Bayern v. Arsenal (2017/02/16)

■感想 

今日のバイエルンとのCL戦は久々に酷い内容でショックを受けてます。

 

そもそも、チームとして一つになっていないかもしれないですね。

 

サンチェスが前線からプレスをかけにいっても、他の選手がそれに追随しないからイライラしている様子をプレミアリーグでも見かけます。

 

また、エジルも最近パスの受け手と意志疎通ができていないのかエジルもイライラしている様子をよく見かけます。

 

サッカーしている人はわかると思うんですけど、この相手が思うように動かない、プレーしないことに対して悪いジェスチャーを示すという行為はチームが一丸となっていない証拠だと思います。

 

チーム一丸になって集中しているプレーしている場合は、悪い態度で示す、ではなくいいジェスチャーや掛け声をかけるようになります。

 

最近のアーセナルのロッカールームはいい雰囲気ではないのではないか?

そんな印象を受けました。

 

エジルは個人的に大のお気に入りの選手です。

ビッグマッチでは輝いていないなんでニュースがありますが、嘘ですね。

今期のホームで戦ったチェルシーとの試合はエジルの魅力が詰まったプレーを披露しましたし。。。

 

レアルのときはバルサ戦でも見事なパスやプレーを披露しています。

 

でも、確かにレアルに比べればアーセナルではエジルの輝きの回数は少なくなっているのかもしれません。

 

それはエジルというよりはアーセナルの選手層がレアルよりもよくないからかもしれません。

 

そう考えると、レアル時代のエジルを基準とするのは少し可哀想かなって思います。

 

私はエジル贔屓が強いですが(笑)、ラストパスを出すビジョン・創造性・精度は世界トップ5に入ると信じています。

 

 

www.youtube.com

 

今日のショックはこの動画を見て、少し癒されました。

もしエジルが今季で契約延長せず移籍したら寂しい限りです。。。

頑張ってほしいです。

 

■Impression

 

Today's CL match against Bayern has been shocked by terrible content for a long time.

 

In the first place, it may not be a single team.

 

Even if Sanchez went to press from the front line, I can see even irritated at the Premier League as other players do not follow it.

 

Also, Ezir often seems irritated as to whether Ozil has not communicated with the recipient of the pass recently.

 

I think that people understand football, but I think that the action of showing this bad gesture against not playing, which the other does not move as expected, is evidence that the team is not united.

 

If you are in a team that is concentrating and concentrating, you will start noticing with a bad attitude, but rather making good gestures and shouts.

 

Recent Arsenal's locker room is not a nice atmosphere?

I received such an impression.

 

Ezir is personally a big favorite player.

There is news in the big match that does not shine, but it is a lie.

The match with Chelsea who fought at home this season showed off the play that Ozil was full of charm. . .

 

When it is Real, we are showing off a splendid pass and play even against Balsa.

 

But, it is certain that the number of glows of Ozil is decreasing in Arsenal compared to Real.

 

It may be because Arsenal's players are not better than Real, rather than Ozil.

 

I think that it is a bit sad that it is based on Ezir of the Real era.

 

Although I like Ozil strongly (laugh), I believe that the vision, creativity and accuracy that will give out the last pass will be among the top five in the world.

 

Today 's shock watched this video and was healed for a while.

If Ozil transfers without extending the contract this season, it is lonely. . .

I want you to do your best.

「結論を言おう、日本人にMBAは要らない」読みました。(2017年11冊目)"Let's conclusion, I read Japanese that I do not need MBA". (11th in 2017)

 

結論を言おう、日本人にMBAはいらない (角川新書)

結論を言おう、日本人にMBAはいらない (角川新書)

 

 

■感想

 

著者が早稲田MBAの教授を10年近くも務めたのに意味がないと言っていることに大きな矛盾と悲しさを感じました。

 

著者は早稲田MBAで教えていた生徒に対して失礼なのではないでしょうか?

 

また、仮に日本のMBAが意味ないものだとしても、そうならないよう、在籍した10年の間で早稲田MBAを改革すれば良かったのにって思ってしまいます。

 

MBAに意味があるかどうかは、その人が判断すべきだと思います。
なぜなら、人によってMBAで学ぶ動機は異なるからです。

 

少なくとも、MBAランキングに左右されている限りは、MBAでやりたいことって明確にはないんだろうなって私は思います。

 

・・・
この本も読んでいても、このようなブログを書いた私もそうですけど、強い否定って当たり前ですが、いい気持ちにはならないですね。

 

本書はあまりオススメできないです。

 

■Impression

 

Although the author served Professor Waseda MBA for nearly 10 years

I felt great contradiction and sadness in what he says there is no meaning.

 

Is not the author rude to the students who taught at Waseda MBA?

 

Also, even if the MBA in Japan is meaningless, so that it will not be so, between 10 years of enrollment

I wish I had reformed the Waseda MBA.

 

I think that the person should judge whether MBA has meaning.

Because motives are different for different people.

 

At least, as long as it depends on the MBA ranking,
I think that it is not clear that what you want to do with MBA.

 

...
Even though I read this book, I also have written such a blog
It is natural that denying strongly is not a good feeling.

 

I can not recommend this book very much.

 

「個人ではじめる輸入ビジネス」読みました。(2017年10冊目)"I started importing business starting with individuals" I read. (10th in 2017)

 

 

■感想

 

会社の本棚に置いてあったので読んでみました。

 

輸入ビジネスに携わっている人は全国でどれくらいいるのでしょうか?
この本を読む前までは、難しく一部の資格なり特権なりを持っている人しか
できない商売だと思っていました。

 

けど、この本を読んでイメージがガラリと変わり、本人のやる気次第ですぐにでも始められるビジネスだと知りました。

 

輸入ビジネスを始める前にすべきことは大きく次の2点です。

 

1.海外の見本市に商品を発掘しに行くこと
2.独占販売権を獲得すること

 

独占販売権と聞くと、契約が絡む複雑な処理が求められるみたいなのですが
著者曰く、それは専門家に任せておけばいいと説いています。

 

輸入ビジネスで凄いなあと思ったのは、

「定価は自由に決めていい」

ということです。

 

輸入ビジネスにおいては、粗利50%は当たり前だそうです。

びっくりですね。

 

輸入ビジネスでは、海外の好きな国で好きな商品を扱うことができるため、
自由に海外を飛び回りながら、面白い商品がないか楽みながらしている人も
いるのかもしれないですね。

 

是非、そんな人にがいたら会ってみたいなあと思いました。

 

ちなみに狙う商品のポイントは

「小さく・軽く・価値があること」

だそうです。

 

小さく・軽くは海外から日本への発送費用を安く抑えるためだそうです。


あと、私は全然知らなかったのですが「ジェトロ認定貿易アドバイザー試験」という輸入ビジネスの資格もあるんですね。しかも難関。。。

 

■Impression

I put it on the bookshelf of the company and I tried reading it.

 

How many people are engaged in import business nationwide?

 

Until I read this book, only people with difficult qualifications and privileges
I thought that it was impossible business.

 

But, as you read this book, the image changes to gallary
I learned that it is a business that can be started soon depending on the motivation of himself.

 

There are two major points to be done before starting import business.

1. Going to uncover products in overseas trade fairs
2. Acquire exclusive distribution rights

 

Although it seems that complicated processing involving contracts is required when asked as exclusive distribution rights

The author says that it is only necessary to leave it to an expert.

 

What I thought was amazing in the import business

"Fixed price can be decided freely"

about it.

 

In the import business, it seems that 50% gross margin is natural.

I am surprised.

 

In the import business, you can handle your favorite products in countries you like abroad,

People who enjoy freely traveling abroad while enjoying interesting products
It may be that it is.

 

By all means, I thought that I would like to see such a person when I was overworked.

 

The point of aimed product is

"Small, light and valuable"

It is said that.

 

It seems to be small and light so as to reduce the shipping cost from overseas to Japan cheaply.


Also I did not know it at all, but I am also qualified as an import business "JETRO certified trade advisor exam"


There is. Moreover, it is difficult. . .