Ognacの雑感

木漏れ日々

目次

Blog 利用状況

書庫

ギャラリ

継承関係やラムダ式の矢印が理解しにくいらしい

A_ClassからB_Classを派生するとき  A <--- B   という風に描きますよね。
これは、 BはAを知っているからBは起点になると考えるとスッキリします。
ところが、OOPに馴染みの薄い人に説明した時、「逆でしょ」と突っ込まれることが多々あります。
「Aが成長してBになるのだから A-->B でないと理不尽だ」.....この種の反論が殆どです。
基礎クラスが大きく成長してBになる...と考えるみたいです。これは一つの見方なので悪くない思いますが、その延長で矢印の向きまで決め付けられると困ります。
 ラムダ式などで x -> 式 と書きますが、これを   "式の結果 が xになる" と理解すれば今後の理解が楽ですが、 "x=式" と解釈すると、"式 --> x " という考えになり、
"x <-- 式 と表記しないとオカシイ"と感じるようです。
我々は何気なく A=B や  A<--B    a=b => b * 23   などと書いて、皆に意味が通じるものだと錯覚しがちです。
業界人に説明する時でも、 a=b => b * 23 は補足説明を要する時があります 、 A <--B は 通じない時があります。
非業界人には A=B  が通じない時があります。  "=" は等号であって "代入" とは見えないからです。
以前にも書いたのですが、プログラム言語は既存の記号を借用して、元の意味とは違う意味を持たして構文/文法を規定しているので、部外者に理解をされにくいのかもしれません。
「1つに表現に複数の意味を持たしては駄目」という原則に反しているような気もしますが、言語内では単一の意味だからいいのでしょうね。
といって、独自記号を設定する 記号言語風になってしまい、余計に判り難くなりますし.....wwww.
 入門者の初期にに躓く高いハードルでもあります。
矢印以外に継承関係を表現できる書き方ってなんものでしょうかねぇ

投稿日時 : 2008年2月20日 13:33

Feedback

# re: 継承関係やラムダ式の矢印が理解しにくいらしい 2008/02/20 13:46 シャノン

> 「Aが成長してBになるのだから A-->B でないと理不尽だ」

これは、メンバの数が A < B であるという視点ですね。
一方で、インスタンスの数は A > B になります。

# re: 継承関係やラムダ式の矢印が理解しにくいらしい 2008/02/20 14:12 2リットル

オリジナルと模倣品の関係ってのはどうでしょうか。

オリジナルは模倣品のことを知らないけど、
模倣品はオリジナルをよくしっている(建前はしらんけど)。

だからA←Bの一方通行なんだよって。

# re: 継承関係やラムダ式の矢印が理解しにくいらしい 2008/02/20 14:29 ddnp

とりあえず
>非業界人には A=B が通じない時があります。
これは当然でしょう。
あなたが言うところの業界人でも、人によっては
:= で初めて代入と認識するでしょうし。
イコール記号が代入式をあらわす、というのが
そもそも思い込みではないですか?

クラス継承を示す矢印については
「Aが成長してBになるのだから A-->B 」というのは
自然で素直な感覚だと思います。
かのScottMayersでさえ、当初はそのように表記していたのだから。

私は、祖先をたどる線と解釈しました。

# re: 継承関係やラムダ式の矢印が理解しにくいらしい 2008/02/20 14:37 Chuki

汎化の説明からからしたほうが楽ですよね^^;

ベース→楽器←初音ミク
    ↑
   ドラム
#う、むたぐち先生の奥様になんと言う暴言^^;

工房→DQN←厨房
    ↑
  モンスターペアレンツ


似たようなの集めて共通の性質を持つものを定義^^;


継承されるクラスが二つ以上あればすんなり理解できるのですが、ひとつしかないととてもわかり難いっす。

# re: 継承関係やラムダ式の矢印が理解しにくいらしい 2008/02/20 14:52 IIJIMAS

