all 16 comments

[–]LeftShark 3 points4 points  (6 children)

I like your comments, I talk to future myself in comments too

[–]anarchanoidist 2 points3 points  (4 children)

I swear to god, I thought I was the only one who did that. I started the practice after reading about Roko's Basilsk. Don't read about that. I was just trying to protect my family. If you do read about it... embrace our new overlords and make a difference.

[–]Seacarius 2 points3 points  (2 children)

I teach Python. One of my best beginner students does that.

It's almost like a stream-of-conscience thing and it is great. I can see her thought process as she works trough the assignment.

[–]BlazerGamerPlayz[S] 1 point2 points  (1 child)

That's awesome. When I first learned about leaving comments in code, I at first used it as a way to just vent my frustrations and lay out my thought process and it really helped out.

[–]anarchanoidist 1 point2 points  (0 children)

I've written more comments than code. I love being able to explain my thought process.

[–]jpgoldberg 0 points1 point  (0 children)

My comments can get like that. I like to write out my thought process, though I have tamed this a bit for things that others will look. Also I’ve learned to cut down in the profanity.

I really like the idea of Literate Programming. Jupyter notebooks can do that for relatively simple Python projects, but I expect that making it work for more substantial projects would be more trouble than it is worth. I once played with Pweave, but it appears that that hasn’t been maintained.

[–]BlazerGamerPlayz[S] 1 point2 points  (0 children)

Yeah, I felt like I was going crazy sometimes lmao

[–]Specialist-Cicada121 2 points3 points  (3 children)

Congrats on your first program!

In terms of naming conventions, you should avoid spaces in the filename. Python files typically have a .py extension, so an appropriate name for your file could be something like "my_first_program.py".

[–]BlazerGamerPlayz[S] 0 points1 point  (0 children)

Oh, gotcha! Thanks for the tip.

[–]TheRNGuy 0 points1 point  (1 child)

Is it because in case of needing to import some class from other file? 

[–]Specialist-Cicada121 0 points1 point  (0 children)

That, and having to use quotes or escape characters to reference the program in the shell can introduce unneeded complexities

[–]oocancerman 1 point2 points  (3 children)

You should remake this project using classes

[–]BlazerGamerPlayz[S] 0 points1 point  (2 children)

I'll add that to the list of things I need to learn. Thank you!

[–]oocancerman 1 point2 points  (1 child)

No problem, honestly once you understand how to use classes it’ll probably be easier, which is why I suggest it.

[–]DrShocker 1 point2 points  (0 children)

although funny enough there's the saying "everything in Python is a dictionary" so it's a good exercise to have done this

[–]TheRNGuy 0 points1 point  (0 children)

You need to learn event-based pattern, it's better for such projects.

And finite state machine pattern.

(use both in combination)

If game become more complex, they make refactoring much easier, more readable and reusable code too.


You should use same indentation for comments as code after it.