08-16-2024, 12:35 AM
I'm with you on avoiding the microwave pasta. + 1
Pete
Pete
Shoot first and shoot people who ask questions, later.
Coding Efficiency
|
08-16-2024, 12:35 AM
I'm with you on avoiding the microwave pasta. + 1
Pete
Shoot first and shoot people who ask questions, later.
08-16-2024, 03:21 AM
(08-15-2024, 06:06 PM)justsomeguy Wrote: You know I always want write clean, efficent code, but my muddled brain always ends making thing way more complicated and I feature creep.LOL, that's a perfect example of the "clever" code I spoke of earlier. It's beautiful code in its own strange way but come back to it a year later and it looks like an alien took a dump in the source, especially if every single stage of it is not documented well. Please don't think I'm making fun of your code. Just a perfect example of how some of our "feature creepy" minds work.
08-16-2024, 07:09 AM
Quote:LOL, that's a perfect example of the "clever" code I spoke of earlier. It's beautiful code in its own strange way but come back to it a year later and it looks like an alien took a dump in the source, especially if every single stage of it is not documented well.It was written as a joke and kinda as a challenge, feel free to make fun of it all you want. Its fun to challenge yourself to code something obvious in an unconventional way.
2D physics engine https://github.com/mechatronic3000/fzxNGN
Untitled Rouge-like https://github.com/mechatronic3000/Untitled-Rougelike QB Pool https://github.com/mechatronic3000/QBPool
Here's a good example of coding efficiency which I dug up from the old forums.
Here's the original code: Code: (Select All)
It's pretty simple to decipher what it's doing, and what type of game it is. Quote:Yeah, Pig, I found it at Rosetta, I was curious if it was an interesting game. And so, in the quest to produce ever smaller and fewer lines of code, I came up with this monster: Code: (Select All)
Now, is anyone able to decipher and sort out that obfuscated mess?? Sometimes less is just a mess.
Funniest use of RANDOMIZE TIMER I've ever seen. I mean what kind of hillbilly meth-head would ever code it that way?
Pete
Shoot first and shoot people who ask questions, later.
09-11-2024, 07:59 AM
(09-11-2024, 06:45 AM)Pete Wrote: Funniest use of RANDOMIZE TIMER I've ever seen. I mean what kind of hillbilly meth-head would ever code it that way? One looking for short lines count, without wanting it to take up a line all by itself. LOL! Like I said, it may be a lot few lines of code, but to go back and look at them now.. I had to to do a search to find RANDOMIZE to even know what the heck you were talking about there! If someone told me to take that second code, and fix it cause there's a glitch in it, I'd have to spend three days now trying to sort out just what the heck it's supposed to do, and WTH did I code it so stupidly!
@Steve, Nice condensing of game in LOC and without :, colons!, is impressive but...
I don't particular care for scrolling horizontally, so making less lines but longer ones ??? bad trade-off in my book. But that is style, this thread is about efficiency and this: I am not sure this is more efficient??? I totally agree it is messy as far ease of reading goes.
b = b + ...
It's Lines-of-Code efficient. That's what I was mentioning in the first post -- which form of efficiency does one usually code for? Program efficiency? Disk space efficiency? Line count? Reusability? Ease of coding/maintaining?
That's very efficient on line count, but fails as far as everything else goes. Less is not always better, I don't think. (09-11-2024, 01:51 PM)bplus Wrote: I don't particular care for scrolling horizontally, so making less lines but longer ones ??? bad trade-off in my book. As for that complaint. Pah! Use a smaller font, and a wider monitor!
09-11-2024, 02:39 PM
Yeah wider monitor! as soon as I drop cable from my Spectrum bill, should have that in 6 months!
b = b + ...
09-11-2024, 02:48 PM
Not all of us are lucky enough to have a have a chubby chaser 2000 monitor like Steve. Mine just allows fat ASCII fonts, which is efficient for my eyesight, but doesn't really solve the problem at hand, horizontal scrolling.
I think Steve actually added a neat dimension to this conversation. I mean unless your program is completely and forever finished... code for your code still exists, but you ****ing died, how can you consider it holistically efficient if it takes you three days debug it or reacquaint yourself with it? So neat concept, code that is both efficient to run but is also efficient to work with. +1 Pete
Shoot first and shoot people who ask questions, later.
|
« Next Oldest | Next Newest »
|