継承関係の矢印はたまたま特化から汎化の方向へ矢印を書く方が普及して標準的になっただけで、本質的には方向はどっちでもいいものですからね…
2リットルさんのおっしゃっるとおり「知ってる」という意味と考えるのがわかりやすいと思います。

>矢印以外に継承関係を表現できる書き方ってなんものでしょうかねぇ

集合の包含関係で
汎化クラス⊇特化クラス
とか。
結局こう書いても、シャノンさんのおっしゃることと同様、その集合の要素となる条件で考えてしまうと包含関係は逆転してしまいしますが…

# re: 継承関係やラムダ式の矢印が理解しにくいらしい 2008/02/20 15:00 凪瀬

うちのエントリで「わかりやすい」とは何かについて考察していて思ったのだけど、
「理解のための便法」という存在がカギを握っているように思います。

# re: 継承関係やラムダ式の矢印が理解しにくいらしい 2008/02/20 15:17 ghost_shell

UML継承の矢印はぼくもハマりましたね。1回丸暗記しました。

>基礎クラスが大きく成長してBになる...と考えるみたいです。これは一つの見方なので悪くない思いますが、その延長で矢印の向きまで決め付けられると困ります。

UMLでは決まり事なので反論の余地がありませんが、初めての人ならA-->Bと間違って考えてもらう方が「やっぱりそう思ってしまうよね。多数派w。」と共感できます。

だって継承は先祖と子孫の関係だけど、時系列的には子孫の向き以外はあり得ないでしょ。It's simple!

まあ継承は矢印の向きに見ている/まなざしを送っている/敬っている!?
包含はダイヤが力こぶ(腕)
という覚え方です。

# re: 継承関係やラムダ式の矢印が理解しにくいらしい 2008/02/20 15:28 ghost_shell

(自己)>だって継承は先祖と子孫の関係だけど、時系列的には子孫の向き以外はあり得ないでしょ。It's simple!

汎化と特化は先祖と祖先を表してはいないですが、イメージ話の延長として柔軟に捉えてみてくださいw

# re: 継承関係やラムダ式の矢印が理解しにくいらしい 2008/02/20 15:36 れい

今日は記号論で盛り上がってるのですね。

小学生になる前ですが、私は「A->B」が「AからB」を意味するのか「BからA」なのか、覚えられませんでした。
矢印は「矢」だから鏃の方に飛んでいくんだ、
と気づいて以来、きちんと覚えられるようになりました。

> 「理解のための便法」という存在がカギを握っているように思います。

嘘でも自分で理由付けできれば覚えられるんですよね。

> 矢印以外に継承関係を表現できる書き方ってなんものでしょうかねぇ

万人に受け入れられるものがあればいいんですが。
母語によって感覚も違いますから難しいですね。

それだけ「最初に考える人」や「皆に真似されるえらい人」は責任があるということですね。

# re: 継承関係やラムダ式の矢印が理解しにくいらしい 2008/02/20 16:41 Ognac

コメントありがとうございます。
>メンバの数が A < B であるという視点ですね。
>一方で、インスタンスの数は A > B になります。
概念の説明の際に実存数の話を出すと混乱しないかなぁ

>オリジナルと模倣品の関係ってのはどうでしょうか。
趣旨を理解して貰えれば良いのですが、字義通りに正規品とバッタ物と取られたら......?

>イコール記号が代入式をあらわす、というのが そもそも思い込みではないですか?
です。思い込みでした。 記号の前提の認識の箇所も言及する必要がありますね。
>私は、祖先をたどる線と解釈しました。
Goodな視点。参考になります。

>汎化の説明からからしたほうが楽ですよね^^;

ベース→楽器←初音ミク
    ↑
   ドラム
拡大する感じと向きが逆だ...と突っ込まれそう。

>集合の包含関係で 汎化クラス⊇特化クラス とか。
>「理解のための便法」という存在がカギを握っているように思います。
>UML継承の矢印はぼくもハマりましたね。1回丸暗記しました。
>包含はダイヤが力こぶ(腕)
>嘘でも自分で理由付けできれば覚えられるんですよね。

