vaguely

和歌山に戻りました。ふらふらと色々なものに手を出す毎日。

英語でLightning Talk

はじめに

5/14に行われた Oracle Dev Tour Japan in Osaka で LT をさせていただきました。

kanjava.connpass.com

speakerdeck.com

初の英語での LT ということで、日本語とは違うところがあったので準備の話などとともに書き残しておくことにします。

なお一応書きますが、英語で LT やるコツとか出てきません。

僕が知りたいくらいです。

発表について

まぁ完全に準備不足であったと思います。

大きく2点あって、原稿は作ったもののそれを声に出して読む、という練習が足りなかったと思います。

原稿を忘れてしまっても、その場で作りながら話をする、ということが理想ではあるのですが、まだそこまで消化できていなかったのだと思います。

家だとどうしても子どもたちが寝ていたり横やりが入ったりと難しいので、広い公園やカラオケボックスなど練習できる場所の確保が必要ですね。

もう一つがスライドで、内容自体は自分なりにわかりやすくなるよう作ったつもりですが、発表のときに(ディスプレイが複製モードになっていなかったため)自分のPCのモニタから見えず、カンペ代わりにできなかったという問題がありました。

Office というかパワポについては、やっぱり MS Office 良いなぁ、という感じがします。
(スクリーン側に全画面でスライドを表示して、PC側でメモや経過時間などを見ることができるため)

家のディスプレイを繋いでの確認もやっておかないといけませんね。

なお Ubuntu でディスプレイの設定を変更するには、 Settings > Devices > Displays からできる。。。ハズ。

ディスプレイは Mac Mini 用に一台あるのですが、ケーブルが HDMI と DVI ケーブルしかなくて VGA が必要な PC につなげませんでしたorz

明日か明後日に買おっと。

英語で原稿を書くことについて

日本語で書くようにスラスラと英語が出てきてくれるのが理想ですが、これも現状では難しいので、 Google 先生に頼ることにしました。

前職で韓国語に翻訳する必要があったりしたときに使っていた方法ですが、日本語を韓国語に翻訳 -> 翻訳結果を日本語に再翻訳して意味が通るかを確認してました。

英語は多少は書ける(気がする)ので、単語は調べつつ英文を作る -> 日本語に翻訳して、おかしな日本語になっていたらやり直ししたりしていました。

あと発音がわからないときに、これまた Google 翻訳の発声機能を使って確認できたのも助かりました。

この方法で、英語のブログに挑戦してみるのも良いかもしれませんね。

原稿

せっかくなので用意していた原稿も載せておきます。


Start

Ok, Let's start.

I'm Masui Masanori.

Today I'll talk about "var".

Have you already used it?

about Java's 'var'

  • The official name is 'Local-Variable Type Inference'.
  • It infers the type from the right side value.
  • If the type can't be inferred, the compiling error is occured.
  • You should take care what type is inferred. Because the type sometimes differ from your expected.
  • It can declare the variable of anonymous class.

about C#'s 'var'

  • C# also has 'var'.
  • Most of the features are as same as Java's.

Question

  • I felt C# programmers are more actively seeking to use it than Java programmers.
  • Where does the difference come from? and should I use it?

Merit of using 'var'

First, I talk about the merits of 'var'.

  • It improve readability. Because it make the code simpler.
  • It induces better naming. Because the type name is omitted from left side, so the programmer will seek to compensate the infomations with other parts.
  • If the precise type isn't so important, You can treat the type ambiguous. For example in this code. Even if the returning value type is changed to array of string, you don't need any modifications.

Demerit of using 'var'

Next, I talk about the demerits. * It reduces readability. For example in this code, I don't know what type will be returned. And even if I can understand the type, you shouldn't name like this.

  • It risks type mismatch. The biggest problem is I may not be able to know the type mismatch because the compiling error isn't occured.

Where does the difference come from?

  • This situation is not much different between Java and C#.
  • One of the big difference is that C#'s 'var' was implemented since over 10 years ago, so the programmers have been used to using it.
  • I think maybe this is the reason.
  • I don’t know if the situation of Java also will be as same as C#'s.

Should we use ‘var’ ?

I move another question.

I think we should use ‘var’ if there is no special reason.Like the examples what I talked.

Because keeping code simple makes us to think other important parts of code.

And the most important reason of my opinion is my favorit IDEs of C# suggest using it.

Summary

  • Because ‘var’ has some merits and demerits, so please use it properly.​
  • If the variable needs the precise type, please write the type explicitly.​
  • If your team has coding rules, please follow them or update them first.​

Rerences

End

Thank you for listening.


おわりに

正直なところもっと練習しておけば。。。と思い頭をかきむしりたくなる気持ちを抑えつつこの記事を書いているわけなのですが、挑戦したこと自体はとても良かったし、貴重な経験だったと思っています。

ということで、そんな貴重な場を提供していただいた関ジャバの方々と Oracle Dev Tour Japan の方々、何より温かく見守ってくださった皆様、本当にありがとうございました(..)_

いつかどこかでリベンジも狙っていきます(๑•̀ㅂ•́)و✧