Ontopic Random Computer-Electronics Thread

Nothing says I have a huge programmer ego like dumping shitty/unsafe code on a forum called "useless forums"
Or maybe arguing over the nanoseconds one's code takes over the other guy's code. Been in this argument too many times and it's one of the reasons I'm leaving coding for good.
 
  • Gravy
Reactions: Jehannum
Or maybe arguing over the nanoseconds one's code takes over the other guy's code. Been in this argument too many times and it's one of the reasons I'm leaving coding for good.
What took you so long?
giphy.gif
 
Or maybe arguing over the nanoseconds one's code takes over the other guy's code. Been in this argument too many times and it's one of the reasons I'm leaving coding for good.
Go look at the code I posted.

First one is gonna be as slow or slower than the original if/then/else code that got posted, which will likely compile to the same machine code as a switch statement anyway. Second code was arguably fast but unsafe as shit, and looking at it again, doesn't even work. Third code is even unsafer, and requires a 26^6 (308.9M entry) lookup table.

And the purpose of those three bits of code? to convert a state to an abbreviation. How many times does a function like that actually get hit? Is it going to remove 25% of the servers out of a data center and save megawatts of power to optimize a dumb function like that?

but nooooo, this is a SERIOUS argument about NANOSECONDS
 
FWIW, I'm pretty sure shit like this matters for the stuff that @gee does.
Yeah, I make impossibly small stuff that has to run for years off tiny batteries.

More about saving nanoamps vs nanoseconds, but it's still a ridiculous exercise in optimization.
 
Go look at the code I posted.

First one is gonna be as slow or slower than the original if/then/else code that got posted, which will likely compile to the same machine code as a switch statement anyway. Second code was arguably fast but unsafe as shit, and looking at it again, doesn't even work. Third code is even unsafer, and requires a 26^6 (308.9M entry) lookup table.

And the purpose of those three bits of code? to convert a state to an abbreviation. How many times does a function like that actually get hit? Is it going to remove 25% of the servers out of a data center and save megawatts of power to optimize a dumb function like that?

but nooooo, this is a SERIOUS argument about NANOSECONDS
Damn did you cats get triggered. I didn't really look at that damn code, just throwing in a little fun with an array is simpler/cleaner.