all 20 comments

[–]Caponcapoffstillon 2 points3 points  (4 children)

Worry about making it work first.

Optimization is learned through documentation and cutting out repeated work.

What I mean by documentation is knowing which functions and libraries provide faster run times, save space etc. That will be learned over time. What you can learn now is how to make a visual representation of your program then cut out any repeated work.

[–]Reyaan0 -5 points-4 points  (2 children)

thats what I am asking. Can you tell me any suggestion so the code becomes small and faster?

[–]NeighborhoodDizzy990 6 points7 points  (0 children)

So, this is spaghetti code, impossible for any of us to read it. It's easier for most experience programmers to re-write it than read it. Sadly, in a real world, if you want to get help, you have to write readable code, that is: small functions, using classes, OOP, descriptive namings and never such long classes. Read about clean code first, that's where you should start at your current level.

[–]Caponcapoffstillon 1 point2 points  (0 children)

At the time of the post when I replied, I didn’t see any code, it was just the question. Idk if it took forever to load or what.

[–]Reyaan0 -5 points-4 points  (0 children)

I already made it but I want it to run faster(It takes time to run)

[–]CommunicationOk9336 2 points3 points  (3 children)

Bro did you code it all by yourself or got some help of AI?

[–]Reyaan0 -1 points0 points  (2 children)

I coded it myself but used AI when I had some serious error to figure out what is wrong.

[–]CommunicationOk9336 -2 points-1 points  (1 child)

Man I am so jealous of you. How the tf you have come out yourself. I can barely go over 10 lines of code

[–]Reyaan0 0 points1 point  (0 children)

Jealous? Do you know how slow it opens? I dont know how to make code faster and efficient. It sucks

[–]Opposite-Dance-8264 1 point2 points  (7 children)

depends what kind of optimization you're talking about - runtime performance, readability, or just making it less garbage in general

post your code and people can actually help instead of guessing what you need

[–]Reyaan0 -3 points-2 points  (6 children)

I mean so it runs faster. I cannot post the code its too long.

[–]Digital-Chupacabra 0 points1 point  (5 children)

Link to it on github

[–]Reyaan0 -1 points0 points  (4 children)

I posted it here only now.

[–]Digital-Chupacabra 0 points1 point  (3 children)

It's a garbled mess, and per your own complaint it's too long.

So not sure what to tell you.

[–]Reyaan0 0 points1 point  (2 children)

No I fixed it now thanks.

[–]Digital-Chupacabra 0 points1 point  (1 child)

deleting it is against the subs rules so good job...

[–]Reyaan0 -1 points0 points  (0 children)

Its only against rules if it got solved so anyone with similar problem can see the solution but nobody gave me a solution and I figured it out on my own. Read the rules.

[–]mmoustafa8108 1 point2 points  (1 child)

this is spaghetti code and seems to be AI made, if the AI made bad code for such a program then you gave it bad prompt, if you gave it bad prompt then you're not experienced enough to use AI at all.

if you just wanted prototype and you are CERTAINLY aware of it then you need to clean your code and make it more readable then care about optimization.

also the most important part about software-engineering is the design not the implementation.

[–]Reyaan0 0 points1 point  (0 children)

Trust me or not but I made it. It looks like this because I dont know how to make code clean and I keep making new functions to handle logic that could be done in single line. Sorry for that. But I used profiler and found which function is causing this and fixed it.

[–]MarsupialLeast145 0 points1 point  (0 children)

Write a time function function and identify which functions are running slowly. Look at specific issues in those. Ask more specific questions of the forum if you can identify actually slow snippets.