矢印も約束事の1つでしかないんですね。その約束事を共通認識できないと、意思の共有ができなくて、誤認を生む事になるのですね。
 Aを継承してBを作ることを A <-- B と表記するのが不自然に思えてきた.....世間一般に反してる?
記号論も約束事の積み重ねですし。字句解析も有限オートマトン表記の約束事で動作しているし......我々は約束事文化に浸かっている事になるのかなぁ。世間の直感文化とズレが生じている気がしてきました。

# re: 継承関係やラムダ式の矢印が理解しにくいらしい 2008/02/20 16:54 Ognac

わかりやすい説明をする為に、共通の基礎知識の共有が必要になるんでしょうね。
その基礎知識を習得して貰うにはどのように説明するか.....ジレンマ.....
無垢な人に抽象概念(OOP)を説明する難しさ.....インストラクターの偉大さが分かります。

# re: 継承関係やラムダ式の矢印が理解しにくいらしい 2008/02/20 17:09 uskz

概念の外延としての集合と,内包としての述語の関係みたいなものですかね
∀x(Derived(x)⇒Base(x)) equiv Base⊃Derived
の左辺はDerivedはBaseを含むと読むけれど,右辺はBaseはDerivedを含むと読める
論理的には同等なのに,直感的には別の概念として捕らえられることが多くて,増減の方向も逆になる
ところが概念を集合として捉えても,述語として捉えても,どちらが直感的というようなことは無いと思うので,それと同じようなものだと考えると,矢印の方向でどちらが直感的とかも無いんじゃないか・・・と書いてて気付きましたがすでにIIJIMASさんが同じようなこと書いてらっしゃいました><

# Just what the doctor odererd, thankity you! 2012/01/28 23:06 Chasmine

Just what the doctor odererd, thankity you!

# Just what the doctor odererd, thankity you! 2012/01/28 23:06 Chasmine

Just what the doctor odererd, thankity you!

# I'm not sure why but this website is loading very slow for me. Is anyone else having this issue or is it a problem on my end? I'll check back later on and see if the problem still exists. 2018/10/05 14:24 I'm not sure why but this website is loading very

I'm not sure why but this website is loading very slow for me.
Is anyone else having this issue or is it a problem on my end?

I'll check back later on and see if the problem still exists.

# Hello all, here every one is sharing these kinds of knowledge, therefore it's pleasant to read this webpage, and I used to visit this weblog daily. 2018/10/08 10:57 Hello all, here every one is sharing these kinds o

Hello all, here every one is sharing these kinds of knowledge, therefore it's pleasant to read this
webpage, and I used to visit this weblog daily.

# Wonderful blog! I found it while browsing on Yahoo News. Do you have any tips on how to get listed in Yahoo News? I've been trying for a while but I never seem to get there! Appreciate it 2018/11/10 14:22 Wonderful blog! I found it while browsing on Yahoo

Wonderful blog! I found it while browsing on Yahoo News.
Do you have any tips on how to get listed in Yahoo News? I've been trying for a while but I never seem to get
there! Appreciate it

# Thankfulness to my father who told me on the topic of this website, this blog is in fact amazing. 2018/11/17 1:29 Thankfulness to my father who told me on the topic

Thankfulness to my father who told me on the topic of this website, this blog is in fact amazing.

# Hi there, after reading this amazing post i am also cheerful to share my know-how here with mates. 2018/12/06 22:59 Hi there, after reading this amazing post i am als

Hi there, after reading this amazing post i am also cheerful to share my know-how here with mates.

# As the admin of this website is working, no hesitation very rapidly it will be well-known, due to its quality contents. 2021/08/24 6:11 As the admin of this website is working, no hesita

As the admin of this website is working, no hesitation very rapidly it will be well-known, due to its quality
contents.

# As the admin of this website is working, no hesitation very rapidly it will be well-known, due to its quality contents. 2021/08/24 6:12 As the admin of this website is working, no hesita

As the admin of this website is working, no hesitation very rapidly it will be well-known, due to its quality
contents.

# As the admin of this website is working, no hesitation very rapidly it will be well-known, due to its quality contents. 2021/08/24 6:13 As the admin of this website is working, no hesita

As the admin of this website is working, no hesitation very rapidly it will be well-known, due to its quality
contents.

# As the admin of this website is working, no hesitation very rapidly it will be well-known, due to its quality contents. 2021/08/24 6:14 As the admin of this website is working, no hesita

As the admin of this website is working, no hesitation very rapidly it will be well-known, due to its quality
contents.

# I read this post completely on the topic of the resemblance of most up-to-date and preceding technologies, it's remarkable article. 2021/08/24 12:14 I read this post completely on the topic of the re

I read this post completely on the topic of the resemblance of most up-to-date
and preceding technologies, it's remarkable article.

# I read this post completely on the topic of the resemblance of most up-to-date and preceding technologies, it's remarkable article. 2021/08/24 12:15 I read this post completely on the topic of the re

I read this post completely on the topic of the resemblance of most up-to-date
and preceding technologies, it's remarkable article.

# I read this post completely on the topic of the resemblance of most up-to-date and preceding technologies, it's remarkable article. 2021/08/24 12:16 I read this post completely on the topic of the re

I read this post completely on the topic of the resemblance of most up-to-date
and preceding technologies, it's remarkable article.

# I read this post completely on the topic of the resemblance of most up-to-date and preceding technologies, it's remarkable article. 2021/08/24 12:17 I read this post completely on the topic of the re

I read this post completely on the topic of the resemblance of most up-to-date
and preceding technologies, it's remarkable article.

# Spot on with this write-up, I actually feel this site needs far more attention. I'll probably be returning to read more, thanks for the advice! 2021/08/28 20:07 Spot on with this write-up, I actually feel this s

Spot on with this write-up, I actually feel this site needs
far more attention. I'll probably be returning to read more, thanks for
the advice!

# Hurrah! Finally I got a blog from where I know how to in fact get helpful information regarding my study and knowledge. 2021/08/30 10:32 Hurrah! Finally I got a blog from where I know how

Hurrah! Finally I got a blog from where I know how to in fact get helpful information regarding my study and knowledge.

# Hurrah! Finally I got a blog from where I know how to in fact get helpful information regarding my study and knowledge. 2021/08/30 10:33 Hurrah! Finally I got a blog from where I know how

Hurrah! Finally I got a blog from where I know how to in fact get helpful information regarding my study and knowledge.

# Hurrah! Finally I got a blog from where I know how to in fact get helpful information regarding my study and knowledge. 2021/08/30 10:34 Hurrah! Finally I got a blog from where I know how

Hurrah! Finally I got a blog from where I know how to in fact get helpful information regarding my study and knowledge.

# Hurrah! Finally I got a blog from where I know how to in fact get helpful information regarding my study and knowledge. 2021/08/30 10:35 Hurrah! Finally I got a blog from where I know how

Hurrah! Finally I got a blog from where I know how to in fact get helpful information regarding my study and knowledge.

# You can certainly see your enthusiasm within the work you write. The world hopes for more passionate writers such as you who are not afraid to mention how they believe. At all times go after your heart. 2021/09/01 6:38 You can certainly see your enthusiasm within the w

You can certainly see your enthusiasm within the work you write.
The world hopes for more passionate writers such as you who are not afraid to
mention how they believe. At all times go after your heart.

# You can certainly see your enthusiasm within the work you write. The world hopes for more passionate writers such as you who are not afraid to mention how they believe. At all times go after your heart. 2021/09/01 6:39 You can certainly see your enthusiasm within the w

You can certainly see your enthusiasm within the work you write.
The world hopes for more passionate writers such as you who are not afraid to
mention how they believe. At all times go after your heart.

# You can certainly see your enthusiasm within the work you write. The world hopes for more passionate writers such as you who are not afraid to mention how they believe. At all times go after your heart. 2021/09/01 6:40 You can certainly see your enthusiasm within the w

You can certainly see your enthusiasm within the work you write.
The world hopes for more passionate writers such as you who are not afraid to
mention how they believe. At all times go after your heart.

# You can certainly see your enthusiasm within the work you write. The world hopes for more passionate writers such as you who are not afraid to mention how they believe. At all times go after your heart. 2021/09/01 6:41 You can certainly see your enthusiasm within the w

You can certainly see your enthusiasm within the work you write.
The world hopes for more passionate writers such as you who are not afraid to
mention how they believe. At all times go after your heart.

# Actually no matter if someone doesn't understand after that its up to other users that they will help, so here it takes place. 2021/09/03 9:52 Actually no matter if someone doesn't understand a

Actually no matter if someone doesn't understand after that its up
to other users that they will help, so here it takes place.

# I like the valuable info you provide in your articles. I will bookmark your weblog and check again here regularly. I am quite certain I'll learn lots of new stuff right here! Good luck for the next! 2021/09/05 22:05 I like the valuable info you provide in your artic

I like the valuable info you provide in your articles.
I will bookmark your weblog and check again here regularly.
I am quite certain I'll learn lots of new stuff right here!

Good luck for the next!

# I like the valuable info you provide in your articles. I will bookmark your weblog and check again here regularly. I am quite certain I'll learn lots of new stuff right here! Good luck for the next! 2021/09/05 22:06 I like the valuable info you provide in your artic

I like the valuable info you provide in your articles.
I will bookmark your weblog and check again here regularly.
I am quite certain I'll learn lots of new stuff right here!

Good luck for the next!

# I like the valuable info you provide in your articles. I will bookmark your weblog and check again here regularly. I am quite certain I'll learn lots of new stuff right here! Good luck for the next! 2021/09/05 22:07 I like the valuable info you provide in your artic

I like the valuable info you provide in your articles.
I will bookmark your weblog and check again here regularly.
I am quite certain I'll learn lots of new stuff right here!

Good luck for the next!

# I like the valuable info you provide in your articles. I will bookmark your weblog and check again here regularly. I am quite certain I'll learn lots of new stuff right here! Good luck for the next! 2021/09/05 22:08 I like the valuable info you provide in your artic

I like the valuable info you provide in your articles.
I will bookmark your weblog and check again here regularly.
I am quite certain I'll learn lots of new stuff right here!

Good luck for the next!

# I loved as much as you'll receive carried out right here. The sketch is attractive, your authored subject matter stylish. nonetheless, you command get bought an impatience over that you wish be delivering the following. unwell unquestionably come more f 2021/09/13 11:11 I loved as much as you'll receive carried out righ

I loved as much as you'll receive carried out right here. The sketch is attractive, your authored subject matter stylish.

nonetheless, you command get bought an impatience over that you wish be delivering the following.

unwell unquestionably come more formerly again as exactly
the same nearly very often inside case you shield this increase.
ps4 https://bitly.com/3nkdKIi ps4 games

# It's in fact very complicated in this busy life to listen news on TV, so I only use world wide web for that purpose, and obtain the most up-to-date information. 2021/10/27 2:41 It's in fact very complicated in this busy life t

It's in fact very complicated in this busy life to
listen news on TV, so I only use world wide web for that purpose, and obtain the most up-to-date information.

# It's in fact very complicated in this busy life to listen news on TV, so I only use world wide web for that purpose, and obtain the most up-to-date information. 2021/10/27 2:42 It's in fact very complicated in this busy life t

It's in fact very complicated in this busy life to
listen news on TV, so I only use world wide web for that purpose, and obtain the most up-to-date information.

# It's in fact very complicated in this busy life to listen news on TV, so I only use world wide web for that purpose, and obtain the most up-to-date information. 2021/10/27 2:43 It's in fact very complicated in this busy life t

It's in fact very complicated in this busy life to
listen news on TV, so I only use world wide web for that purpose, and obtain the most up-to-date information.

# It's in fact very complicated in this busy life to listen news on TV, so I only use world wide web for that purpose, and obtain the most up-to-date information. 2021/10/27 2:44 It's in fact very complicated in this busy life t

