プレイ日記
Hunter pHUNTERq
Make your code readable, people!
15そうだね
プレイ済み
返信[1]
親投稿
swordx Sworddx
I don't make games foe for others to read my code...I make them because I enjoy making games. If others want to play them or look at my code, that's fine, but as long as I know what my code means, I don't care if anyone else can read it.
2そうだね
未プレイ
返信[2]
親投稿
Andres TanookiOcarina
@ swordx: That doesn't mean you shouldn't comment your code. If you were to showcase a function that does random things other people didn't know about, you'd have to comment after each line of code a message saying what a line does. "This is the game loop!" "Here's where I override my Digestion function!" Whether you like it or not, commenting is highly recommended.
1そうだね
未プレイ
返信[3]
親投稿
Ed CPFace
I didn't write a lot of detailed comments back on PTC because of the screen restrictions. A wider screen and word wrap really helps.
0そうだね
プレイ済み
返信[4]
親投稿
Johnny devilwaffle
Even if it's minor, comments slow the program. Mine is 550 and will likely end at 1-2 thousand lines long. I comment on segments of code, and I'm planning to add a variable reference at the bottom, but every line is overkill.
0そうだね
プレイ済み
返信[5]
親投稿
Hunter pHUNTERq
Is that so? I would love to see your reasoning behind that, because my tests say otherwise. Remember, what you are saying is true for Petit Computer but I have yet to see anything about comments slowing down programs for SmileBasic.
0そうだね
プレイ済み
返信[6]
親投稿
swordx Sworddx
@T Ocarina that's if I was showcasing a function...but I'm not. I'm simply making games because it's fun. I do comment my code when I present games I've made, but what I make on SmileBASIC is not made to be presented.
0そうだね
プレイ済み
返信[7]
親投稿
Hunter pHUNTERq
@swordx Commenting isn't just for other's to read your code, it's also for yourself. I find commenting my code helps me gain a greater understanding of what I just wrote. Many times I've gone back to old projects, just to stop and think to myself, "what the heck was I doing." Now it's your choice if you want to comment or not but remember this: It helps you just as much as it helps others.
0そうだね
プレイ済み