0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【公ド読】コードの読みやすさと保守容易性を改良する

Posted at

【公式ドキュメントを読もうシリーズ】コードの読みやすさと保守容易性を改良する

シリーズ概要

https://qiita.com/yasu_programming/items/cec66f9e8d5d571e9ce3

URL

https://docs.github.com/ja/copilot/copilot-chat-cookbook/refactoring-code/improving-code-readability-and-maintainability

説明

リファクタリングに関しての具体的な方法に関して書かれている。

わかりづらい変数名 -> 理解しやすい変数名

Improve the variable names in this function

複雑なif文の条件式 -> 理解しやすい関数

Simplify this code. Avoid using if/else chains but retain all function return values.

深い入れ子の条件式 -> 早期リターンによる可読性の高い関数

Rewrite this code to avoid the nested if/else statements

複数の責務が混ざっている関数 -> 責務の分離

How could the processOrder method be refactored to be more useful and easier to maintain

所感

リファクタリングの方法をGithub Copilotで対応してくれる。

解像度の高いプロンプトを渡して、いいリファクタリングをしてもらえるようにしたい。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?