Skip to content

改行の追加 to Class#556

Closed
aster-void wants to merge 2 commits into
masterfrom
break-every-sentence-class
Closed

改行の追加 to Class#556
aster-void wants to merge 2 commits into
masterfrom
break-every-sentence-class

Conversation

@aster-void
Copy link
Copy Markdown
Contributor

元のはさすがに読みにくく差分も見にくいのでこっちにさせてください
prettier が対応してなさそうなので prettier-ignore 追加しました

prettier が対応してなさそうなので prettier-ignore 追加しました
@aster-void aster-void requested review from chelproc and chvmvd November 6, 2023 07:04
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Nov 6, 2023

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: b0ffa1e
Status: ✅  Deploy successful!
Preview URL: https://ec2e75c9.utcode-learn.pages.dev
Branch Preview URL: https://allow-short-term-types.utcode-learn.pages.dev

View logs

Copy link
Copy Markdown
Contributor

@chvmvd chvmvd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

これだと不要な空白が随所に入ってしまう気がします。

@aster-void
Copy link
Copy Markdown
Contributor Author

aster-void commented Nov 6, 2023

これだと不要な空白が随所に入ってしまう気がします。

そうですね。幅がほかの文字の 1/8 くらいしかなさそうなので、句点では気づかないレベルだと思いますが、句読点以外ではやめておきます

@aster-void
Copy link
Copy Markdown
Contributor Author

(もとはといえば Term の type が冗長なのが悪いと思います)

@chvmvd
Copy link
Copy Markdown
Contributor

chvmvd commented Nov 6, 2023

改行してはいけないところでされているところがありそうです。


同じ属性を持つ<Term type="javascriptObject">オブジェクト</Term>を複数生成するときに役立つのが**<Term type="javascriptClass">クラス</Term>**です。<Term type="javascriptClass">クラス</Term>では、<Term type="javascriptObject">オブジェクト</Term>の<Term type="javascriptProperty">プロパティ</Term>を予め設定しておくだけでなく、下の<Term type="javascriptMethod">メソッド</Term>の節で説明するように、<Term type="javascriptProperty">プロパティ</Term>を引数にもつような関数も設定しておくことができます。これにより、同じコードを何度も書く必要がなくなるというメリットがあります。<Term type="javascriptClass">クラス</Term>は、同じ<Term type="javascriptProperty">プロパティ</Term>を持つ<Term type="javascriptObject">オブジェクト</Term>を統一的に扱うための仕組みであり、<Term type="javascriptObject">オブジェクト</Term>の設計図と言えます。
同じ属性を持つ<Term type="javascriptObject">オブジェクト</Term>を複数生成するときに役立つのが**<Term type="javascriptClass">クラス</Term>**です。

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ここの空行いらないですね
prettier-ignoreもこの上に動かします


次のコードでは、
先ほど作った `tanaka` のように `name` や `age` という<Term type="javascriptProperty">プロパティ</Term>を持つ<Term type="javascriptObject">オブジェクト</Term>の設計図として、

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ここも


<Term type="javascriptClass">クラス</Term> `Student` を定義しています。

{/* prettier-ignore */}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ここも

こうしてできた<Term type="javascriptObject">オブジェクト</Term>を、
もとになった<Term type="javascriptClass">クラス</Term>の**<Term type="javascriptInstance">インスタンス</Term>**と呼びます。
今回の `age` <Term type="javascriptProperty">プロパティ</Term>のように、

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

謎の空行

@chvmvd
Copy link
Copy Markdown
Contributor

chvmvd commented Nov 6, 2023

後、読点の後に改行を入れるのはあまり一般的ではない気がします。どうなんでしょう。

Copy link
Copy Markdown
Contributor

@chelproc chelproc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1文おきに改行入れるのはよさそうですが文中の改行は自分も一般的ではないと思います。

@aster-void
Copy link
Copy Markdown
Contributor Author

aster-void commented Nov 8, 2023

これも #561 に移行します!

@aster-void aster-void closed this Nov 8, 2023
@chvmvd chvmvd deleted the break-every-sentence-class branch November 8, 2023 03:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants