Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #2

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Develop #2

wants to merge 7 commits into from

Conversation

m-tyto
Copy link
Owner

@m-tyto m-tyto commented Jan 21, 2021

質素ですが、完成しました
レビューをお願いします


function delete_comment(){
$filename = "comment.csv";
$c_id = $_POST['c_id'];

Choose a reason for hiding this comment

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

c_idだとなんのIDかわからないのでcommet_idなどわかりやすいものにした方が良いと思います。

Choose a reason for hiding this comment

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

僕もよくレビューしてもらう時に変数のネーミングで怒られたりするのですが、変数のネーミングをしっかりする理由は業務目線になりますが、相手がパッとコードを見た時にどの変数が入っているかわかりやすいとエラーの改善箇所が見つけやすいのと、コード量が長くなっても変数がわかり易ければコードを追いやすい、さらに自分の後任の人が作業に入りやすくするためだと個人的には考えていて、変数の命名は僕も毎回すごい悩んだりするので意識してかくと自分もあとで見やすくなると思います!

?>
<div class="comment_form">
<form action="" method='post' onsubmit="return add_confirm()">
<dl>

Choose a reason for hiding this comment

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

dl>dt+dd

良いですね。まさにここは使いどころですよね

}
?>
<div class="comment_form">
<form action="" method='post' onsubmit="return add_confirm()">

Choose a reason for hiding this comment

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

actionが空でも大丈夫でしょうか?可能であれば中身書いてもらった方が一般的なのでレビューしてる側としても安心できます

?>
<div class="comment">
<p><?php echo $comment[2] ?></p>
<p><?php echo $comment[3] ?></p>

Choose a reason for hiding this comment

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

これだとコメントは二つまでしか表示されないのではないでしょうか?
間違っていたらすいません。

index.php Outdated
function judge(){
if($_SERVER['REQUEST_METHOD'] === 'POST'){
if(empty($_POST['title']) || empty($_POST['sentence'])){
$msg = "タイトル,本文のは必須入力です";

Choose a reason for hiding this comment

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

細かいですが文言が間違っておりますね

index.php Outdated
}
fclose($fp);
$file_array = array_reverse($file_array);
$now = 1;

Choose a reason for hiding this comment

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

$nowだとわかりにくいので
$page_num
でも良いかと思います

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.

None yet

3 participants