It's in fact very complicated in this busy life to
listen news on TV, so I only use world wide web for that purpose, and obtain the most up-to-date information.

# If you are going for finest contents like me, only visit this site all the time as it presents feature contents, thanks 2021/11/12 15:57 If you are going for finest contents like me, only

If you are going for finest contents like me, only visit
this site all the time as it presents feature contents, thanks

# If you are going for finest contents like me, only visit this site all the time as it presents feature contents, thanks 2021/11/12 15:58 If you are going for finest contents like me, only

If you are going for finest contents like me, only visit
this site all the time as it presents feature contents, thanks

# If you are going for finest contents like me, only visit this site all the time as it presents feature contents, thanks 2021/11/12 15:59 If you are going for finest contents like me, only

If you are going for finest contents like me, only visit
this site all the time as it presents feature contents, thanks

# If you are going for finest contents like me, only visit this site all the time as it presents feature contents, thanks 2021/11/12 16:00 If you are going for finest contents like me, only

If you are going for finest contents like me, only visit
this site all the time as it presents feature contents, thanks

# Heya i'm for the first time here. I found this board and I to find It really helpful & it helped me out much. I am hoping to offer one thing back and help others like you aided me. 2021/12/15 8:04 Heya i'm for the first time here. I found this boa

Heya i'm for the first time here. I found this board and I to find It really helpful & it helped me out much.
I am hoping to offer one thing back and help others like you aided me.

# stromectol how much it cost http://stromectolabc.com/
stromectol nz 2022/02/08 10:29 Busjdhj

stromectol how much it cost http://stromectolabc.com/
stromectol nz

# 200 mg doxycycline https://doxycyline1st.com/
buy doxycycline monohydrate 2022/02/25 22:34 Doxycycline

200 mg doxycycline https://doxycyline1st.com/
buy doxycycline monohydrate

# doxycycline hyc https://doxycyline1st.com/
doxycycline generic 2022/02/26 9:48 Doxycycline

doxycycline hyc https://doxycyline1st.com/
doxycycline generic

# top ed pills https://erectiledysfunctionpills.shop/ 2022/10/14 16:40 Erectile

top ed pills https://erectiledysfunctionpills.shop/

# buy prednisone mexico https://prednisone20mg.icu/ 2022/10/15 7:14 Prednisone

buy prednisone mexico https://prednisone20mg.icu/

# ed meds online https://ed-pills.site/
best pill for ed 2022/11/17 16:12 EdPills

ed meds online https://ed-pills.site/
best pill for ed

# how can i order prednisone https://prednisonepills.site/
where can i get prednisone 2022/11/28 16:53 Prednisone

how can i order prednisone https://prednisonepills.site/
where can i get prednisone

# free dating and chatting https://datingsiteonline.site/
free meeting online 2022/12/05 17:22 Tading

free dating and chatting https://datingsiteonline.site/
free meeting online

# cheapest ed pills https://edpills.science/
best treatment for ed 2023/01/07 8:32 EdPills

cheapest ed pills https://edpills.science/
best treatment for ed

# dating match https://datingonline1st.com/
singles matching 2023/01/17 17:36 Dating

dating match https://datingonline1st.com/
singles matching

# Get information now. Cautions.
https://edonlinefast.com
Actual trends of drug. drug information and news for professionals and consumers. 2023/02/18 4:27 EdOnline

Get information now. Cautions.
https://edonlinefast.com
Actual trends of drug. drug information and news for professionals and consumers.

# farmacia senza ricetta recensioni https://viasenzaricetta.com/# 2023/04/16 4:23 ViaSenza

farmacia senza ricetta recensioni https://viasenzaricetta.com/#

# ï»¿farmacia online migliore https://farmaciait.pro/ acquisto farmaci con ricetta 2023/12/04 3:45 Farmacia

farmacia online migliore https://farmaciait.pro/ acquisto farmaci con ricetta

# ed medication online https://edpills.tech/# ed pills gnc 2023/12/22 23:51 EdPills

ed medication online https://edpills.tech/# ed pills gnc

タイトル
名前
Url
コメント