It’s more of a workflow question than coding one, but still i don’t know if i should consider rewriting my code if i’m lost in it, it’s just 3rd day of my work, and i already have this problem
Problems:
I hadn’t planned anything specific about the game and started prototype as messing around project with no regards to clean code or future planning whatsoever
My code have different casings and some unredable / not normalized names
I wrote most things in single script
I mix different methods of doing things making it very hard to work further
Those 4 are my biggest concerns, but i fear it might not be a ideal solution - if you had similar problems what would have you done?
It’s almost always better to refactor. You may learn a lot from doing that.
However if you estimate it went beyond redemption - scrap it and start from scratch.
Note that multiple major refactors of large parts of a project are in fact a normal part of development.
Sometimes it will bite u in the ass, but he did say prototype. So guess you’re right. But anyway, all these devs and clones, always saying they have unlimited time of one year, and that they are very fast and a talented dev then saying suddenly they want to refactor XD.
I wonder how they found out about the forums, must have been banned on reedit too and come here to troll instead
hmmm i mostly look at it from this angle - i started this as learning run, i’ve learned a lot, but now i have spaghetti and god script, and even no gameplay yet, it was all to make 50% of main mechanic
it’s not like code is unredable, it’s rather i feel friction when trying to add anything
i don’t say code is bad, i just wonder if i feel that i have big problems with adding new things, it’s good to rewrite entire code, and yes - entire code is for now single mechanic
You did not error handle. The put_data call will return an Error enum that returns zero if the call was successful but other things if the call wasn’t successful.
Dun put ur hand in everything without wearing gloves. Basically if the call fails, u gotta take responsibility and resend the chunk and not just move on.
You knew about this based on the comments, and decided YOLO. So the code is 100% both your fault and responsibility
Read both the file access docs and the StreamPeer docs slowly… they contain the solution on how to error handle or even change the approach
I’m almost finished with my app that I’m writing. It could also be optimised compared to how it’s currently written. Given the small number of users and that the code runs fine as is I may leave it as written as a learning experience so I can start something else.
The main thing to fix would be repetitive code for a rect2 in last menu I’m coding. It’s in 2-3 functions and each time it has to check which of the 3 atlases to use. I could write a separate function to call instead.
rewriting prototype is a great idea, especially if the first version was you figuring out what you are doing in GDScript, once you got the workflow good, development goes really fast.